</lead>
<date>2014-10-23</date>
<version>
- <release>0.5.3</release>
+ <release>0.5.4dev</release>
<api>0.5.0</api>
</version>
<stability>
</stability>
<license>BSD, revised</license>
<notes><![CDATA[
-+ Add PostgreSQL-9.4beta3 type OIDs
-* Fix JSON dep (Remi)
* Fix build on MacOSX
]]></notes>
<contents>
#ifndef PHP_PQ_H
#define PHP_PQ_H
-#define PHP_PQ_VERSION "0.5.3"
-
-int pq_module_number;
-zend_module_entry pq_module_entry;
-#define phpext_pq_ptr &pq_module_entry
+#define PHP_PQ_VERSION "0.5.4dev"
#ifdef PHP_WIN32
# define PHP_PQ_API __declspec(dllexport)
# define PHP_PQ_API extern
#endif
+extern int pq_module_number;
+extern zend_module_entry pq_module_entry;
+#define phpext_pq_ptr &pq_module_entry
+
+
#ifdef ZTS
# include "TSRM.h"
# define TSRMLS_DF(d) TSRMLS_D = (d)->ts
struct php_pq_callback *recursion;
} php_pq_callback_t;
-void php_pq_callback_dtor(php_pq_callback_t *cb);
-void php_pq_callback_addref(php_pq_callback_t *cb);
-zval *php_pq_callback_to_zval(php_pq_callback_t *cb);
-zend_bool php_pq_callback_is_locked(php_pq_callback_t *cb TSRMLS_DC);
-void php_pq_callback_recurse(php_pq_callback_t *old, php_pq_callback_t *new TSRMLS_DC);
+extern void php_pq_callback_dtor(php_pq_callback_t *cb);
+extern void php_pq_callback_addref(php_pq_callback_t *cb);
+extern zval *php_pq_callback_to_zval(php_pq_callback_t *cb);
+extern zend_bool php_pq_callback_is_locked(php_pq_callback_t *cb TSRMLS_DC);
+extern void php_pq_callback_recurse(php_pq_callback_t *old, php_pq_callback_t *new TSRMLS_DC);
#endif
#endif
/* trim LF from EOL */
-char *php_pq_rtrim(char *e);
+extern char *php_pq_rtrim(char *e);
/* R, W, RW */
-const char *php_pq_strmode(long mode);
+extern const char *php_pq_strmode(long mode);
/* compare array index */
-int php_pq_compare_index(const void *lptr, const void *rptr TSRMLS_DC);
+extern int php_pq_compare_index(const void *lptr, const void *rptr TSRMLS_DC);
#define PHP_PQerrorMessage(c) php_pq_rtrim(PQerrorMessage((c)))
#define PHP_PQresultErrorMessage(r) php_pq_rtrim(PQresultErrorMessage((r)))
-zend_class_entry *php_pqdt_class_entry;
-zval *php_pqdt_from_string(char *datetime_str, size_t datetime_len, char *fmt, zval *zv TSRMLS_DC);
-void php_pqdt_to_string(zval *zdt, const char *format, char **str_buf, size_t *str_len TSRMLS_DC);
+extern zend_class_entry *php_pqdt_class_entry;
+extern zval *php_pqdt_from_string(char *datetime_str, size_t datetime_len, char *fmt, zval *zv TSRMLS_DC);
+extern void php_pqdt_to_string(zval *zdt, const char *format, char **str_buf, size_t *str_len TSRMLS_DC);
-zend_class_entry *php_pqconv_class_entry;
+extern zend_class_entry *php_pqconv_class_entry;
-HashTable *php_pq_parse_array(php_pqres_t *res, const char *val_str, size_t val_len, Oid typ TSRMLS_DC);
+extern HashTable *php_pq_parse_array(php_pqres_t *res, const char *val_str, size_t val_len, Oid typ TSRMLS_DC);
-PHP_MINIT_FUNCTION(pq_misc);
+extern PHP_MINIT_FUNCTION(pq_misc);
#endif
php_pq_object_prophandler_func_t write;
} php_pq_object_prophandler_t;
-void php_pq_object_to_zval(void *o, zval **zv TSRMLS_DC);
-void php_pq_object_to_zval_no_addref(void *o, zval **zv TSRMLS_DC);
-void php_pq_object_addref(void *o TSRMLS_DC);
-void php_pq_object_delref(void *o TSRMLS_DC);
-HashTable *php_pq_object_debug_info(zval *object, int *temp TSRMLS_DC);
-HashTable *php_pq_object_properties(zval *object TSRMLS_DC);
-zend_class_entry *ancestor(zend_class_entry *ce);
-zval *php_pq_object_read_prop(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
-void php_pq_object_write_prop(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
+extern void php_pq_object_to_zval(void *o, zval **zv TSRMLS_DC);
+extern void php_pq_object_to_zval_no_addref(void *o, zval **zv TSRMLS_DC);
+extern void php_pq_object_addref(void *o TSRMLS_DC);
+extern void php_pq_object_delref(void *o TSRMLS_DC);
+extern HashTable *php_pq_object_debug_info(zval *object, int *temp TSRMLS_DC);
+extern HashTable *php_pq_object_properties(zval *object TSRMLS_DC);
+extern zend_class_entry *ancestor(zend_class_entry *ce);
+extern zval *php_pq_object_read_prop(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
+extern void php_pq_object_write_prop(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
#endif
#endif
} php_pq_params_t;
-php_pq_params_t *php_pq_params_init(HashTable *conv, HashTable *oids, HashTable *params TSRMLS_DC);
-void php_pq_params_free(php_pq_params_t **p);
-unsigned php_pq_params_set_params(php_pq_params_t *p, HashTable *params);
-unsigned php_pq_params_set_type_oids(php_pq_params_t *p, HashTable *oids);
-unsigned php_pq_params_add_type_oid(php_pq_params_t *p, Oid type);
-unsigned php_pq_params_add_param(php_pq_params_t *p, zval *param);
-void php_pq_params_set_type_conv(php_pq_params_t *p, HashTable *conv);
-
+extern php_pq_params_t *php_pq_params_init(HashTable *conv, HashTable *oids, HashTable *params TSRMLS_DC);
+extern void php_pq_params_free(php_pq_params_t **p);
+extern unsigned php_pq_params_set_params(php_pq_params_t *p, HashTable *params);
+extern unsigned php_pq_params_set_type_oids(php_pq_params_t *p, HashTable *oids);
+extern unsigned php_pq_params_add_type_oid(php_pq_params_t *p, Oid type);
+extern unsigned php_pq_params_add_param(php_pq_params_t *p, zval *param);
+extern void php_pq_params_set_type_conv(php_pq_params_t *p, HashTable *conv);
#endif
php_pqcancel_t *intern;
} php_pqcancel_object_t;
-zend_class_entry *php_pqcancel_class_entry;
-zend_object_value php_pqcancel_create_object_ex(zend_class_entry *ce, php_pqcancel_t *intern, php_pqcancel_object_t **ptr TSRMLS_DC);
+extern zend_class_entry *php_pqcancel_class_entry;
+extern zend_object_value php_pqcancel_create_object_ex(zend_class_entry *ce, php_pqcancel_t *intern, php_pqcancel_object_t **ptr TSRMLS_DC);
-PHP_MINIT_FUNCTION(pqcancel);
-PHP_MSHUTDOWN_FUNCTION(pqcancel);
+extern PHP_MINIT_FUNCTION(pqcancel);
+extern PHP_MSHUTDOWN_FUNCTION(pqcancel);
#endif
long flags;
} php_pqconn_resource_factory_data_t;
-php_resource_factory_ops_t *php_pqconn_get_resource_factory_ops(void);
+extern php_resource_factory_ops_t *php_pqconn_get_resource_factory_ops(void);
-zend_class_entry *php_pqconn_class_entry;
-zend_object_value php_pqconn_create_object_ex(zend_class_entry *ce, php_pqconn_t *intern, php_pqconn_object_t **ptr TSRMLS_DC);
-void php_pqconn_notify_listeners(php_pqconn_object_t *obj TSRMLS_DC);
-STATUS php_pqconn_prepare(zval *object, php_pqconn_object_t *obj, const char *name, const char *query, php_pq_params_t *params TSRMLS_DC);
-STATUS php_pqconn_prepare_async(zval *object, php_pqconn_object_t *obj, const char *name, const char *query, php_pq_params_t *params TSRMLS_DC);
-STATUS php_pqconn_start_transaction(zval *zconn, php_pqconn_object_t *conn_obj, long isolation, zend_bool readonly, zend_bool deferrable TSRMLS_DC);
-STATUS php_pqconn_start_transaction_async(zval *zconn, php_pqconn_object_t *conn_obj, long isolation, zend_bool readonly, zend_bool deferrable TSRMLS_DC);
-STATUS php_pqconn_declare(zval *object, php_pqconn_object_t *obj, const char *decl TSRMLS_DC);
-STATUS php_pqconn_declare_async(zval *object, php_pqconn_object_t *obj, const char *decl TSRMLS_DC);
+extern zend_class_entry *php_pqconn_class_entry;
+extern zend_object_value php_pqconn_create_object_ex(zend_class_entry *ce, php_pqconn_t *intern, php_pqconn_object_t **ptr TSRMLS_DC);
+extern void php_pqconn_notify_listeners(php_pqconn_object_t *obj TSRMLS_DC);
+extern STATUS php_pqconn_prepare(zval *object, php_pqconn_object_t *obj, const char *name, const char *query, php_pq_params_t *params TSRMLS_DC);
+extern STATUS php_pqconn_prepare_async(zval *object, php_pqconn_object_t *obj, const char *name, const char *query, php_pq_params_t *params TSRMLS_DC);
+extern STATUS php_pqconn_start_transaction(zval *zconn, php_pqconn_object_t *conn_obj, long isolation, zend_bool readonly, zend_bool deferrable TSRMLS_DC);
+extern STATUS php_pqconn_start_transaction_async(zval *zconn, php_pqconn_object_t *conn_obj, long isolation, zend_bool readonly, zend_bool deferrable TSRMLS_DC);
+extern STATUS php_pqconn_declare(zval *object, php_pqconn_object_t *obj, const char *decl TSRMLS_DC);
+extern STATUS php_pqconn_declare_async(zval *object, php_pqconn_object_t *obj, const char *decl TSRMLS_DC);
-PHP_MINIT_FUNCTION(pqconn);
-PHP_MSHUTDOWN_FUNCTION(pqconn);
+extern PHP_MINIT_FUNCTION(pqconn);
+extern PHP_MSHUTDOWN_FUNCTION(pqconn);
#endif
#endif
} php_pqconn_event_data_t;
-php_pqconn_event_data_t *php_pqconn_event_data_init(php_pqconn_object_t *obj TSRMLS_DC);
-void php_pqconn_notice_recv(void *p, const PGresult *res);
-void php_pqconn_notice_ignore(void *p, const PGresult *res);
-int php_pqconn_event(PGEventId id, void *e, void *data);
+extern php_pqconn_event_data_t *php_pqconn_event_data_init(php_pqconn_object_t *obj TSRMLS_DC);
+extern void php_pqconn_notice_recv(void *p, const PGresult *res);
+extern void php_pqconn_notice_ignore(void *p, const PGresult *res);
+extern int php_pqconn_event(PGEventId id, void *e, void *data);
#endif
php_pqcopy_t *intern;
} php_pqcopy_object_t;
-zend_class_entry *php_pqcopy_class_entry;
-zend_object_value php_pqcopy_create_object_ex(zend_class_entry *ce, php_pqcopy_t *intern, php_pqcopy_object_t **ptr TSRMLS_DC);
+extern zend_class_entry *php_pqcopy_class_entry;
+extern zend_object_value php_pqcopy_create_object_ex(zend_class_entry *ce, php_pqcopy_t *intern, php_pqcopy_object_t **ptr TSRMLS_DC);
-PHP_MINIT_FUNCTION(pqcopy);
-PHP_MSHUTDOWN_FUNCTION(pqcopy);
+extern PHP_MINIT_FUNCTION(pqcopy);
+extern PHP_MSHUTDOWN_FUNCTION(pqcopy);
#endif
php_pqcur_t *intern;
} php_pqcur_object_t;
-zend_class_entry *php_pqcur_class_entry;
-zend_object_value php_pqcur_create_object_ex(zend_class_entry *ce, php_pqcur_t *intern, php_pqcur_object_t **ptr TSRMLS_DC);
+extern zend_class_entry *php_pqcur_class_entry;
+extern zend_object_value php_pqcur_create_object_ex(zend_class_entry *ce, php_pqcur_t *intern, php_pqcur_object_t **ptr TSRMLS_DC);
-char *php_pqcur_declare_str(const char *name_str, size_t name_len, unsigned flags, const char *query_str, size_t query_len);
+extern char *php_pqcur_declare_str(const char *name_str, size_t name_len, unsigned flags, const char *query_str, size_t query_len);
-PHP_MINIT_FUNCTION(pqcur);
-PHP_MSHUTDOWN_FUNCTION(pqcur);
+extern PHP_MINIT_FUNCTION(pqcur);
+extern PHP_MSHUTDOWN_FUNCTION(pqcur);
#endif
EX_SQL
} php_pqexc_type_t;
-zend_class_entry *exce(php_pqexc_type_t type);
-zval *throw_exce(php_pqexc_type_t type TSRMLS_DC, const char *fmt, ...);
+extern zend_class_entry *exce(php_pqexc_type_t type);
+extern zval *throw_exce(php_pqexc_type_t type TSRMLS_DC, const char *fmt, ...);
-PHP_MINIT_FUNCTION(pqexc);
+extern PHP_MINIT_FUNCTION(pqexc);
#endif
php_pqlob_t *intern;
} php_pqlob_object_t;
-zend_class_entry *php_pqlob_class_entry;
-zend_object_value php_pqlob_create_object_ex(zend_class_entry *ce, php_pqlob_t *intern, php_pqlob_object_t **ptr TSRMLS_DC);
+extern zend_class_entry *php_pqlob_class_entry;
+extern zend_object_value php_pqlob_create_object_ex(zend_class_entry *ce, php_pqlob_t *intern, php_pqlob_object_t **ptr TSRMLS_DC);
-PHP_MINIT_FUNCTION(pqlob);
-PHP_MSHUTDOWN_FUNCTION(pqlob);
+extern PHP_MINIT_FUNCTION(pqlob);
+extern PHP_MSHUTDOWN_FUNCTION(pqlob);
#endif
php_pqres_t *intern;
} php_pqres_object_t;
-STATUS php_pqres_success(PGresult *res TSRMLS_DC);
-void php_pqres_init_instance_data(PGresult *res, php_pqconn_object_t *obj, php_pqres_object_t **ptr TSRMLS_DC);
-zval *php_pqres_row_to_zval(PGresult *res, unsigned row, php_pqres_fetch_t fetch_type, zval **data_ptr TSRMLS_DC);
-zval *php_pqres_typed_zval(php_pqres_t *res, char *val, size_t len, Oid typ TSRMLS_DC);
+extern STATUS php_pqres_success(PGresult *res TSRMLS_DC);
+extern void php_pqres_init_instance_data(PGresult *res, php_pqconn_object_t *obj, php_pqres_object_t **ptr TSRMLS_DC);
+extern zval *php_pqres_row_to_zval(PGresult *res, unsigned row, php_pqres_fetch_t fetch_type, zval **data_ptr TSRMLS_DC);
+extern zval *php_pqres_typed_zval(php_pqres_t *res, char *val, size_t len, Oid typ TSRMLS_DC);
#include "php_pq_object.h"
#include "php_pqconn_event.h"
} \
} while(0)
-zend_class_entry *php_pqres_class_entry;
-zend_object_value php_pqres_create_object_ex(zend_class_entry *ce, php_pqres_t *intern, php_pqres_object_t **ptr TSRMLS_DC);
+extern zend_class_entry *php_pqres_class_entry;
+extern zend_object_value php_pqres_create_object_ex(zend_class_entry *ce, php_pqres_t *intern, php_pqres_object_t **ptr TSRMLS_DC);
-PHP_MINIT_FUNCTION(pqres);
-PHP_MSHUTDOWN_FUNCTION(pqres);
+extern PHP_MINIT_FUNCTION(pqres);
+extern PHP_MSHUTDOWN_FUNCTION(pqres);
#endif
php_pqstm_t *intern;
} php_pqstm_object_t;
-zend_class_entry *php_pqstm_class_entry;
-zend_object_value php_pqstm_create_object_ex(zend_class_entry *ce, php_pqstm_t *intern, php_pqstm_object_t **ptr TSRMLS_DC);
+extern zend_class_entry *php_pqstm_class_entry;
+extern zend_object_value php_pqstm_create_object_ex(zend_class_entry *ce, php_pqstm_t *intern, php_pqstm_object_t **ptr TSRMLS_DC);
-PHP_MINIT_FUNCTION(pqstm);
-PHP_MSHUTDOWN_FUNCTION(pqstm);
+extern PHP_MINIT_FUNCTION(pqstm);
+extern PHP_MSHUTDOWN_FUNCTION(pqstm);
#endif
static zend_object_handlers php_pqtxn_object_handlers;
static HashTable php_pqtxn_object_prophandlers;
-const char *isolation_level(long *isolation)
+const char *php_pq_isolation_level(long *isolation)
{
switch (*isolation) {
case PHP_PQTXN_SERIALIZABLE:
php_pqtxn_t *intern;
} php_pqtxn_object_t;
-const char *isolation_level(long *isolation);
+extern const char *isolation_level(long *isolation);
-zend_class_entry *php_pqtxn_class_entry;
-zend_object_value php_pqtxn_create_object_ex(zend_class_entry *ce, php_pqtxn_t *intern, php_pqtxn_object_t **ptr TSRMLS_DC);
+extern zend_class_entry *php_pqtxn_class_entry;
+extern zend_object_value php_pqtxn_create_object_ex(zend_class_entry *ce, php_pqtxn_t *intern, php_pqtxn_object_t **ptr TSRMLS_DC);
-PHP_MINIT_FUNCTION(pqtxn);
-PHP_MSHUTDOWN_FUNCTION(pqtxn);
+extern PHP_MINIT_FUNCTION(pqtxn);
+extern PHP_MSHUTDOWN_FUNCTION(pqtxn);
#endif
php_pqtypes_t *intern;
} php_pqtypes_object_t;
-zend_class_entry *php_pqtypes_class_entry;
-zend_object_value php_pqtypes_create_object_ex(zend_class_entry *ce, php_pqtypes_t *intern, php_pqtypes_object_t **ptr TSRMLS_DC);
+extern zend_class_entry *php_pqtypes_class_entry;
+extern zend_object_value php_pqtypes_create_object_ex(zend_class_entry *ce, php_pqtypes_t *intern, php_pqtypes_object_t **ptr TSRMLS_DC);
-PHP_MINIT_FUNCTION(pqtypes);
-PHP_MSHUTDOWN_FUNCTION(pqtypes);
+extern PHP_MINIT_FUNCTION(pqtypes);
+extern PHP_MSHUTDOWN_FUNCTION(pqtypes);
#endif