couchbase 1.2.0.z.beta4 → 1.2.0.z.beta5

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,21 +51,21 @@ extern hrtime_t gethrtime(void);
51
51
  #define va_init_list(a,b) va_start(a)
52
52
  #endif
53
53
 
54
- #define debug_object(OBJ) \
54
+ #define cb_debug_object(OBJ) \
55
55
  rb_funcall(rb_stderr, rb_intern("print"), 1, rb_funcall(OBJ, rb_intern("object_id"), 0)); \
56
56
  rb_funcall(rb_stderr, rb_intern("print"), 1, STR_NEW_CSTR(" ")); \
57
57
  rb_funcall(rb_stderr, rb_intern("print"), 1, rb_funcall(OBJ, rb_intern("class"), 0)); \
58
58
  rb_funcall(rb_stderr, rb_intern("print"), 1, STR_NEW_CSTR(" ")); \
59
59
  rb_funcall(rb_stderr, rb_intern("puts"), 1, rb_funcall(OBJ, rb_intern("inspect"), 0));
60
60
 
61
- #define FMT_MASK 0x3
62
- #define FMT_DOCUMENT 0x0
63
- #define FMT_MARSHAL 0x1
64
- #define FMT_PLAIN 0x2
61
+ #define CB_FMT_MASK 0x3
62
+ #define CB_FMT_DOCUMENT 0x0
63
+ #define CB_FMT_MARSHAL 0x1
64
+ #define CB_FMT_PLAIN 0x2
65
65
 
66
- #define PACKET_HEADER_SIZE 24
66
+ #define CB_PACKET_HEADER_SIZE 24
67
67
  /* Structs */
68
- struct bucket_st
68
+ struct cb_bucket_st
69
69
  {
70
70
  lcb_t handle;
71
71
  lcb_type_t type;
@@ -83,6 +83,8 @@ struct bucket_st
83
83
  uint32_t default_flags;
84
84
  time_t default_ttl;
85
85
  time_t default_observe_timeout;
86
+ lcb_uint64_t default_arith_create; /* should the incr/decr create the key? if non-zero, will use arith_init */
87
+ lcb_uint64_t default_arith_init; /* default initial value for incr/decr */
86
88
  uint32_t timeout;
87
89
  size_t threshold; /* the number of bytes to trigger event loop, zero if don't care */
88
90
  size_t nbytes; /* the number of bytes scheduled to be sent */
@@ -96,10 +98,10 @@ struct bucket_st
96
98
  VALUE self; /* the pointer to bucket representation in ruby land */
97
99
  };
98
100
 
99
- struct http_request_st;
100
- struct context_st
101
+ struct cb_http_request_st;
102
+ struct cb_context_st
101
103
  {
102
- struct bucket_st* bucket;
104
+ struct cb_bucket_st* bucket;
103
105
  int extended;
104
106
  VALUE proc;
105
107
  void *rv;
@@ -109,14 +111,15 @@ struct context_st
109
111
  VALUE operation;
110
112
  VALUE headers_val;
111
113
  int headers_built;
112
- struct http_request_st *request;
114
+ struct cb_http_request_st *request;
113
115
  int quiet;
114
116
  int arith; /* incr: +1, decr: -1, other: 0 */
117
+ int http_cancel_on_error;
115
118
  size_t nqueries;
116
119
  };
117
120
 
