projects
/
m6w6
/
ext-pq
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
refactor auto conversion
[m6w6/ext-pq]
/
src
/
php_pqres.h
diff --git
a/src/php_pqres.h
b/src/php_pqres.h
index 9786249757818b889132685bf3f93fc720d66224..4afff3948776a303dc9919c59f02b01d04b3a122 100644
(file)
--- a/
src/php_pqres.h
+++ b/
src/php_pqres.h
@@
-15,12
+15,21
@@
#define PHP_PQRES_H
#include "php_pqconn.h"
#define PHP_PQRES_H
#include "php_pqconn.h"
+
typedef enum php_pqres_fetch {
PHP_PQRES_FETCH_ARRAY,
PHP_PQRES_FETCH_ASSOC,
PHP_PQRES_FETCH_OBJECT
} php_pqres_fetch_t;
typedef enum php_pqres_fetch {
PHP_PQRES_FETCH_ARRAY,
PHP_PQRES_FETCH_ASSOC,
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_SCALAR 0x0f
+#define PHP_PQRES_CONV_ARRAY 0x10
+#define PHP_PQRES_CONV_DATETIME 0x20
+#define PHP_PQRES_CONV_ALL 0xff
+
typedef struct php_pqres_iterator {
zend_object_iterator zi;
zval *current_val;
typedef struct php_pqres_iterator {
zend_object_iterator zi;
zval *current_val;
@@
-33,6
+42,8
@@
typedef struct php_pqres {
php_pqres_iterator_t *iter;
HashTable bound;
HashTable converters;
php_pqres_iterator_t *iter;
HashTable bound;
HashTable converters;
+ unsigned auto_convert;
+ php_pqres_fetch_t default_fetch_type;
} php_pqres_t;
typedef struct php_pqres_object {
} php_pqres_t;
typedef struct php_pqres_object {
@@
-45,6
+56,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);
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"
#include "php_pq_object.h"
#include "php_pqconn_event.h"