author | Myhailo Danylenko <isbear@ukrpost.net> |
Sun, 17 Jan 2010 02:16:30 +0200 | |
changeset 30 | 21547232c875 |
parent 27 | 23393a00c2c1 |
permissions | -rw-r--r-- |
23 | 1 |
|
2 |
/* Copyright 2009 Myhailo Danylenko |
|
3 |
||
4 |
This file is part of lua-lm. |
|
5 |
||
6 |
lua-lm is free software: you can redistribute it and/or modify |
|
7 |
it under the terms of the GNU General Public License as published by |
|
8 |
the Free Software Foundation, either version 2 of the License, or |
|
9 |
(at your option) any later version. |
|
10 |
||
11 |
This program is distributed in the hope that it will be useful, |
|
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
GNU General Public License for more details. |
|
15 |
||
16 |
You should have received a copy of the GNU General Public License |
|
17 |
along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
|
0 | 18 |
|
19 |
#ifndef LLM_TYPES_H |
|
20 |
#define LLM_TYPES_H |
|
21 |
||
22 |
#include <lua.h> |
|
23 |
#include <loudmouth/loudmouth.h> |
|
24 |
||
25 |
#ifndef LLM_OBJREGISTRY |
|
17 | 26 |
#define LLM_OBJREGISTRY "llm.obj_registry" |
0 | 27 |
#endif |
28 |
||
29 |
typedef struct { |
|
30 |
int reference; |
|
31 |
lua_State *L; |
|
32 |
} llm_callback_t; |
|
33 |
||
34 |
void llm_callback_destroy (llm_callback_t *cb); |
|
35 |
||
36 |
#define LLM_DECLARE(WHAT, TYPE) \ |
|
37 |
typedef struct { \ |
|
38 |
TYPE *WHAT; \ |
|
39 |
} llm_##WHAT##_t; \ |
|
40 |
\ |
|
41 |
llm_##WHAT##_t *luaL_checklm_##WHAT (lua_State *L, int index); \ |
|
27
23393a00c2c1
Small typo and header fixes
Myhailo Danylenko <isbear@ukrpost.net>
parents:
23
diff
changeset
|
42 |
llm_##WHAT##_t *bless_lm_##WHAT (lua_State *L, TYPE *WHAT); |
0 | 43 |
|
44 |
LLM_DECLARE (connection, LmConnection) |
|
45 |
LLM_DECLARE (message, LmMessage) |
|
11
a8c6460d612b
Naming scheme change to more ld-friendly
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
46 |
LLM_DECLARE (handler, LmMessageHandler) |
a8c6460d612b
Naming scheme change to more ld-friendly
Myhailo Danylenko <isbear@ukrpost.net>
parents:
7
diff
changeset
|
47 |
LLM_DECLARE (node, LmMessageNode) |
0 | 48 |
LLM_DECLARE (proxy, LmProxy) |
49 |
LLM_DECLARE (ssl, LmSSL) |
|
50 |
||
7
5db1448eb857
Message have node methods
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
51 |
LmMessageNode *luaL_checkLmMessageNode (lua_State *L, int index); |
5db1448eb857
Message have node methods
Myhailo Danylenko <isbear@ukrpost.net>
parents:
0
diff
changeset
|
52 |
|
0 | 53 |
#undef LLM_DECLARE |
54 |
||
55 |
#endif |
|
56 |