-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathphp_libmemcached.h
More file actions
88 lines (76 loc) · 2.67 KB
/
php_libmemcached.h
File metadata and controls
88 lines (76 loc) · 2.67 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef PHP_LIBMEMCACHED_H
#define PHP_LIBMEMCACHED_H
extern zend_module_entry libmemcached_module_entry;
#define phpext_libmemcached_ptr &libmemcached_module_entry
#ifdef PHP_WIN32
#define PHP_LIBMEMCACHED_API __declspec(dllexport)
#else
#define PHP_LIBMEMCACHED_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
#include "libmemcached/memcached.h"
#define LIBMEMCACHED_GET_THIS(ce) (getThis() ? (Z_OBJCE_P(getThis()) == ce ? getThis() : NULL) : NULL)
PHP_MINIT_FUNCTION(libmemcached);
PHP_MSHUTDOWN_FUNCTION(libmemcached);
PHP_RINIT_FUNCTION(libmemcached);
PHP_RSHUTDOWN_FUNCTION(libmemcached);
PHP_MINFO_FUNCTION(libmemcached);
PHP_FUNCTION(memcached_add);
PHP_FUNCTION(memcached_add_by_key);
PHP_FUNCTION(memcached_append);
PHP_FUNCTION(memcached_append_by_key);
PHP_FUNCTION(memcached_behavior_get);
PHP_FUNCTION(memcached_behavior_set);
PHP_FUNCTION(memcached_cas);
PHP_FUNCTION(memcached_cas_by_key);
PHP_FUNCTION(memcached_decrement);
PHP_FUNCTION(memcached_delete);
PHP_FUNCTION(memcached_delete_by_key);
PHP_FUNCTION(memcached_fetch);
PHP_FUNCTION(memcached_fetchall);
PHP_FUNCTION(memcached_flush);
PHP_FUNCTION(memcached_get);
PHP_FUNCTION(memcached_gets);
PHP_FUNCTION(memcached_get_by_key);
PHP_FUNCTION(memcached_increment);
PHP_FUNCTION(memcached_mget);
PHP_FUNCTION(memcached_mget_by_key);
PHP_FUNCTION(memcached_prepend);
PHP_FUNCTION(memcached_prepend_by_key);
PHP_FUNCTION(memcached_replace);
PHP_FUNCTION(memcached_replace_by_key);
PHP_FUNCTION(memcached_server_add);
PHP_FUNCTION(memcached_server_list);
PHP_FUNCTION(memcached_server_list_append);
PHP_FUNCTION(memcached_server_push);
PHP_FUNCTION(memcached_set);
PHP_FUNCTION(memcached_set_by_key);
PHP_FUNCTION(memcached_stat);
PHP_FUNCTION(memcached_stat_get_keys);
PHP_FUNCTION(memcached_stat_get_value);
PHP_FUNCTION(memcached_stat_servername);
PHP_FUNCTION(memcached_stats);
PHP_FUNCTION(memcached_ctor);
typedef enum {
MEMCACHED_SERIALIZED= (1 << 0),
MEMCACHED_COMPRESSED= (1 << 1),
} memcached_value_flags;
ZEND_BEGIN_MODULE_GLOBALS(libmemcached)
memcached_server_st *server_list;
ZEND_END_MODULE_GLOBALS(libmemcached)
#ifdef ZTS
#define LIBMEMCACHED_G(v) TSRMG(libmemcached_globals_id, zend_libmemcached_globals *, v)
#else
#define LIBMEMCACHED_G(v) (libmemcached_globals.v)
#endif
#define memcached_objprop_get(zv, key, element, on_error) { \
if (zend_hash_find(Z_OBJPROP(zv), key, strlen(key)+1, (void**)&element) != SUCCESS) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "property [%s] is not set", key); \
element = NULL; \
on_error; \
} \
}
#define memcached_objprop_get_p(zv_p, key, element, on_error) memcached_objprop_get(*zv_p, key, element, on_error)
#endif /* PHP_LIBMEMCACHED_H */