118
- struct http_request_st {
119
- struct bucket_st *bucket;
121
+ struct cb_http_request_st {
122
+ struct cb_bucket_st *bucket;
120
123
  VALUE bucket_obj;
121
124
  VALUE type;
122
125
  int extended;
@@ -124,13 +127,13 @@ struct http_request_st {
124
127
  int completed;
125
128
  lcb_http_request_t request;
126
129
  lcb_http_cmd_t cmd;
127
- struct context_st *ctx;
130
+ struct cb_context_st *ctx;
128
131
  VALUE on_body_callback;
129
132
  };
130
133
 
131
- struct timer_st
134
+ struct cb_timer_st
132
135
  {
133
- struct bucket_st *bucket;
136
+ struct cb_bucket_st *bucket;
134
137
  int periodic;
135
138
  uint32_t usec;
136
139
  lcb_timer_t timer;
@@ -139,177 +142,179 @@ struct timer_st
139
142
  };
140
143
 
141
144
  /* Classes */
142
- extern VALUE cBucket;
143
- extern VALUE cCouchRequest;
144
- extern VALUE cResult;
145
- extern VALUE cTimer;
145
+ extern VALUE cb_cBucket;
146
+ extern VALUE cb_cCouchRequest;
147
+ extern VALUE cb_cResult;
148
+ extern VALUE cb_cTimer;
146
149
 
147
150
  /* Modules */
148
- extern VALUE mCouchbase;
149
- extern VALUE mError;
150
- extern VALUE mMarshal;
151
- extern VALUE mMultiJson;
152
- extern VALUE mURI;
151
+ extern VALUE cb_mCouchbase;
152
+ extern VALUE cb_mError;
153
+ extern VALUE cb_mMarshal;
154
+ extern VALUE cb_mMultiJson;
155
+ extern VALUE cb_mURI;
153
156
 
154
157
  /* Symbols */
155
- extern ID sym_add;
156
- extern ID sym_append;
157
- extern ID sym_assemble_hash;
158
- extern ID sym_body;
159
- extern ID sym_bucket;
160
- extern ID sym_cas;
161
- extern ID sym_chunked;
162
- extern ID sym_cluster;
163
- extern ID sym_content_type;
164
- extern ID sym_create;
165
- extern ID sym_decrement;
166
- extern ID sym_default_flags;
167
- extern ID sym_default_format;
168
- extern ID sym_default_observe_timeout;
169
- extern ID sym_default_ttl;
170
- extern ID sym_delete;
171
- extern ID sym_delta;
172
- extern ID sym_development;
173
- extern ID sym_document;
174
- extern ID sym_environment;
175
- extern ID sym_extended;
176
- extern ID sym_flags;
177
- extern ID sym_format;
178
- extern ID sym_found;
179
- extern ID sym_get;
180
- extern ID sym_hostname;
181
- extern ID sym_http_request;
182
- extern ID sym_increment;
183
- extern ID sym_initial;
184
- extern ID sym_key_prefix;
185
- extern ID sym_lock;
186
- extern ID sym_management;
187
- extern ID sym_marshal;
188
- extern ID sym_method;
189
- extern ID sym_node_list;
190
- extern ID sym_not_found;
191
- extern ID sym_num_replicas;
192
- extern ID sym_observe;
193
- extern ID sym_password;
194
- extern ID sym_periodic;
195
- extern ID sym_persisted;
196
- extern ID sym_plain;
197
- extern ID sym_pool;
198
- extern ID sym_port;
199
- extern ID sym_post;
200
- extern ID sym_prepend;
201
- extern ID sym_production;
202
- extern ID sym_put;
203
- extern ID sym_quiet;
204
- extern ID sym_replace;
205
- extern ID sym_replica;
206
- extern ID sym_send_threshold;
207
- extern ID sym_set;
208
- extern ID sym_stats;
209
- extern ID sym_timeout;
210
- extern ID sym_touch;
211
- extern ID sym_ttl;
212
- extern ID sym_type;
213
- extern ID sym_unlock;
214
- extern ID sym_username;
215
- extern ID sym_version;
216
- extern ID sym_view;
217
- extern ID id_arity;
218
- extern ID id_call;
219
- extern ID id_delete;
220
- extern ID id_dump;
221
- extern ID id_dup;
222
- extern ID id_flatten_bang;
223
- extern ID id_has_key_p;
224
- extern ID id_host;
225
- extern ID id_iv_cas;
226
- extern ID id_iv_completed;
227
- extern ID id_iv_error;
228
- extern ID id_iv_flags;
229
- extern ID id_iv_from_master;
230
- extern ID id_iv_headers;
231
- extern ID id_iv_inner_exception;
232
- extern ID id_iv_key;
233
- extern ID id_iv_node;
234
- extern ID id_iv_operation;
235
- extern ID id_iv_status;
236
- extern ID id_iv_time_to_persist;
237
- extern ID id_iv_time_to_replicate;
238
- extern ID id_iv_value;
239
- extern ID id_load;
240
- extern ID id_match;
241
- extern ID id_observe_and_wait;
242
- extern ID id_parse;
243
- extern ID id_password;
244
- extern ID id_path;
245
- extern ID id_port;
246
- extern ID id_scheme;
247
- extern ID id_sprintf;
248
- extern ID id_to_s;
249
- extern ID id_user;
250
- extern ID id_verify_observe_options;
158
+ extern ID cb_sym_add;
159
+ extern ID cb_sym_append;
160
+ extern ID cb_sym_assemble_hash;
161
+ extern ID cb_sym_body;
162
+ extern ID cb_sym_bucket;
163
+ extern ID cb_sym_cas;
164
+ extern ID cb_sym_chunked;
165
+ extern ID cb_sym_cluster;
166
+ extern ID cb_sym_content_type;
167
+ extern ID cb_sym_create;
168
+ extern ID cb_sym_decrement;
169
+ extern ID cb_sym_default_arithmetic_init;
170
+ extern ID cb_sym_default_flags;
171
+ extern ID cb_sym_default_format;
172
+ extern ID cb_sym_default_observe_timeout;
173
+ extern ID cb_sym_default_ttl;
174
+ extern ID cb_sym_delete;
175
+ extern ID cb_sym_delta;
176
+ extern ID cb_sym_development;
177
+ extern ID cb_sym_document;
178
+ extern ID cb_sym_environment;
179
+ extern ID cb_sym_extended;
180
+ extern ID cb_sym_flags;
181
+ extern ID cb_sym_format;
182
+ extern ID cb_sym_found;
183
+ extern ID cb_sym_get;
184
+ extern ID cb_sym_hostname;
185
+ extern ID cb_sym_http_request;
186
+ extern ID cb_sym_increment;
187
+ extern ID cb_sym_initial;
188
+ extern ID cb_sym_key_prefix;
189
+ extern ID cb_sym_lock;
190
+ extern ID cb_sym_management;
191
+ extern ID cb_sym_marshal;
192
+ extern ID cb_sym_method;
193
+ extern ID cb_sym_node_list;
194
+ extern ID cb_sym_not_found;
195
+ extern ID cb_sym_num_replicas;
196
+ extern ID cb_sym_observe;
197
+ extern ID cb_sym_password;
198
+ extern ID cb_sym_periodic;
199
+ extern ID cb_sym_persisted;
200
+ extern ID cb_sym_plain;
201
+ extern ID cb_sym_pool;
202
+ extern ID cb_sym_port;
203
+ extern ID cb_sym_post;
204
+ extern ID cb_sym_prepend;
205
+ extern ID cb_sym_production;
206
+ extern ID cb_sym_put;
207
+ extern ID cb_sym_quiet;
208
+ extern ID cb_sym_replace;
209
+ extern ID cb_sym_replica;
210
+ extern ID cb_sym_send_threshold;
211
+ extern ID cb_sym_set;
212
+ extern ID cb_sym_stats;
213
+ extern ID cb_sym_timeout;
214
+ extern ID cb_sym_touch;
215
+ extern ID cb_sym_ttl;
216
+ extern ID cb_sym_type;
217
+ extern ID cb_sym_unlock;
218
+ extern ID cb_sym_username;
219
+ extern ID cb_sym_version;
220
+ extern ID cb_sym_view;
221
+ extern ID cb_id_arity;
222
+ extern ID cb_id_call;
223
+ extern ID cb_id_delete;
224
+ extern ID cb_id_dump;
225
+ extern ID cb_id_dup;
226
+ extern ID cb_id_flatten_bang;
227
+ extern ID cb_id_has_key_p;
228
+ extern ID cb_id_host;
229
+ extern ID cb_id_iv_body;
230
+ extern ID cb_id_iv_cas;
231
+ extern ID cb_id_iv_completed;
232
+ extern ID cb_id_iv_error;
233
+ extern ID cb_id_iv_flags;
234
+ extern ID cb_id_iv_from_master;
235
+ extern ID cb_id_iv_headers;
236
+ extern ID cb_id_iv_inner_exception;
237
+ extern ID cb_id_iv_key;
238
+ extern ID cb_id_iv_node;
239
+ extern ID cb_id_iv_operation;
240
+ extern ID cb_id_iv_status;
241
+ extern ID cb_id_iv_time_to_persist;
242
+ extern ID cb_id_iv_time_to_replicate;
243
+ extern ID cb_id_iv_value;
244
+ extern ID cb_id_load;
245
+ extern ID cb_id_match;
246
+ extern ID cb_id_observe_and_wait;
247
+ extern ID cb_id_parse;
248
+ extern ID cb_id_parse_body_bang;
249
+ extern ID cb_id_password;
250
+ extern ID cb_id_path;
251
+ extern ID cb_id_port;
252
+ extern ID cb_id_scheme;
253
+ extern ID cb_id_sprintf;
254
+ extern ID cb_id_to_s;
255
+ extern ID cb_id_user;
256
+ extern ID cb_id_verify_observe_options;
251
257
 
252
258
  /* Errors */
253
- extern VALUE eBaseError;
254
- extern VALUE eValueFormatError;
255
- extern VALUE eHTTPError;
259
+ extern VALUE cb_eBaseError;
260
+ extern VALUE cb_eValueFormatError;
261
+ extern VALUE cb_eHTTPError;
256
262
  /* LCB_SUCCESS = 0x00 */
257
263
  /* LCB_AUTH_CONTINUE = 0x01 */
258
- extern VALUE eAuthError; /* LCB_AUTH_ERROR = 0x02 */
259
- extern VALUE eDeltaBadvalError; /* LCB_DELTA_BADVAL = 0x03 */
260
- extern VALUE eTooBigError; /* LCB_E2BIG = 0x04 */
261
- extern VALUE eBusyError; /* LCB_EBUSY = 0x05 */
262
- extern VALUE eInternalError; /* LCB_EINTERNAL = 0x06 */
263
- extern VALUE eInvalidError; /* LCB_EINVAL = 0x07 */
264
- extern VALUE eNoMemoryError; /* LCB_ENOMEM = 0x08 */
265
- extern VALUE eRangeError; /* LCB_ERANGE = 0x09 */
266
- extern VALUE eLibcouchbaseError; /* LCB_ERROR = 0x0a */
267
- extern VALUE eTmpFailError; /* LCB_ETMPFAIL = 0x0b */
268
- extern VALUE eKeyExistsError; /* LCB_KEY_EEXISTS = 0x0c */
269
- extern VALUE eNotFoundError; /* LCB_KEY_ENOENT = 0x0d */
270
- extern VALUE eDlopenFailedError; /* LCB_DLOPEN_FAILED = 0x0e */
271
- extern VALUE eDlsymFailedError; /* LCB_DLSYM_FAILED = 0x0f */
272
- extern VALUE eNetworkError; /* LCB_NETWORK_ERROR = 0x10 */
273
- extern VALUE eNotMyVbucketError; /* LCB_NOT_MY_VBUCKET = 0x11 */
274
- extern VALUE eNotStoredError; /* LCB_NOT_STORED = 0x12 */
275
- extern VALUE eNotSupportedError; /* LCB_NOT_SUPPORTED = 0x13 */
276
- extern VALUE eUnknownCommandError; /* LCB_UNKNOWN_COMMAND = 0x14 */
277
- extern VALUE eUnknownHostError; /* LCB_UNKNOWN_HOST = 0x15 */
278
- extern VALUE eProtocolError; /* LCB_PROTOCOL_ERROR = 0x16 */
279
- extern VALUE eTimeoutError; /* LCB_ETIMEDOUT = 0x17 */
280
- extern VALUE eConnectError; /* LCB_CONNECT_ERROR = 0x18 */
281
- extern VALUE eBucketNotFoundError; /* LCB_BUCKET_ENOENT = 0x19 */
282
- extern VALUE eClientNoMemoryError; /* LCB_CLIENT_ENOMEM = 0x1a */
283
- extern VALUE eClientTmpFailError; /* LCB_CLIENT_ETMPFAIL = 0x1b */
284
- extern VALUE eBadHandleError; /* LCB_EBADHANDLE = 0x1c */
264
+ extern VALUE cb_eAuthError; /* LCB_AUTH_ERROR = 0x02 */
265
+ extern VALUE cb_eDeltaBadvalError; /* LCB_DELTA_BADVAL = 0x03 */
266
+ extern VALUE cb_eTooBigError; /* LCB_E2BIG = 0x04 */
267
+ extern VALUE cb_eBusyError; /* LCB_EBUSY = 0x05 */
268
+ extern VALUE cb_eInternalError; /* LCB_EINTERNAL = 0x06 */
269
+ extern VALUE cb_eInvalidError; /* LCB_EINVAL = 0x07 */
270
+ extern VALUE cb_eNoMemoryError; /* LCB_ENOMEM = 0x08 */
271
+ extern VALUE cb_eRangeError; /* LCB_ERANGE = 0x09 */
272
+ extern VALUE cb_eLibcouchbaseError; /* LCB_ERROR = 0x0a */
273
+ extern VALUE cb_eTmpFailError; /* LCB_ETMPFAIL = 0x0b */
274
+ extern VALUE cb_eKeyExistsError; /* LCB_KEY_EEXISTS = 0x0c */
275
+ extern VALUE cb_eNotFoundError; /* LCB_KEY_ENOENT = 0x0d */
276
+ extern VALUE cb_eDlopenFailedError; /* LCB_DLOPEN_FAILED = 0x0e */
277
+ extern VALUE cb_eDlsymFailedError; /* LCB_DLSYM_FAILED = 0x0f */
278
+ extern VALUE cb_eNetworkError; /* LCB_NETWORK_ERROR = 0x10 */
279
+ extern VALUE cb_eNotMyVbucketError; /* LCB_NOT_MY_VBUCKET = 0x11 */
280
+ extern VALUE cb_eNotStoredError; /* LCB_NOT_STORED = 0x12 */
281
+ extern VALUE cb_eNotSupportedError; /* LCB_NOT_SUPPORTED = 0x13 */
282
+ extern VALUE cb_eUnknownCommandError; /* LCB_UNKNOWN_COMMAND = 0x14 */
283
+ extern VALUE cb_eUnknownHostError; /* LCB_UNKNOWN_HOST = 0x15 */
284
+ extern VALUE cb_eProtocolError; /* LCB_PROTOCOL_ERROR = 0x16 */
285
+ extern VALUE cb_eTimeoutError; /* LCB_ETIMEDOUT = 0x17 */
286
+ extern VALUE cb_eConnectError; /* LCB_CONNECT_ERROR = 0x18 */
287
+ extern VALUE cb_eBucketNotFoundError; /* LCB_BUCKET_ENOENT = 0x19 */
288
+ extern VALUE cb_eClientNoMemoryError; /* LCB_CLIENT_ENOMEM = 0x1a */
289
+ extern VALUE cb_eClientTmpFailError; /* LCB_CLIENT_ETMPFAIL = 0x1b */
290
+ extern VALUE cb_eBadHandleError; /* LCB_EBADHANDLE = 0x1c */
285
291
 
286
- void strip_key_prefix(struct bucket_st *bucket, VALUE key);
292
+ void cb_strip_key_prefix(struct cb_bucket_st *bucket, VALUE key);
287
293
  VALUE cb_check_error(lcb_error_t rc, const char *msg, VALUE key);
288
294
  VALUE cb_check_error_with_status(lcb_error_t rc, const char *msg, VALUE key, lcb_http_status_t status);
289
- VALUE cb_gc_protect(struct bucket_st *bucket, VALUE val);
290
- VALUE cb_gc_unprotect(struct bucket_st *bucket, VALUE val);
295
+ VALUE cb_gc_protect(struct cb_bucket_st *bucket, VALUE val);
296
+ VALUE cb_gc_unprotect(struct cb_bucket_st *bucket, VALUE val);
291
297
  VALUE cb_proc_call(VALUE recv, int argc, ...);
292
298
  int cb_first_value_i(VALUE key, VALUE value, VALUE arg);
293
- void cb_build_headers(struct context_st *ctx, const char * const *headers);
294
- void maybe_do_loop(struct bucket_st *bucket);
295
- VALUE unify_key(struct bucket_st *bucket, VALUE key, int apply_prefix);
296
- VALUE encode_value(VALUE val, uint32_t flags);
297
- VALUE decode_value(VALUE blob, uint32_t flags, VALUE force_format);
298
- uint32_t flags_set_format(uint32_t flags, ID format);
299
- ID flags_get_format(uint32_t flags);
300
-
301
- void storage_callback(lcb_t handle, const void *cookie, lcb_storage_t operation, lcb_error_t error, const lcb_store_resp_t *resp);
302
- void get_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_get_resp_t *resp);
303
- void touch_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp);
304
- void delete_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_remove_resp_t *resp);
305
- void stat_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp);
306
- void arithmetic_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_arithmetic_resp_t *resp);
307
- void version_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_version_resp_t *resp);
308
- void http_complete_callback(lcb_http_request_t request, lcb_t handle, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp);
309
- void http_data_callback(lcb_http_request_t request, lcb_t handle, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp);
310
- void observe_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_observe_resp_t *resp);
311
- void unlock_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp);
299
+ void cb_build_headers(struct cb_context_st *ctx, const char * const *headers);
300
+ void cb_maybe_do_loop(struct cb_bucket_st *bucket);
301
+ VALUE cb_unify_key(struct cb_bucket_st *bucket, VALUE key, int apply_prefix);
302
+ VALUE cb_encode_value(VALUE val, uint32_t flags);
303
+ VALUE cb_decode_value(VALUE blob, uint32_t flags, VALUE force_format);
304
+ uint32_t cb_flags_set_format(uint32_t flags, ID format);
305
+ ID cb_flags_get_format(uint32_t flags);
312
306
 
