forked from laruence/php-lua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphp_lua.h
82 lines (67 loc) · 2.46 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
/*
+----------------------------------------------------------------------+
| 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]> |
+----------------------------------------------------------------------+
$Id: php_lua.h 324349 2012-03-19 03:17:15Z laruence $
*/
#ifndef PHP_LUA_H
#define PHP_LUA_H
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
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
#if ((PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 3)) || (PHP_MAJOR_VERSION < 5)
#define Z_ADDREF_P ZVAL_ADDREF
#define Z_REFCOUNT_P ZVAL_REFCOUNT
#define Z_DELREF_P ZVAL_DELREF
#endif
#define PHP_LUA_VERSION "0.9.4"
#define Z_LUAVAL_P(obj) ((php_lua_object*)(zend_object_store_get_object(obj TSRMLS_CC)))->L
struct _php_lua_object {
zend_object obj;
lua_State *L;
};
typedef struct _php_lua_object php_lua_object;
zval * php_lua_get_zval_from_lua(lua_State *L, int index, zval *lua_obj TSRMLS_DC);
int php_lua_send_zval_to_lua(lua_State *L, zval *val TSRMLS_DC);
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
*/