ZOO-Project
Macros | Functions | Variables
service_internal_php7.c File Reference
#include <sapi/embed/php_embed.h>
#include <zend_stream.h>
#include "service_internal_php.h"
#include "response_print.h"

Macros

#define ZEND_DEBUG   0
 
#define zval_make_ref_array(zv, len)   for (int elem = 0; elem < len; elem++) ZVAL_MAKE_REF(&zv[elem]);
 
#define zval_unref_array(zv, len)   for (int elem = 0; elem < len; elem++) ZVAL_UNREF(&zv[elem]);
 
#define ZOO_G(v)   (zoo_globals.v)
 
#define PHP_ZOO_VERSION   "1.0"
 
#define PHP_ZOO_EXTNAME   "ZOO"
 
#define phpext_zoo_ptr   &zoo_entry
 

Functions

mapphp_hashtable_to_map (HashTable *tab)
 Convert a php hashtable (array) to a Zoo map. More...
 
mapsphp_array_to_maps (HashTable *arr)
 Convert a php hashtable (array) to a Zoo maps. More...
 
void php_map_to_array (map *src, zval *arr)
 Convert a Zoo map to a php array. More...
 
void php_maps_to_array (maps *src, zval *arr)
 Convert a Zoo struct maps to a php array. More...
 
 PHP_MINIT_FUNCTION (zoo)
 
 PHP_MSHUTDOWN_FUNCTION (zoo)
 
 PHP_RINIT_FUNCTION (zoo)
 
 PHP_FUNCTION (zoo_Translate)
 
 PHP_FUNCTION (zoo_UpdateStatus)
 
 PHP_FUNCTION (zoo_SERVICE_SUCCEEDED)
 
 PHP_FUNCTION (zoo_SERVICE_FAILED)
 
static void php_zoo_init_globals (zend_zoo_globals *zoo_globals)
 
int zoo_php_support (maps **main_conf, map *request, service *s, maps **real_inputs, maps **real_outputs)
 Load a PHP script then run the function corresponding to the service by passing the conf, inputs and outputs parameters by reference. More...
 

Variables

long _SERVICE_SUCCEEDED
 
long _SERVICE_FAILED
 
zend_module_entry zoo_module_entry
 
static zend_function_entry zoo_functions []
 

Macro Definition Documentation

#define PHP_ZOO_EXTNAME   "ZOO"
#define PHP_ZOO_VERSION   "1.0"
#define phpext_zoo_ptr   &zoo_entry
#define ZEND_DEBUG   0
#define ZOO_G (   v)    (zoo_globals.v)
#define zval_make_ref_array (   zv,
  len 
)    for (int elem = 0; elem < len; elem++) ZVAL_MAKE_REF(&zv[elem]);
#define zval_unref_array (   zv,
  len 
)    for (int elem = 0; elem < len; elem++) ZVAL_UNREF(&zv[elem]);

Function Documentation

maps * php_array_to_maps ( HashTable *  arr)

Convert a php hashtable (array) to a Zoo maps.

Parameters
arrthe php hashtable to convert
Returns
the created struct maps*
PHP_FUNCTION ( zoo_Translate  )
PHP_FUNCTION ( zoo_UpdateStatus  )
PHP_FUNCTION ( zoo_SERVICE_SUCCEEDED  )
PHP_FUNCTION ( zoo_SERVICE_FAILED  )
map * php_hashtable_to_map ( HashTable *  tab)

Convert a php hashtable (array) to a Zoo map.

Parameters
tabthe php hashtable to convert
Returns
the created struct map*
void php_map_to_array ( map src,
zval *  arr 
)

Convert a Zoo map to a php array.

Parameters
srcthe struct map* to convert (source data structure)
arrpointer to zval that is to hold the php array
void php_maps_to_array ( maps src,
zval *  arr 
)

Convert a Zoo struct maps to a php array.

Parameters
srcthe struct maps* to convert (source data structure)
arrpointer to zval that is to hold the php array
PHP_MINIT_FUNCTION ( zoo  )
PHP_MSHUTDOWN_FUNCTION ( zoo  )
PHP_RINIT_FUNCTION ( zoo  )
static void php_zoo_init_globals ( zend_zoo_globals *  zoo_globals)
static
int zoo_php_support ( maps **  main_conf,
map request,
service s,
maps **  real_inputs,
maps **  real_outputs 
)

Load a PHP script then run the function corresponding to the service by passing the conf, inputs and outputs parameters by reference.

Parameters
main_confthe conf maps containing the main.cfg settings
requestthe map containing the HTTP request
sthe service structure
real_inputsthe maps containing the inputs
real_outputsthe maps containing the outputs

Variable Documentation

long _SERVICE_FAILED
long _SERVICE_SUCCEEDED
zend_function_entry zoo_functions[]
static
Initial value:
= {
PHP_FE(zoo_SERVICE_FAILED, NULL)
{NULL, NULL, NULL}
}
zend_module_entry zoo_module_entry
Initial value:
= {
PHP_MINIT(zoo),
PHP_MSHUTDOWN(zoo),
PHP_RINIT(zoo),
NULL,
NULL,
STANDARD_MODULE_PROPERTIES
}
#define PHP_ZOO_EXTNAME
Definition: service_internal_php7.c:64
static zend_function_entry zoo_functions[]
Definition: service_internal_php7.c:80