Freeciv-3.1
|
#include <string.h>
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "events.h"
#include "support.h"
#include "api_game_specenum.h"
Go to the source code of this file.
Macros | |
#define | API_SPECENUM_INDEX_NAME(type) api_specenum_##type##_index |
#define | API_SPECENUM_CREATE_TABLE(L, type, name) api_specenum_create_table((L), (name), API_SPECENUM_INDEX_NAME(type)) |
#define | API_SPECENUM_DEFINE_INDEX(type_name, prefix) |
Functions | |
static void | api_specenum_create_table (lua_State *L, const char *name, lua_CFunction findex) |
int | api_specenum_open (lua_State *L) |
#define API_SPECENUM_CREATE_TABLE | ( | L, | |
type, | |||
name | |||
) | api_specenum_create_table((L), (name), API_SPECENUM_INDEX_NAME(type)) |
Definition at line 35 of file api_game_specenum.c.
#define API_SPECENUM_DEFINE_INDEX | ( | type_name, | |
prefix | |||
) |
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 44 of file api_game_specenum.c.
Definition at line 34 of file api_game_specenum.c.
|
static |
Create a module table and set the member lookup function.
Definition at line 69 of file api_game_specenum.c.
int api_specenum_open | ( | lua_State * | L | ) |
Define the __index function for each exported specenum type. Load the specenum modules into Lua state L.
Definition at line 98 of file api_game_specenum.c.
Referenced by script_client_init(), and script_server_init().