author | Tero Marttila <terom@fixme.fi> |
Wed, 08 Apr 2009 01:28:46 +0300 | |
changeset 120 | 576bab0a1c5a |
parent 116 | 92e71129074d |
child 141 | 0b850238c588 |
permissions | -rw-r--r-- |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
#ifndef LUA_OBJS_H |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
#define LUA_OBJS_H |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
4 |
/** |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
5 |
* @file |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
6 |
* |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
7 |
* Defines lua functions to access the various objects in a nexus |
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
8 |
*/ |
105
b6b183fbf373
implement a separate nexus_lua module
Tero Marttila <terom@fixme.fi>
parents:
93
diff
changeset
|
9 |
#include "nexus_lua.h" |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
10 |
|
116
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
11 |
#include <lua5.1/lua.h> |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
12 |
#include <lua5.1/lauxlib.h> |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
13 |
|
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
14 |
/** |
116
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
15 |
* Register a new metatable for a named type, this leaves the metatable on the stack. |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
16 |
*/ |
116
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
17 |
void lua_obj_create_type (lua_State *L, const char *name, const struct luaL_Reg methods[]); |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
18 |
|
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
19 |
/** |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
20 |
* Create a new userdata with the given type metatable name, return the pointer, and keep it on the stack. |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
21 |
*/ |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
22 |
void* lua_obj_create_obj (lua_State *L, const char *name, size_t size); |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
23 |
|
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
24 |
/** |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
25 |
* Create a new metatable for a type, a userdata for that type, and register it as a global |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
26 |
*/ |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
27 |
void* lua_obj_create_global_type (lua_State *L, const char *type_name, const struct luaL_Reg methods[], const char *global_name, size_t size); |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
28 |
|
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
29 |
/** |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
30 |
* Get a userdata with the given type metatable name as the first argument for a function. |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
31 |
*/ |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
32 |
void* lua_obj_get_obj (lua_State *L, const char *func, const char *name); |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
33 |
|
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
34 |
/** |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
35 |
* Registers our lua runtime objects into the given lua state. |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
36 |
* |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
37 |
* Call in protected mode. |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
38 |
*/ |
92e71129074d
split off lua_irc from lua_objs
Tero Marttila <terom@fixme.fi>
parents:
106
diff
changeset
|
39 |
void lua_objs_init (struct nexus_lua *lua); |
93
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
40 |
|
42ade8285570
add some rudimentary lua support, by having a simple interactive console, and providing access to irc_client_quit
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
41 |
#endif /* LUA_OBJS_H */ |