X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pqres.h;h=507c3a4d9960c97ce9c130fd051fd28aac129672;hp=f5b9b6e10d3968d1ad84ff446cba89d11ffb0810;hb=218002ba9087cf49f90e5f098f68a154d6092c78;hpb=d613997b3072b8093bca3fe9d8aca115e2a579aa diff --git a/src/php_pqres.h b/src/php_pqres.h index f5b9b6e..507c3a4 100644 --- a/src/php_pqres.h +++ b/src/php_pqres.h @@ -21,6 +21,12 @@ typedef enum php_pqres_fetch { PHP_PQRES_FETCH_OBJECT } php_pqres_fetch_t; +#define PHP_PQRES_CONV_BOOL 0x01 +#define PHP_PQRES_CONV_INT 0x02 +#define PHP_PQRES_CONV_FLOAT 0x04 +#define PHP_PQRES_CONV_ARRAY 0x08 +#define PHP_PQRES_CONV_DATETIME 0x10 + typedef struct php_pqres_iterator { zend_object_iterator zi; zval *current_val; @@ -34,6 +40,7 @@ typedef struct php_pqres { HashTable bound; HashTable converters; unsigned default_fetch_type:2; + unsigned auto_convert:6; } php_pqres_t; typedef struct php_pqres_object { @@ -46,6 +53,7 @@ typedef struct php_pqres_object { 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); #include "php_pq_object.h" #include "php_pqconn_event.h"