implemented get_properties() object handler
[m6w6/ext-pq] / src / php_pqconn.h
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: pq |
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 +--------------------------------------------------------------------+
11 */
12
13
14 #ifndef PHP_PQCONN_H
15 #define PHP_PQCONN_H
16
17 #define PHP_PQCONN_ASYNC 0x01
18 #define PHP_PQCONN_PERSISTENT 0x02
19
20 #include <ext/raphf/php_raphf.h>
21 #include "php_pq_callback.h"
22
23 typedef struct php_pqconn {
24 PGconn *conn;
25 int (*poller)(PGconn *);
26 php_resource_factory_t factory;
27 HashTable listeners;
28 HashTable eventhandlers;
29 php_pq_callback_t onevent;
30 unsigned unbuffered:1;
31 } php_pqconn_t;
32
33 typedef struct php_pqconn_object {
34 zend_object zo;
35 zend_object_value zv;
36 HashTable *prophandler;
37 php_pqconn_t *intern;
38 } php_pqconn_object_t;
39
40 typedef struct php_pqconn_resource_factory_data {
41 char *dsn;
42 long flags;
43 } php_pqconn_resource_factory_data_t;
44
45 php_resource_factory_ops_t *php_pqconn_get_resource_factory_ops(void);
46
47 zend_class_entry *php_pqconn_class_entry;
48 zend_object_value php_pqconn_create_object_ex(zend_class_entry *ce, php_pqconn_t *intern, php_pqconn_object_t **ptr TSRMLS_DC);
49 void php_pqconn_notify_listeners(php_pqconn_object_t *obj TSRMLS_DC);
50 STATUS php_pqconn_prepare(zval *object, php_pqconn_object_t *obj, const char *name, const char *query, HashTable *typest TSRMLS_DC);
51 STATUS php_pqconn_prepare_async(zval *object, php_pqconn_object_t *obj, const char *name, const char *query, HashTable *typest TSRMLS_DC);
52 STATUS php_pqconn_start_transaction(zval *zconn, php_pqconn_object_t *conn_obj, long isolation, zend_bool readonly, zend_bool deferrable TSRMLS_DC);
53 STATUS php_pqconn_start_transaction_async(zval *zconn, php_pqconn_object_t *conn_obj, long isolation, zend_bool readonly, zend_bool deferrable TSRMLS_DC);
54
55 PHP_MINIT_FUNCTION(pqconn);
56
57 #endif
58
59 /*
60 * Local variables:
61 * tab-width: 4
62 * c-basic-offset: 4
63 * End:
64 * vim600: noet sw=4 ts=4 fdm=marker
65 * vim<600: noet sw=4 ts=4
66 */