/*1* Mesa 3-D graphics library2*3* Copyright (C) 2010 LunarG Inc.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the "Software"),7* to deal in the Software without restriction, including without limitation8* the rights to use, copy, modify, merge, publish, distribute, sublicense,9* and/or sell copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice shall be included13* in all copies or substantial portions of the Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL18* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER19* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING20* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER21* DEALINGS IN THE SOFTWARE.22*23* Authors:24* Chia-I Wu <[email protected]>25*/2627#ifndef _TABLE_H_28#define _TABLE_H_2930#include "c99_compat.h"31#include "entry.h"3233#define MAPI_TMP_TABLE34#include "mapi_tmp.h"3536#define MAPI_TABLE_NUM_SLOTS (MAPI_TABLE_NUM_STATIC + MAPI_TABLE_NUM_DYNAMIC)37#define MAPI_TABLE_SIZE (MAPI_TABLE_NUM_SLOTS * sizeof(mapi_func))3839struct _glapi_table;4041extern const mapi_func table_noop_array[];424344typedef void (*nop_handler_proc)(const char *name);454647void48table_set_noop_handler(nop_handler_proc func);495051/**52* Get the no-op dispatch table.53*/54static inline const struct _glapi_table *55table_get_noop(void)56{57return (const struct _glapi_table *) table_noop_array;58}5960/**61* Set the function of a slot.62*/63static inline void64table_set_func(struct _glapi_table *tbl, int slot, mapi_func func)65{66mapi_func *funcs = (mapi_func *) tbl;67funcs[slot] = func;68}6970/**71* Return the function of a slot.72*/73static inline mapi_func74table_get_func(const struct _glapi_table *tbl, int slot)75{76const mapi_func *funcs = (const mapi_func *) tbl;77return funcs[slot];78}7980#endif /* _TABLE_H_ */818283