33 #define LCB_DEPR_CTORS_GET \
34 lcb_get_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
35 lcb_get_cmd_st(const void *key, lcb_size_t nkey=0, lcb_time_t exptime=0, int lock=0) { \
38 if (key != NULL && nkey == 0) { \
39 v.v0.nkey = std::strlen((const char *)key); \
43 v.v0.exptime = exptime; v.v0.lock = lock; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
47 #define LCB_DEPR_CTORS_RGET \
48 lcb_get_replica_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
49 lcb_get_replica_cmd_st(const void *key, lcb_size_t nkey, lcb_replica_t strategy=LCB_REPLICA_FIRST, int index=0) { \
50 version = 1; v.v1.key = key; v.v1.nkey = nkey; v.v1.hashkey = NULL; v.v1.nhashkey = 0; v.v1.strategy = strategy; v.v1.index = index; \
53 #define LCB_DEPR_CTORS_UNL \
54 lcb_unlock_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
55 lcb_unlock_cmd_st(const void *key, lcb_size_t nkey, lcb_cas_t cas) { \
56 version = 0; v.v0.key = key; v.v0.nkey = nkey; v.v0.cas = cas; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
59 #define LCB_DEPR_CTORS_STORE \
60 lcb_store_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
61 lcb_store_cmd_st(lcb_storage_t operation, const void *key, lcb_size_t nkey, \
62 const void *bytes=NULL, lcb_size_t nbytes=0, lcb_uint32_t flags=0, \
63 lcb_time_t exptime=0, lcb_cas_t cas=0, lcb_datatype_t datatype=0) { \
64 version = 0; v.v0.operation = operation; v.v0.key = key; v.v0.nkey = nkey; v.v0.cas = cas; \
65 v.v0.bytes = bytes; v.v0.nbytes = nbytes; v.v0.flags = flags; v.v0.datatype = datatype; \
66 v.v0.exptime = exptime; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
69 #define LCB_DEPR_CTORS_ARITH \
70 lcb_arithmetic_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
71 lcb_arithmetic_cmd_st(const void *key, lcb_size_t nkey, lcb_int64_t delta, int create=0, \
72 lcb_uint64_t initial=0, lcb_time_t exptime=0) { \
73 version = 0; v.v0.key = key; v.v0.nkey = nkey; v.v0.exptime = exptime; \
74 v.v0.delta = delta; v.v0.create = create; v.v0.initial = initial; \
75 v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
79 #define LCB_DEPR_CTORS_OBS \
80 lcb_observe_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
81 lcb_observe_cmd_st(const void *key, lcb_size_t nkey) { \
82 version = 0; v.v0.key = key; v.v0.nkey = nkey; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
85 #define LCB_DEPR_CTORS_RM \
86 lcb_remove_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
87 lcb_remove_cmd_st(const void *key, lcb_size_t nkey=0, lcb_cas_t cas=0) { \
88 version = 0; v.v0.key = key; \
89 if (key != NULL && nkey == 0) { v.v0.nkey = std::strlen((const char *)key);}\
90 else { v.v0.nkey = nkey; } \
91 v.v0.cas = cas; v.v0.hashkey = NULL; v.v0.nhashkey = 0; \
94 #define LCB_DEPR_CTORS_STATS \
95 lcb_server_stats_cmd_st(const char *name=NULL, lcb_size_t nname=0) { \
96 version = 0; v.v0.name = name; v.v0.nname = nname; \
97 if (name != NULL && nname == 0) { v.v0.nname = std::strlen(name); } \
98 else { v.v0.nname = nname; } \
101 #define LCB_DEPR_CTORS_VERBOSITY \
102 lcb_verbosity_cmd_st(lcb_verbosity_level_t level=LCB_VERBOSITY_WARNING, const char *server=NULL) { \
103 version = 0; v.v0.server = server; v.v0.level = level; \
106 #define LCB_DEPR_CTORS_VERSIONS \
107 lcb_server_version_cmd_st() { std::memset(this, 0, sizeof(*this)); }
109 #define LCB_DEPR_CTORS_FLUSH \
110 lcb_flush_cmd_st() { std::memset(this, 0, sizeof(*this)); }
112 #define LCB_DEPR_CTORS_CRST \
113 lcb_create_st(const char *host=NULL, const char *user=NULL,\
114 const char *passwd=NULL, const char *bucket=NULL, \
115 struct lcb_io_opt_st *io=NULL, lcb_type_t type=LCB_TYPE_BUCKET) { \
116 version = 2; v.v2.host = host; v.v2.user = user; v.v2.passwd = passwd; \
117 v.v2.bucket = bucket; v.v2.io = io; v.v2.type = type; v.v2.mchosts = NULL; \
118 v.v2.transports = NULL; \
121 #define LCB_DEPR_CTORS_HTTP \
122 lcb_http_cmd_st() { std::memset(this, 0, sizeof(*this)); } \
123 lcb_http_cmd_st(const char *path, lcb_size_t npath, const void *body, \
124 lcb_size_t nbody, lcb_http_method_t method, \
125 int chunked, const char *content_type) { \
126 version = 0; v.v0.path = path; v.v0.npath = npath; v.v0.body = body; \
127 v.v0.nbody = nbody; v.v0.method = method; v.v0.chunked = chunked; \
128 v.v0.content_type = content_type; \
132 #define LCB_DEPR_CTORS_GET
133 #define LCB_DEPR_CTORS_RGET
134 #define LCB_DEPR_CTORS_UNL
135 #define LCB_DEPR_CTORS_STORE
136 #define LCB_DEPR_CTORS_ARITH
137 #define LCB_DEPR_CTORS_OBS
138 #define LCB_DEPR_CTORS_RM
139 #define LCB_DEPR_CTORS_STATS
140 #define LCB_DEPR_CTORS_VERBOSITY
141 #define LCB_DEPR_CTORS_VERSIONS
142 #define LCB_DEPR_CTORS_FLUSH
143 #define LCB_DEPR_CTORS_HTTP
144 #define LCB_DEPR_CTORS_CRST