18 #ifndef LCB_DEPRECATED_H
19 #define LCB_DEPRECATED_H
20 #ifndef LIBCOUCHBASE_COUCHBASE_H
21 #error "include <libcouchbase/couchbase.h> first"
32 #define LCB_DEPR_API(X) LIBCOUCHBASE_API LCB_DEPRECATED(X)
33 #define LCB_DEPR_API2(X, reason) LIBCOUCHBASE_API LCB_DEPRECATED2(X, reason)
36 LCB_DEPR_API2(
void lcb_behavior_set_ipv6(
lcb_t instance, lcb_ipv6_t mode),
"Use LCB_CNTL_IP6POLICY");
38 LCB_DEPR_API2(lcb_ipv6_t lcb_behavior_get_ipv6(
lcb_t instance),
"Use LCB_CNTL_IP6POLICY");
40 LCB_DEPR_API2(
void lcb_behavior_set_config_errors_threshold(
lcb_t instance, lcb_size_t num_events),
41 "Use LCB_CNTL_CONFERRTHRESH");
44 "Use LCB_CNTL_CONFERRTHRESH");
47 "Use LCB_CNTL_OP_TIMEOUT");
50 "Use LCB_CNTL_OP_TIMEOUT");
53 "Use LCB_CNTL_VIEW_TIMEOUT");
56 "Use LCB_CNTL_VIEW_TIMEOUT");
66 "This function does not returning meaningful information. Use the operation callbacks "
67 "and/or bootstrap callbacks");
71 "This function does nothing");
75 LCB_VBUCKET_STATE_ACTIVE = 1,
76 LCB_VBUCKET_STATE_REPLICA = 2,
77 LCB_VBUCKET_STATE_PENDING = 3,
78 LCB_VBUCKET_STATE_DEAD = 4
81 typedef void (*lcb_error_callback)(
lcb_t instance,
lcb_error_t error,
const char *errinfo);
89 "This function only reports bootstrap errors. Use lcb_set_bootstrap_callback instead");
98 typedef struct lcb_timer_st *lcb_timer_t;
99 typedef void (*lcb_timer_callback)(lcb_timer_t timer,
lcb_t instance,
const void *cookie);
100 LCB_DEPR_API(lcb_timer_t
lcb_timer_create(
lcb_t instance,
const void *command_cookie, lcb_uint32_t usec,
int periodic, lcb_timer_callback callback,
lcb_error_t *error));
103 typedef enum lcb_compat_t { LCB_MEMCACHED_CLUSTER = 0x00, LCB_CACHED_CONFIG = 0x01 } lcb_compat_t;
104 typedef lcb_compat_t lcb_cluster_t;
105 struct lcb_memcached_st {
const char *serverlist;
const char *username;
const char *password; };
106 struct lcb_cached_config_st {
107 const char *cachefile;
115 #define lcb_create_compat lcb__create_compat_230
117 "Use memcached:// for legacy memcached. For config cache, use LCB_CNTL_CONFIGCACHE");
120 LCB_ASYNCHRONOUS = 0x00,
121 LCB_SYNCHRONOUS = 0xff
124 "Syncmode will be removed in future versions. Use lcb_wait() instead");
126 "Syncmode will be removed in future versions. Use lcb_wait() instead");
129 "Use lcb_get_node(instance, LCB_NODE_HTCONFIG, 0)");
131 "Use lcb_get_node(instance, LCB_NODE_HTCONFIG, 0)");
134 #define LCB_XSSIZES(X) \
135 X(struct lcb_create_st, C_ST, 0, 3) \
136 X(struct lcb_create_io_ops_st, C_I_O_ST, 1, 1) \
138 X(struct lcb_get_cmd_st, G_C_ST, 2, 0) \
139 X(struct lcb_get_replica_cmd_st, G_R_C_ST, 3, 1) \
140 X(struct lcb_unlock_cmd_st, U_C_ST, 4, 0) \
141 X(lcb_touch_cmd_t, T_C_ST, 5, 0) \
142 X(struct lcb_store_cmd_st, S_C_ST, 6, 0) \
143 X(struct lcb_arithmetic_cmd_st, A_C_ST, 7, 0) \
144 X(struct lcb_observe_cmd_st, O_C_ST, 8, 0) \
145 X(struct lcb_remove_cmd_st, R_C_ST, 9, 0) \
146 X(struct lcb_http_cmd_st, H_C_ST, 10, 1) \
147 X(struct lcb_server_stats_cmd_st, S_S_C_ST, 11, 0) \
148 X(struct lcb_server_version_cmd_st, S_V_C_ST, 12, 0) \
149 X(struct lcb_verbosity_cmd_st, V_C_ST, 13, 0) \
150 X(struct lcb_flush_cmd_st, F_C_ST, 14, 0) \
152 X(lcb_get_resp_t, G_R_ST, 15, 0) \
153 X(lcb_store_resp_t, S_R_ST, 16, 0) \
154 X(lcb_remove_resp_t, R_R_ST, 17, 0) \
155 X(lcb_touch_resp_t, T_R_ST, 18, 0) \
156 X(lcb_unlock_resp_t, U_R_ST, 19, 0) \
157 X(lcb_arithmetic_resp_t, A_R_ST, 20, 0) \
158 X(lcb_observe_resp_t, O_R_ST, 21, 0) \
159 X(lcb_http_resp_t, H_R_ST, 22, 0) \
160 X(lcb_server_stat_resp_t, S_S_R_ST, 23, 0) \
161 X(lcb_server_version_resp_t, S_V_R_ST, 24, 0) \
162 X(lcb_verbosity_resp_t, V_R_ST, 25, 0) \
163 X(lcb_flush_resp_t, F_R_ST, 26, 0)
166 #define X(sname, sabbrev, idval, vernum) \
167 LCB_##sabbrev##_ID = idval, LCB_##sabbrev##_V = vernum,
173 #define lcb_verify_compiler_setup() ( \
174 lcb_verify_struct_size(LCB_C_ST_ID, LCB_C_ST_V, sizeof(struct lcb_create_st)) == LCB_SUCCESS && \
175 lcb_verify_struct_size(LCB_C_I_O_ST_ID, LCB_C_I_O_ST_V, sizeof(struct lcb_create_io_ops_st)) == LCB_SUCCESS && \
176 lcb_verify_struct_size(LCB_G_C_ST_ID, LCB_G_C_ST_V, sizeof(struct lcb_get_cmd_st)) == LCB_SUCCESS && \
177 lcb_verify_struct_size(LCB_G_R_C_ST_ID, LCB_G_R_C_ST_V, sizeof(struct lcb_get_replica_cmd_st)) == LCB_SUCCESS && \
178 lcb_verify_struct_size(LCB_U_C_ST_ID, LCB_U_C_ST_V, sizeof(struct lcb_unlock_cmd_st)) == LCB_SUCCESS && \
179 lcb_verify_struct_size(LCB_T_C_ST_ID, LCB_T_C_ST_V, sizeof(lcb_touch_cmd_t)) == LCB_SUCCESS && \
180 lcb_verify_struct_size(LCB_S_C_ST_ID, LCB_S_C_ST_V, sizeof(struct lcb_store_cmd_st)) == LCB_SUCCESS && \
181 lcb_verify_struct_size(LCB_A_C_ST_ID, LCB_A_C_ST_V, sizeof(struct lcb_arithmetic_cmd_st)) == LCB_SUCCESS && \
182 lcb_verify_struct_size(LCB_O_C_ST_ID, LCB_O_C_ST_V, sizeof(struct lcb_observe_cmd_st)) == LCB_SUCCESS && \
183 lcb_verify_struct_size(LCB_R_C_ST_ID, LCB_R_C_ST_V, sizeof(struct lcb_remove_cmd_st)) == LCB_SUCCESS && \
184 lcb_verify_struct_size(LCB_H_C_ST_ID, LCB_H_C_ST_V, sizeof(struct lcb_http_cmd_st)) == LCB_SUCCESS && \
185 lcb_verify_struct_size(LCB_S_S_C_ST_ID, LCB_S_S_C_ST_V, sizeof(struct lcb_server_stats_cmd_st)) == LCB_SUCCESS && \
186 lcb_verify_struct_size(LCB_S_V_C_ST_ID, LCB_S_V_C_ST_V, sizeof(struct lcb_server_version_cmd_st)) == LCB_SUCCESS && \
187 lcb_verify_struct_size(LCB_V_C_ST_ID, LCB_V_C_ST_V, sizeof(struct lcb_verbosity_cmd_st)) == LCB_SUCCESS && \
188 lcb_verify_struct_size(LCB_F_C_ST_ID, LCB_F_C_ST_V, sizeof(struct lcb_flush_cmd_st)) == LCB_SUCCESS && \
189 lcb_verify_struct_size(LCB_G_R_ST_ID, LCB_G_R_ST_V, sizeof(lcb_get_resp_t)) == LCB_SUCCESS &&\
190 lcb_verify_struct_size(LCB_S_R_ST_ID, LCB_S_R_ST_V, sizeof(lcb_store_resp_t)) == LCB_SUCCESS && \
191 lcb_verify_struct_size(LCB_R_R_ST_ID, LCB_R_R_ST_V, sizeof(lcb_remove_resp_t)) == LCB_SUCCESS && \
192 lcb_verify_struct_size(LCB_T_R_ST_ID, LCB_T_R_ST_V, sizeof(lcb_touch_resp_t)) == LCB_SUCCESS && \
193 lcb_verify_struct_size(LCB_U_R_ST_ID, LCB_U_R_ST_V, sizeof(lcb_unlock_resp_t)) == LCB_SUCCESS && \
194 lcb_verify_struct_size(LCB_A_R_ST_ID, LCB_A_R_ST_V, sizeof(lcb_arithmetic_resp_t)) == LCB_SUCCESS && \
195 lcb_verify_struct_size(LCB_O_R_ST_ID, LCB_O_R_ST_V, sizeof(lcb_observe_resp_t)) == LCB_SUCCESS && \
196 lcb_verify_struct_size(LCB_H_R_ST_ID, LCB_H_R_ST_V, sizeof(lcb_http_resp_t)) == LCB_SUCCESS && \
197 lcb_verify_struct_size(LCB_S_S_R_ST_ID, LCB_S_S_R_ST_V, sizeof(lcb_server_stat_resp_t)) == LCB_SUCCESS && \
198 lcb_verify_struct_size(LCB_S_V_R_ST_ID, LCB_S_V_R_ST_V, sizeof(lcb_server_version_resp_t)) == LCB_SUCCESS && \
199 lcb_verify_struct_size(LCB_V_R_ST_ID, LCB_V_R_ST_V, sizeof(lcb_verbosity_resp_t)) == LCB_SUCCESS && \
200 lcb_verify_struct_size(LCB_F_R_ST_ID, LCB_F_R_ST_V, sizeof(lcb_flush_resp_t)) == LCB_SUCCESS \
220 #define LCB_CNTL_RBUFSIZE 0x02
222 #define LCB_CNTL_WBUFSIZE 0x03
224 #define LCB_CNTL_SYNCMODE 0x0a
226 #define LCB_CNTL_SKIP_CONFIGURATION_ERRORS_ON_CONNECT 0x13
229 #define lcb_is_error_enomem(a) ((a == LCB_CLIENT_ENOMEM) || (a == LCB_ENOMEM))
231 #define lcb_is_error_etmpfail(a) ((a == LCB_CLIENT_ETMPFAIL) || (a == LCB_ETMPFAIL))
234 LCB_CONFIGURATION_NEW = 0x00,
235 LCB_CONFIGURATION_CHANGED = 0x01,
236 LCB_CONFIGURATION_UNCHANGED = 0x02
237 } lcb_configuration_t;
239 typedef void (*lcb_configuration_callback)(
lcb_t instance, lcb_configuration_t config);
243 lcb_configuration_callback lcb_set_configuration_callback(
lcb_t, lcb_configuration_callback),
244 "use lcb_set_bootstrap_callback() to determine when client is ready");
248 LCB_HTTP_STATUS_CONTINUE = 100,
249 LCB_HTTP_STATUS_SWITCHING_PROTOCOLS = 101,
250 LCB_HTTP_STATUS_PROCESSING = 102,
251 LCB_HTTP_STATUS_OK = 200,
252 LCB_HTTP_STATUS_CREATED = 201,
253 LCB_HTTP_STATUS_ACCEPTED = 202,
254 LCB_HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203,
255 LCB_HTTP_STATUS_NO_CONTENT = 204,
256 LCB_HTTP_STATUS_RESET_CONTENT = 205,
257 LCB_HTTP_STATUS_PARTIAL_CONTENT = 206,
258 LCB_HTTP_STATUS_MULTI_STATUS = 207,
259 LCB_HTTP_STATUS_MULTIPLE_CHOICES = 300,
260 LCB_HTTP_STATUS_MOVED_PERMANENTLY = 301,
261 LCB_HTTP_STATUS_FOUND = 302,
262 LCB_HTTP_STATUS_SEE_OTHER = 303,
263 LCB_HTTP_STATUS_NOT_MODIFIED = 304,
264 LCB_HTTP_STATUS_USE_PROXY = 305,
265 LCB_HTTP_STATUS_UNUSED = 306,
266 LCB_HTTP_STATUS_TEMPORARY_REDIRECT = 307,
267 LCB_HTTP_STATUS_BAD_REQUEST = 400,
268 LCB_HTTP_STATUS_UNAUTHORIZED = 401,
269 LCB_HTTP_STATUS_PAYMENT_REQUIRED = 402,
270 LCB_HTTP_STATUS_FORBIDDEN = 403,
271 LCB_HTTP_STATUS_NOT_FOUND = 404,
272 LCB_HTTP_STATUS_METHOD_NOT_ALLOWED = 405,
273 LCB_HTTP_STATUS_NOT_ACCEPTABLE = 406,
274 LCB_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407,
275 LCB_HTTP_STATUS_REQUEST_TIMEOUT = 408,
276 LCB_HTTP_STATUS_CONFLICT = 409,
277 LCB_HTTP_STATUS_GONE = 410,
278 LCB_HTTP_STATUS_LENGTH_REQUIRED = 411,
279 LCB_HTTP_STATUS_PRECONDITION_FAILED = 412,
280 LCB_HTTP_STATUS_REQUEST_ENTITY_TOO_LARGE = 413,
281 LCB_HTTP_STATUS_REQUEST_URI_TOO_LONG = 414,
282 LCB_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415,
283 LCB_HTTP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
284 LCB_HTTP_STATUS_EXPECTATION_FAILED = 417,
285 LCB_HTTP_STATUS_UNPROCESSABLE_ENTITY = 422,
286 LCB_HTTP_STATUS_LOCKED = 423,
287 LCB_HTTP_STATUS_FAILED_DEPENDENCY = 424,
288 LCB_HTTP_STATUS_INTERNAL_SERVER_ERROR = 500,
289 LCB_HTTP_STATUS_NOT_IMPLEMENTED = 501,
290 LCB_HTTP_STATUS_BAD_GATEWAY = 502,
291 LCB_HTTP_STATUS_SERVICE_UNAVAILABLE = 503,
292 LCB_HTTP_STATUS_GATEWAY_TIMEOUT = 504,
293 LCB_HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505,
294 LCB_HTTP_STATUS_INSUFFICIENT_STORAGE = 507
int version
Indicates which field in the lcb_CRST_u union should be used.
Definition: couchbase.h:266
lcb_vbucket_state_t
I'm not sure what uses this anymore.
Definition: deprecated.h:74
lcb_error_t lcb_verify_struct_size(lcb_uint32_t id, lcb_uint32_t version, lcb_size_t size)
Verify that libcouchbase and yourself have the same size for a certain version of a struct...
LCB_DEPR_API2(void lcb_behavior_set_ipv6(lcb_t instance, lcb_ipv6_t mode),"Use LCB_CNTL_IP6POLICY")
lcb_timer_t lcb_timer_create(lcb_t instance, const void *command_cookie, lcb_uint32_t usec, int periodic, lcb_timer_callback callback, lcb_error_t *error))
lcb_error_t lcb_timer_destroy(lcb_t instance, lcb_timer_t timer))
struct lcb_st * lcb_t
Library handle representing a connection to a data bucket.
Definition: couchbase.h:41
Wrapper structure for lcb_create()
Definition: couchbase.h:264
lcb_error_t
Error codes returned by the library.
Definition: error.h:506
#define lcb_create_compat
Definition: deprecated.h:115