version 0.1.1
[phplua.git] / php_lua.h
blob81102c1c29b75e8a7898a90f5456d736e416fe22
1 /*
2 +----------------------------------------------------------------------+
3 | PHP Version 5 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1997-2006 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Author: |
16 +----------------------------------------------------------------------+
19 /* $Id: php_lua.h,v 1.2 2008/03/31 09:50:39 sfox Exp $ */
21 #ifndef PHP_LUA_H
22 #define PHP_LUA_H
24 extern zend_module_entry lua_module_entry;
25 #define phpext_lua_ptr &lua_module_entry
27 #define PHP_LUA_VERSION "0.1.1"
29 #ifdef PHP_WIN32
30 #define PHP_LUA_API __declspec(dllexport)
31 #else
32 #define PHP_LUA_API
33 #endif
35 #ifdef ZTS
36 #include "TSRM.h"
37 #endif
39 PHP_MINIT_FUNCTION(lua);
40 PHP_MSHUTDOWN_FUNCTION(lua);
41 PHP_RINIT_FUNCTION(lua);
42 PHP_RSHUTDOWN_FUNCTION(lua);
43 PHP_MINFO_FUNCTION(lua);
45 PHP_FUNCTION(confirm_lua_compiled); /* For testing, remove later. */
47 ZEND_BEGIN_MODULE_GLOBALS(lua)
48 zval **lua_callback;
49 long lua_callback_count;
50 zend_bool load_standard_libs;
51 ZEND_END_MODULE_GLOBALS(lua)
53 /* In every utility function you add that needs to use variables
54 in php_lua_globals, call TSRMLS_FETCH(); after declaring other
55 variables used by that function, or better yet, pass in TSRMLS_CC
56 after the last function argument and declare your utility function
57 with TSRMLS_DC after the last declared argument. Always refer to
58 the globals in your function as LUA_G(variable). You are
59 encouraged to rename these macros something shorter, see
60 examples in any other php module directory.
63 #ifdef ZTS
64 #define LUA_G(v) TSRMG(lua_globals_id, zend_lua_globals *, v)
65 #else
66 #define LUA_G(v) (lua_globals.v)
67 #endif
69 #endif /* PHP_LUA_H */
73 * Local variables:
74 * tab-width: 4
75 * c-basic-offset: 4
76 * End:
77 * vim600: noet sw=4 ts=4 fdm=marker
78 * vim<600: noet sw=4 ts=4