diff options
author | Remi Collet <remi@remirepo.net> | 2018-01-24 13:21:47 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2018-01-24 13:21:47 +0100 |
commit | 88e8bef6b42bbd1a831e5c8a37e0567251df83bb (patch) | |
tree | 04918715f782ef0312e92d21a99dd2096dec5969 /php_rpminfo.h |
initial work, only PoC for now
Diffstat (limited to 'php_rpminfo.h')
-rw-r--r-- | php_rpminfo.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/php_rpminfo.h b/php_rpminfo.h new file mode 100644 index 0000000..9c8319c --- /dev/null +++ b/php_rpminfo.h @@ -0,0 +1,60 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 7 | + +----------------------------------------------------------------------+ + | Copyright (c) 2018 The PHP Group | + +----------------------------------------------------------------------+ + | 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 | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Remi Collet <remi@php.net> | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_RPMINFO_H +#define PHP_RPMINFO_H + +extern zend_module_entry rpminfo_module_entry; +#define phpext_rpminfo_ptr &rpminfo_module_entry + +#define PHP_RPMINFO_VERSION "0.1.0" /* Replace with version number for your extension */ + +#ifdef PHP_WIN32 +# define PHP_RPMINFO_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define PHP_RPMINFO_API __attribute__ ((visibility("default"))) +#else +# define PHP_RPMINFO_API +#endif + +#ifdef ZTS +#include "TSRM.h" +#endif + +/* + Declare any global variables you may need between the BEGIN + and END macros here: + +ZEND_BEGIN_MODULE_GLOBALS(rpminfo) + zend_long global_value; + char *global_string; +ZEND_END_MODULE_GLOBALS(rpminfo) +*/ + +/* Always refer to the globals in your function as RPMINFO_G(variable). + You are encouraged to rename these macros something shorter, see + examples in any other php module directory. +*/ +#define RPMINFO_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(rpminfo, v) + +#if defined(ZTS) && defined(COMPILE_DL_RPMINFO) +ZEND_TSRMLS_CACHE_EXTERN() +#endif + +#endif /* PHP_RPMINFO_H */ + |