forked from brett19/php-couchbase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
couchbase.h
49 lines (40 loc) · 1.08 KB
/
couchbase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef COUCHBASE_H_
#define COUCHBASE_H_
#include <libcouchbase/couchbase.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <php.h>
#include <zend_exceptions.h>
#include "php_couchbase.h"
enum pcbc_constants {
PERSISTTO_ONE = 1,
PERSISTTO_TWO = 2,
PERSISTTO_THREE = 4,
PERSISTTO_MASTER = PERSISTTO_ONE,
REPLICATETO_ONE = 1 << 4,
REPLICATETO_TWO = 2 << 4,
REPLICATETO_THREE = 4 << 4
};
typedef struct pcbc_lcb {
char *key;
lcb_t lcb;
void *next;
} pcbc_lcb;
ZEND_BEGIN_MODULE_GLOBALS(couchbase)
// Linked list of bucket connections
pcbc_lcb *first_bconn;
pcbc_lcb *last_bconn;
ZEND_END_MODULE_GLOBALS(couchbase)
ZEND_EXTERN_MODULE_GLOBALS(couchbase)
#ifdef ZTS
#define PCBCG(v) TSRMG(couchbase_globals_id, zend_couchbase_globals *, v)
#else
#define PCBCG(v) (couchbase_globals.v)
#endif
#define PHP_THISOBJ() zend_object_store_get_object(getThis() TSRMLS_CC)
void couchbase_init_exceptions(INIT_FUNC_ARGS);
void couchbase_init_cluster(INIT_FUNC_ARGS);
void couchbase_init_bucket(INIT_FUNC_ARGS);
void couchbase_shutdown_bucket(SHUTDOWN_FUNC_ARGS);
#endif /* COUCHBASE_H_ */