Freeciv-3.3
|
Go to the source code of this file.
Functions | |
void | api_specenum_create_table (lua_State *L, const char *name, lua_CFunction findex) |
#define API_SPECENUM_CREATE_TABLE | ( | L, | |
type, | |||
name | |||
) | api_specenum_create_table((L), (name), API_SPECENUM_INDEX_NAME(type)) |
Definition at line 81 of file api_specenum.h.
#define API_SPECENUM_CREATE_TABLE_REV | ( | L, | |
type, | |||
name | |||
) | api_specenum_create_table((L), (name), API_SPECENUM_NAME_NAME(type)) |
Definition at line 83 of file api_specenum.h.
Define a the __index (table, key) -> value metamethod Return the enum value whose name is the concatenation of prefix and key. The fetched value is written back to the lua table, and further accesses will resolve there instead of this function.
Definition at line 29 of file api_specenum.h.
Define the __index (table, key) -> value metamethod Return the enum name whose value is supplied. The fetched value is written back to the lua table, and further accesses will resolve there instead of this function. Note that the indices usually go from 0, not 1.
Definition at line 58 of file api_specenum.h.
#define API_SPECENUM_INDEX_NAME | ( | type | ) | api_specenum_##type##_index |
Definition at line 20 of file api_specenum.h.
#define API_SPECENUM_NAME_NAME | ( | type | ) | api_specenum_##type##_name |
Definition at line 21 of file api_specenum.h.
void api_specenum_create_table | ( | lua_State * | L, |
const char * | name, | ||
lua_CFunction | findex | ||
) |
Create a module table and set the member lookup function.
Definition at line 29 of file api_specenum.c.