-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathphp_lua.h
87 lines (70 loc) · 2.53 KB
/
php_lua.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
+----------------------------------------------------------------------+
| Lua |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author : Johannes Schlueter <[email protected]> |
| Xinchen Hui <[email protected]> |
| Marcelo Araujo <[email protected]> |
| Helmut Januschka <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifndef PHP_LUA_H
#define PHP_LUA_H
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
/* LUA_OK is defined sinc 5.2 */
#ifndef LUA_OK
#define LUA_OK 0
#endif
extern zend_module_entry lua_module_entry;
#define phpext_lua_ptr &lua_module_entry
#ifdef PHP_WIN32
#define PHP_LUA_API __declspec(dllexport)
#else
#define PHP_LUA_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
#ifdef ZTS
#define LUA_G(v) TSRMG(lua_globals_id, zend_lua_globals *, v)
#else
#define LUA_G(v) (lua_globals.v)
#endif
#define PHP_LUA_VERSION "2.0.8-dev"
struct _php_lua_object {
lua_State *L;
zend_object obj;
};
typedef struct _php_lua_object php_lua_object;
static inline php_lua_object *php_lua_obj_from_obj(zend_object *obj) {
return (php_lua_object*)((char*)(obj)-XtOffsetOf(php_lua_object, obj));
}
#define Z_LUAVAL(obj) php_lua_obj_from_obj(Z_OBJ((obj)))
#define Z_LUAVAL_P(obj) php_lua_obj_from_obj(Z_OBJ_P((obj)))
zval *php_lua_get_zval_from_lua(lua_State *L, int index, zval *lua_obj, zval *rv);
int php_lua_send_zval_to_lua(lua_State *L, zval *val);
PHP_MINIT_FUNCTION(lua);
PHP_MSHUTDOWN_FUNCTION(lua);
PHP_MINFO_FUNCTION(lua);
PHP_METHOD(lua, __construct);
PHP_METHOD(lua, eval);
PHP_METHOD(lua, require);
#endif /* PHP_LUA_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/