isbear@23:
isbear@23: /* Copyright 2009 Myhailo Danylenko
isbear@23:
isbear@23: This file is part of lua-lm.
isbear@23:
isbear@23: lua-lm is free software: you can redistribute it and/or modify
isbear@23: it under the terms of the GNU General Public License as published by
isbear@23: the Free Software Foundation, either version 2 of the License, or
isbear@23: (at your option) any later version.
isbear@23:
isbear@23: This program is distributed in the hope that it will be useful,
isbear@23: but WITHOUT ANY WARRANTY; without even the implied warranty of
isbear@23: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
isbear@23: GNU General Public License for more details.
isbear@23:
isbear@23: You should have received a copy of the GNU General Public License
isbear@23: along with this program. If not, see . */
isbear@0:
isbear@0: #ifndef LLM_TYPES_H
isbear@0: #define LLM_TYPES_H
isbear@0:
isbear@0: #include
isbear@0: #include
isbear@0:
isbear@0: #ifndef LLM_OBJREGISTRY
isbear@17: #define LLM_OBJREGISTRY "llm.obj_registry"
isbear@0: #endif
isbear@0:
isbear@0: typedef struct {
isbear@0: int reference;
isbear@0: lua_State *L;
isbear@0: } llm_callback_t;
isbear@0:
isbear@0: void llm_callback_destroy (llm_callback_t *cb);
isbear@0:
isbear@0: #define LLM_DECLARE(WHAT, TYPE) \
isbear@0: typedef struct { \
isbear@0: TYPE *WHAT; \
isbear@0: } llm_##WHAT##_t; \
isbear@0: \
isbear@0: llm_##WHAT##_t *luaL_checklm_##WHAT (lua_State *L, int index); \
isbear@27: llm_##WHAT##_t *bless_lm_##WHAT (lua_State *L, TYPE *WHAT);
isbear@0:
isbear@0: LLM_DECLARE (connection, LmConnection)
isbear@0: LLM_DECLARE (message, LmMessage)
isbear@11: LLM_DECLARE (handler, LmMessageHandler)
isbear@11: LLM_DECLARE (node, LmMessageNode)
isbear@0: LLM_DECLARE (proxy, LmProxy)
isbear@0: LLM_DECLARE (ssl, LmSSL)
isbear@0:
isbear@7: LmMessageNode *luaL_checkLmMessageNode (lua_State *L, int index);
isbear@7:
isbear@0: #undef LLM_DECLARE
isbear@0:
isbear@0: #endif
isbear@0: