2 +--------------------------------------------------------------------+
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2013, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
17 #define PHP_PQCONN_ASYNC 0x01
18 #define PHP_PQCONN_PERSISTENT 0x02
20 #include <ext/raphf/php_raphf.h>
21 #include "php_pq_object.h"
22 #include "php_pq_callback.h"
23 #include "php_pq_object.h"
24 #include "php_pq_params.h"
26 typedef struct php_pqconn
{
28 int (*poller
)(PGconn
*);
29 php_resource_factory_t factory
;
33 HashTable eventhandlers
;
34 php_pq_callback_t onevent
;
35 unsigned unbuffered
:1;
36 unsigned default_fetch_type
:2;
37 unsigned default_txn_isolation
:2;
38 unsigned default_txn_readonly
:1;
39 unsigned default_txn_deferrable
:1;
40 unsigned default_auto_convert
:16;
43 typedef struct php_pqconn_object
{
44 PHP_PQ_OBJ_DECL(php_pqconn_t
*)
45 } php_pqconn_object_t
;
47 typedef struct php_pqconn_resource_factory_data
{
50 } php_pqconn_resource_factory_data_t
;
52 extern php_resource_factory_ops_t
*php_pqconn_get_resource_factory_ops(void);
54 extern zend_class_entry
*php_pqconn_class_entry
;
55 extern php_pqconn_object_t
*php_pqconn_create_object_ex(zend_class_entry
*ce
, php_pqconn_t
*intern
);
56 extern void php_pqconn_notify_listeners(php_pqconn_object_t
*obj
);
57 extern ZEND_RESULT_CODE
php_pqconn_prepare(zval
*object
, php_pqconn_object_t
*obj
, const char *name
, const char *query
, php_pq_params_t
*params
);
58 extern ZEND_RESULT_CODE
php_pqconn_prepare_async(zval
*object
, php_pqconn_object_t
*obj
, const char *name
, const char *query
, php_pq_params_t
*params
);
59 extern ZEND_RESULT_CODE
php_pqconn_start_transaction(zval
*zconn
, php_pqconn_object_t
*conn_obj
, long isolation
, zend_bool readonly
, zend_bool deferrable
);
60 extern ZEND_RESULT_CODE
php_pqconn_start_transaction_async(zval
*zconn
, php_pqconn_object_t
*conn_obj
, long isolation
, zend_bool readonly
, zend_bool deferrable
);
61 extern ZEND_RESULT_CODE
php_pqconn_declare(zval
*object
, php_pqconn_object_t
*obj
, const char *decl
);
62 extern ZEND_RESULT_CODE
php_pqconn_declare_async(zval
*object
, php_pqconn_object_t
*obj
, const char *decl
);
64 extern PHP_MINIT_FUNCTION(pqconn
);
65 extern PHP_MSHUTDOWN_FUNCTION(pqconn
);
74 * vim600: noet sw=4 ts=4 fdm=marker
75 * vim<600: noet sw=4 ts=4