2
// Declarations used by the library modules
6
extern struct lg_module_api *api;
7
extern const char *thismodulename;
8
extern struct module_info *thismodule;
9
extern const struct luaL_reg module_methods[];
10
int load_gnome(lua_State *L);
13
* This structure is used by modules to communicate with the core (gnome)
14
* module. It basically contains version information and a jump table. The
15
* major version must match and the minor version of the core module must be >=
16
* the version of the library module.
18
* The jump table makes calls to the core functions easy: just do
19
* retval = api->funcname(arg1, arg2);
23
struct lg_module_api {
25
const char *hash_method;
26
const char *msgprefix;
27
int (*register_module)(lua_State *L, struct module_info *mi);
28
int (*register_object_type)(const char *name, object_handler handler);
31
const char *(*get_object_name)(struct object *o);
32
int (*generic_index)(lua_State *L);
33
int (*generic_new_array)(lua_State *L, cmi mi, int is_array);
34
const char *(*get_type_name)(typespec_t ts);
36
typespec_t (*find_struct)(lua_State *L, const char *type_name,
38
void *(*optional_func)(lua_State *L, cmi mi, const char *name,
39
const char *min_version);
40
int (*call_byname)(lua_State *L, cmi mi, const char *func_name);
41
int (*call_function)(lua_State *L, const char *module_name,
42
const char *func_name);
43
void (*lua_to_gvalue_cast)(lua_State *L, int index, GValue *gv, GType type);
44
int (*find_object_type)(const char *name);
45
GType (*gtype_from_name)(lua_State *L, cmi mi, const char *s);
46
void (*get_object)(lua_State *L, void *p, typespec_t ts, int flags);
47
struct object_type *(*get_object_type)(lua_State *L, struct object *w);
48
void (*invalidate_object)(lua_State *L, struct object *w);
49
void (*push_gvalue)(lua_State *L, GValue *gv);
50
struct object *(*object_arg)(lua_State *L, int index, const char *name);
51
int (*push_constant)(lua_State *L, typespec_t ts, int value);
52
struct lg_enum_t *(*get_constant)(lua_State *L, int index, typespec_t ts,
55
void (*empty_table)(lua_State *L, int index);
57
#define LUAGNOME_MODULE_MAJOR 0
58
#define LUAGNOME_MODULE_MINOR 9