author | Myhailo Danylenko <isbear@ukrpost.net> |
Sun, 05 Apr 2009 14:55:51 +0300 | |
changeset 17 | ab4470465a0c |
parent 11 | a8c6460d612b |
child 23 | 13f03e604c8a |
permissions | -rw-r--r-- |
0 | 1 |
|
2 |
#ifndef LLM_TYPES_H |
|
3 |
#define LLM_TYPES_H |
|
4 |
||
5 |
#include <lua.h> |
|
6 |
#include <loudmouth/loudmouth.h> |
|
7 |
||
8 |
#ifndef LLM_OBJREGISTRY |
|
17 | 9 |
#define LLM_OBJREGISTRY "llm.obj_registry" |
0 | 10 |
#endif |
11 |
||
12 |
typedef struct { |
|
13 |
int reference; |
|
14 |
lua_State *L; |
|
15 |
} llm_callback_t; |
|
16 |
||
17 |
void llm_callback_destroy (llm_callback_t *cb); |
|
18 |
||
19 |
#define LLM_DECLARE(WHAT, TYPE) \ |
|
20 |
typedef struct { \ |
|
21 |
TYPE *WHAT; \ |
|
22 |
} llm_##WHAT##_t; \ |
|
23 |
\ |
|
24 |
llm_##WHAT##_t *luaL_checklm_##WHAT (lua_State *L, int index); \ |
|
25 |
llm_##WHAT##_t *llm_##WHAT##_bless (lua_State *L, TYPE *WHAT); |
|
26 |
||
27 |
LLM_DECLARE (connection, LmConnection) |
|
28 |
LLM_DECLARE (message, LmMessage) |
|
11
a8c6460d612b
Naming scheme change to more ld-friendly
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
29 |
LLM_DECLARE (handler, LmMessageHandler) |
a8c6460d612b
Naming scheme change to more ld-friendly
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
30 |
LLM_DECLARE (node, LmMessageNode) |
0 | 31 |
LLM_DECLARE (proxy, LmProxy) |
32 |
LLM_DECLARE (ssl, LmSSL) |
|
33 |
||
7
5db1448eb857
Message have node methods
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
34 |
LmMessageNode *luaL_checkLmMessageNode (lua_State *L, int index); |
5db1448eb857
Message have node methods
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
35 |
|
0 | 36 |
#undef LLM_DECLARE |
37 |
||
38 |
#endif |
|
39 |