[libvirt] [libvirt-php][PATCH 05/11] src: Introduce util.h
Michal Privoznik
mprivozn at redhat.com
Tue Sep 27 13:30:23 UTC 2016
On 27.09.2016 15:11, Michal Privoznik wrote:
> Move out some macros that are shared between multiple source
> files into a separate file called util.h.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
> src/Makefile.am | 1 +
> src/libvirt-php.c | 19 +++++++++++++++++
> src/libvirt-php.h | 39 ----------------------------------
> src/sockets.c | 1 +
> src/util.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> src/vncfunc.c | 1 +
> 6 files changed, 85 insertions(+), 39 deletions(-)
> create mode 100644 src/util.h
> diff --git a/src/libvirt-php.c b/src/libvirt-php.c
> index 6b145de..b9256db 100644
> --- a/src/libvirt-php.c
> +++ b/src/libvirt-php.c
> @@ -794,6 +799,20 @@ zend_module_entry libvirt_module_entry = {
> ZEND_GET_MODULE(libvirt)
> #endif
>
> +ZEND_BEGIN_MODULE_GLOBALS(libvirt)
> + char *last_error;
> + char *vnc_location;
> + zend_bool longlong_to_string_ini;
> + char *iso_path_ini;
> + char *image_path_ini;
> + zend_long max_connections_ini;
> +#ifdef DEBUG_SUPPORT
> + int debug;
> +#endif
> + resource_info *binding_resources;
> + int binding_resources_count;
> +ZEND_END_MODULE_GLOBALS(libvirt)
> +
D'oh. In some compilers, forward declaration is not supported so this
breaks. Therefore I am squashing this in:
diff --git c/src/libvirt-php.c i/src/libvirt-php.c
index b9256db..9218f71 100644
--- c/src/libvirt-php.c
+++ i/src/libvirt-php.c
@@ -159,8 +159,6 @@ int le_libvirt_nodedev;
int le_libvirt_stream;
int le_libvirt_snapshot;
-ZEND_DECLARE_MODULE_GLOBALS(libvirt)
-
ZEND_BEGIN_ARG_INFO_EX(arginfo_libvirt_connect, 0, 0, 0)
ZEND_ARG_INFO(0, url)
ZEND_ARG_INFO(0, readonly)
@@ -813,6 +811,8 @@ ZEND_BEGIN_MODULE_GLOBALS(libvirt)
int binding_resources_count;
ZEND_END_MODULE_GLOBALS(libvirt)
+ZEND_DECLARE_MODULE_GLOBALS(libvirt)
+
/* PHP init options */
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("libvirt.longlong_to_string", "1", PHP_INI_ALL,
OnUpdateBool, longlong_to_string_ini, zend_libvirt_globals, libvirt_globals)
Michal
More information about the libvir-list
mailing list