4873d8ec56a5851023d1b975821b03bb7f1fc9fd
[m6w6/ext-pq] / src / php_pqtxn.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_PQTXN_H
15 #define PHP_PQTXN_H
16
17 #include "php_pqconn.h"
18
19 typedef enum php_pqtxn_isolation {
20 PHP_PQTXN_READ_COMMITTED,
21 PHP_PQTXN_REPEATABLE_READ,
22 PHP_PQTXN_SERIALIZABLE,
23 } php_pqtxn_isolation_t;
24
25 typedef struct php_pqtxn {
26 php_pqconn_object_t *conn;
27 php_pqtxn_isolation_t isolation;
28 unsigned savepoint;
29 unsigned open:1;
30 unsigned readonly:1;
31 unsigned deferrable:1;
32 } php_pqtxn_t;
33
34 typedef struct php_pqtxn_object {
35 php_pqtxn_t *intern;
36 HashTable *prophandler;
37 zend_object zo;
38 } php_pqtxn_object_t;
39
40 extern const char *php_pq_isolation_level(long *isolation);
41
42 extern zend_class_entry *php_pqtxn_class_entry;
43 extern php_pqtxn_object_t *php_pqtxn_create_object_ex(zend_class_entry *ce, php_pqtxn_t *intern);
44
45 extern PHP_MINIT_FUNCTION(pqtxn);
46 extern PHP_MSHUTDOWN_FUNCTION(pqtxn);
47
48 #endif
49
50 /*
51 * Local variables:
52 * tab-width: 4
53 * c-basic-offset: 4
54 * End:
55 * vim600: noet sw=4 ts=4 fdm=marker
56 * vim<600: noet sw=4 ts=4
57 */