307
+ void cb_storage_callback(lcb_t handle, const void *cookie, lcb_storage_t operation, lcb_error_t error, const lcb_store_resp_t *resp);
308
+ void cb_get_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_get_resp_t *resp);
309
+ void cb_touch_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_touch_resp_t *resp);
310
+ void cb_delete_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_remove_resp_t *resp);
311
+ void cb_stat_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp);
312
+ void cb_arithmetic_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_arithmetic_resp_t *resp);
313
+ void cb_version_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_server_version_resp_t *resp);
314
+ void cb_http_complete_callback(lcb_http_request_t request, lcb_t handle, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp);
315
+ void cb_http_data_callback(lcb_http_request_t request, lcb_t handle, const void *cookie, lcb_error_t error, const lcb_http_resp_t *resp);
316
+ void cb_observe_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_observe_resp_t *resp);
317
+ void cb_unlock_callback(lcb_t handle, const void *cookie, lcb_error_t error, const lcb_unlock_resp_t *resp);
313
318
 
314
319
  VALUE cb_bucket_alloc(VALUE klass);
315
320
  void cb_bucket_free(void *ptr);
@@ -362,6 +367,8 @@ VALUE cb_bucket_environment_get(VALUE self);
362
367
  VALUE cb_bucket_num_replicas_get(VALUE self);
