X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pqtxn.h;fp=src%2Fphp_pqtxn.h;h=36f30b27e075d79be38ac1a0ec78f18adaa3fad3;hp=0000000000000000000000000000000000000000;hb=9f5cecf26bd70a92ed013f31afec59e272623ac1;hpb=c566b350f18fe5d2ac5a28e82948514a8798a2b6 diff --git a/src/php_pqtxn.h b/src/php_pqtxn.h new file mode 100644 index 0000000..36f30b2 --- /dev/null +++ b/src/php_pqtxn.h @@ -0,0 +1,57 @@ +/* + +--------------------------------------------------------------------+ + | PECL :: pq | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2013, Michael Wallner | + +--------------------------------------------------------------------+ +*/ + + +#ifndef PHP_PQTXN_H +#define PHP_PQTXN_H + +#include "php_pqconn.h" + +typedef enum php_pqtxn_isolation { + PHP_PQTXN_READ_COMMITTED, + PHP_PQTXN_REPEATABLE_READ, + PHP_PQTXN_SERIALIZABLE, +} php_pqtxn_isolation_t; + +typedef struct php_pqtxn { + php_pqconn_object_t *conn; + php_pqtxn_isolation_t isolation; + unsigned savepoint; + unsigned open:1; + unsigned readonly:1; + unsigned deferrable:1; +} php_pqtxn_t; + +typedef struct php_pqtxn_object { + zend_object zo; + zend_object_value zv; + HashTable *prophandler; + php_pqtxn_t *intern; +} php_pqtxn_object_t; + +const char *isolation_level(long *isolation); + +zend_class_entry *php_pqtxn_class_entry; +zend_object_value php_pqtxn_create_object_ex(zend_class_entry *ce, php_pqtxn_t *intern, php_pqtxn_object_t **ptr TSRMLS_DC); + +PHP_MINIT_FUNCTION(pqtxn); + +#endif + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */