Merge pull request #33 from m6w6/fix-19
[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_PQ_OBJ_DECL(php_pqtxn_t *)
36 } php_pqtxn_object_t;
37
38 extern const char *php_pq_isolation_level(long *isolation);
39
40 extern zend_class_entry *php_pqtxn_class_entry;
41 extern php_pqtxn_object_t *php_pqtxn_create_object_ex(zend_class_entry *ce, php_pqtxn_t *intern);
42
43 extern PHP_MINIT_FUNCTION(pqtxn);
44 extern PHP_MSHUTDOWN_FUNCTION(pqtxn);
45
46 #endif
47
48 /*
49 * Local variables:
50 * tab-width: 4
51 * c-basic-offset: 4
52 * End:
53 * vim600: noet sw=4 ts=4 fdm=marker
54 * vim<600: noet sw=4 ts=4
55 */