363
368
  VALUE cb_bucket_default_observe_timeout_get(VALUE self);
364
369
  VALUE cb_bucket_default_observe_timeout_set(VALUE self, VALUE val);
370
+ VALUE cb_bucket_default_arithmetic_init_get(VALUE self);
371
+ VALUE cb_bucket_default_arithmetic_init_set(VALUE self, VALUE val);
365
372
 
366
373
  VALUE cb_http_request_alloc(VALUE klass);
367
374
  VALUE cb_http_request_init(int argc, VALUE *argv, VALUE self);
@@ -384,21 +391,21 @@ VALUE cb_timer_init(int argc, VALUE *argv, VALUE self);
384
391
 
385
392
  /* Method arguments */
386
393
 
387
- enum command_t {
388
- cmd_touch = 0x01,
389
- cmd_remove = 0x02,
390
- cmd_store = 0x03,
391
- cmd_get = 0x04,
392
- cmd_arith = 0x05,
393
- cmd_stats = 0x06,
394
- cmd_version = 0x08,
395
- cmd_observe = 0x09,
396
- cmd_unlock = 0x10
394
+ enum cb_command_t {
395
+ cb_cmd_touch = 0x01,
396
+ cb_cmd_remove = 0x02,
397
+ cb_cmd_store = 0x03,
398
+ cb_cmd_get = 0x04,
399
+ cb_cmd_arith = 0x05,
400
+ cb_cmd_stats = 0x06,
401
+ cb_cmd_version = 0x08,
402
+ cb_cmd_observe = 0x09,
403
+ cb_cmd_unlock = 0x10
397
404
  };
398
405
 
399
- struct params_st
406
+ struct cb_params_st
400
407
  {
401
- enum command_t type;
408
+ enum cb_command_t type;
402
409
  union {
403
410
  struct {
404
411
  /* number of items */
@@ -514,16 +521,15 @@ struct params_st
514
521
  lcb_cas_t cas;
515
522
  } unlock;
516
523
  } cmd;
517
- struct bucket_st *bucket;
524
+ struct cb_bucket_st *bucket;
518
525
  /* helper index for iterators */
519
526
  size_t idx;
520
527
  /* the approximate size of the data to be sent */
521
528
  size_t npayload;
522
529
  };
523
530
 
524
- void cb_params_destroy(struct params_st *params);
525
- void cb_params_build(struct params_st *params, int argc, VALUE argv);
526
-
531
+ void cb_params_destroy(struct cb_params_st *params);
532
+ void cb_params_build(struct cb_params_st *params, int argc, VALUE argv);
527
533
 
528
534
  #endif
529
535