Replace all instances of mapi_table with the actual struct _glapi_table.
The former may have been needed when the OpenVG was around. But since
that one is long gone, there' no point in having the current confusing
mix of the two.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
-static inline const struct mapi_table *
+static inline const struct _glapi_table *
entry_current_get(void)
{
#ifdef MAPI_MODE_BRIDGE
entry_current_get(void)
{
#ifdef MAPI_MODE_BRIDGE
void
_glapi_set_dispatch(struct _glapi_table *dispatch)
{
void
_glapi_set_dispatch(struct _glapi_table *dispatch)
{
- u_current_set_table((const struct mapi_table *) dispatch);
+ u_current_set_table((const struct _glapi_table *) dispatch);
if ent.ret:
ret = 'return '
stmt1 = self.indent
if ent.ret:
ret = 'return '
stmt1 = self.indent
- stmt1 += 'const struct mapi_table *_tbl = %s();' % (
+ stmt1 += 'const struct _glapi_table *_tbl = %s();' % (
self.current_get)
stmt2 = self.indent
stmt2 += 'mapi_func _func = ((const mapi_func *) _tbl)[%d];' % (
self.current_get)
stmt2 = self.indent
stmt2 += 'mapi_func _func = ((const mapi_func *) _tbl)[%d];' % (
void
_glapi_set_dispatch(struct _glapi_table *dispatch)
{
void
_glapi_set_dispatch(struct _glapi_table *dispatch)
{
- u_current_set_table((const struct mapi_table *) dispatch);
+ u_current_set_table((const struct _glapi_table *) dispatch);
#define MAPI_TABLE_NUM_SLOTS (MAPI_TABLE_NUM_STATIC + MAPI_TABLE_NUM_DYNAMIC)
#define MAPI_TABLE_SIZE (MAPI_TABLE_NUM_SLOTS * sizeof(mapi_func))
#define MAPI_TABLE_NUM_SLOTS (MAPI_TABLE_NUM_STATIC + MAPI_TABLE_NUM_DYNAMIC)
#define MAPI_TABLE_SIZE (MAPI_TABLE_NUM_SLOTS * sizeof(mapi_func))
extern const mapi_func table_noop_array[];
extern const mapi_func table_noop_array[];
/**
* Get the no-op dispatch table.
*/
/**
* Get the no-op dispatch table.
*/
-static inline const struct mapi_table *
+static inline const struct _glapi_table *
- return (const struct mapi_table *) table_noop_array;
+ return (const struct _glapi_table *) table_noop_array;
}
/**
* Set the function of a slot.
*/
static inline void
}
/**
* Set the function of a slot.
*/
static inline void
-table_set_func(struct mapi_table *tbl, int slot, mapi_func func)
+table_set_func(struct _glapi_table *tbl, int slot, mapi_func func)
{
mapi_func *funcs = (mapi_func *) tbl;
funcs[slot] = func;
{
mapi_func *funcs = (mapi_func *) tbl;
funcs[slot] = func;
* Return the function of a slot.
*/
static inline mapi_func
* Return the function of a slot.
*/
static inline mapi_func
-table_get_func(const struct mapi_table *tbl, int slot)
+table_get_func(const struct _glapi_table *tbl, int slot)
{
const mapi_func *funcs = (const mapi_func *) tbl;
return funcs[slot];
{
const mapi_func *funcs = (const mapi_func *) tbl;
return funcs[slot];
/*@{*/
#if defined(GLX_USE_TLS)
/*@{*/
#if defined(GLX_USE_TLS)
-__thread struct mapi_table *u_current_table
+__thread struct _glapi_table *u_current_table
__attribute__((tls_model("initial-exec")))
__attribute__((tls_model("initial-exec")))
- = (struct mapi_table *) table_noop_array;
+ = (struct _glapi_table *) table_noop_array;
__thread void *u_current_context
__attribute__((tls_model("initial-exec")));
#else
__thread void *u_current_context
__attribute__((tls_model("initial-exec")));
#else
-struct mapi_table *u_current_table =
- (struct mapi_table *) table_noop_array;
+struct _glapi_table *u_current_table =
+ (struct _glapi_table *) table_noop_array;
void *u_current_context;
tss_t u_current_table_tsd;
void *u_current_context;
tss_t u_current_table_tsd;
* table (__glapi_noop_table).
*/
void
* table (__glapi_noop_table).
*/
void
-u_current_set_table(const struct mapi_table *tbl)
+u_current_set_table(const struct _glapi_table *tbl)
{
u_current_init();
stub_init_once();
if (!tbl)
{
u_current_init();
stub_init_once();
if (!tbl)
- tbl = (const struct mapi_table *) table_noop_array;
+ tbl = (const struct _glapi_table *) table_noop_array;
- u_current_table = (struct mapi_table *) tbl;
+ u_current_table = (struct _glapi_table *) tbl;
#else
tss_set(u_current_table_tsd, (void *) tbl);
u_current_table = (ThreadSafe) ? NULL : (void *) tbl;
#else
tss_set(u_current_table_tsd, (void *) tbl);
u_current_table = (ThreadSafe) ? NULL : (void *) tbl;
/**
* Return pointer to current dispatch table for calling thread.
*/
/**
* Return pointer to current dispatch table for calling thread.
*/
u_current_get_table_internal(void)
{
#if defined(GLX_USE_TLS)
return u_current_table;
#else
if (ThreadSafe)
u_current_get_table_internal(void)
{
#if defined(GLX_USE_TLS)
return u_current_table;
#else
if (ThreadSafe)
- return (struct mapi_table *) tss_get(u_current_table_tsd);
+ return (struct _glapi_table *) tss_get(u_current_table_tsd);
- return (struct mapi_table *) u_current_table;
+ return (struct _glapi_table *) u_current_table;
-/* ugly renames to match glapi.h */
-#define mapi_table _glapi_table
-
#ifdef GLX_USE_TLS
#define u_current_table _glapi_tls_Dispatch
#define u_current_context _glapi_tls_Context
#ifdef GLX_USE_TLS
#define u_current_table _glapi_tls_Dispatch
#define u_current_context _glapi_tls_Context
#else /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */
#else /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */
-extern __thread struct mapi_table *u_current_table
+extern __thread struct _glapi_table *u_current_table
__attribute__((tls_model("initial-exec")));
extern __thread void *u_current_context
__attribute__((tls_model("initial-exec")));
extern __thread void *u_current_context
-extern struct mapi_table *u_current_table;
+extern struct _glapi_table *u_current_table;
extern void *u_current_context;
#endif /* GLX_USE_TLS */
extern void *u_current_context;
#endif /* GLX_USE_TLS */
u_current_destroy(void);
void
u_current_destroy(void);
void
-u_current_set_table(const struct mapi_table *tbl);
+u_current_set_table(const struct _glapi_table *tbl);
u_current_get_table_internal(void);
void
u_current_get_table_internal(void);
void
void *
u_current_get_context_internal(void);
void *
u_current_get_context_internal(void);
-static inline const struct mapi_table *
+static inline const struct _glapi_table *
u_current_get_table(void)
{
#ifdef GLX_USE_TLS
u_current_get_table(void)
{
#ifdef GLX_USE_TLS