couchbase 1.2.0.z.beta4-x86-mingw32 → 1.2.0.z.beta5-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,168 +19,171 @@
19
19
  #include "couchbase_ext.h"
20
20
 
21
21
  /* Classes */
22
- VALUE cBucket;
23
- VALUE cCouchRequest;
24
- VALUE cResult;
25
- VALUE cTimer;
22
+ VALUE cb_cBucket;
23
+ VALUE cb_cCouchRequest;
24
+ VALUE cb_cResult;
25
+ VALUE cb_cTimer;
26
26
 
27
27
  /* Modules */
28
- VALUE mCouchbase;
29
- VALUE mError;
30
- VALUE mMarshal;
31
- VALUE mMultiJson;
32
- VALUE mURI;
28
+ VALUE cb_mCouchbase;
29
+ VALUE cb_mError;
30
+ VALUE cb_mMarshal;
31
+ VALUE cb_mMultiJson;
32
+ VALUE cb_mURI;
33
33
 
34
34
  /* Symbols */
35
- ID sym_add;
36
- ID sym_append;
37
- ID sym_assemble_hash;
38
- ID sym_body;
39
- ID sym_bucket;
40
- ID sym_cas;
41
- ID sym_chunked;
42
- ID sym_content_type;
43
- ID sym_create;
44
- ID sym_cluster;
45
- ID sym_decrement;
46
- ID sym_default_flags;
47
- ID sym_default_format;
48
- ID sym_default_observe_timeout;
49
- ID sym_default_ttl;
50
- ID sym_delete;
51
- ID sym_delta;
52
- ID sym_development;
53
- ID sym_document;
54
- ID sym_environment;
55
- ID sym_extended;
56
- ID sym_flags;
57
- ID sym_format;
58
- ID sym_found;
59
- ID sym_get;
60
- ID sym_hostname;
61
- ID sym_http_request;
62
- ID sym_increment;
63
- ID sym_initial;
64
- ID sym_key_prefix;
65
- ID sym_lock;
66
- ID sym_management;
67
- ID sym_marshal;
68
- ID sym_method;
69
- ID sym_node_list;
70
- ID sym_not_found;
71
- ID sym_num_replicas;
72
- ID sym_observe;
73
- ID sym_password;
74
- ID sym_periodic;
75
- ID sym_persisted;
76
- ID sym_plain;
77
- ID sym_pool;
78
- ID sym_port;
79
- ID sym_post;
80
- ID sym_prepend;
81
- ID sym_production;
82
- ID sym_put;
83
- ID sym_quiet;
84
- ID sym_replace;
85
- ID sym_replica;
86
- ID sym_send_threshold;
87
- ID sym_set;
88
- ID sym_stats;
89
- ID sym_timeout;
90
- ID sym_touch;
91
- ID sym_ttl;
92
- ID sym_type;
93
- ID sym_unlock;
94
- ID sym_username;
95
- ID sym_version;
96
- ID sym_view;
97
- ID id_arity;
98
- ID id_call;
99
- ID id_delete;
100
- ID id_dump;
101
- ID id_dup;
102
- ID id_flatten_bang;
103
- ID id_has_key_p;
104
- ID id_host;
105
- ID id_iv_cas;
106
- ID id_iv_completed;
107
- ID id_iv_error;
108
- ID id_iv_flags;
109
- ID id_iv_from_master;
110
- ID id_iv_headers;
111
- ID id_iv_inner_exception;
112
- ID id_iv_key;
113
- ID id_iv_node;
114
- ID id_iv_operation;
115
- ID id_iv_status;
116
- ID id_iv_time_to_persist;
117
- ID id_iv_time_to_replicate;
118
- ID id_iv_value;
119
- ID id_load;
120
- ID id_match;
121
- ID id_observe_and_wait;
122
- ID id_parse;
123
- ID id_password;
124
- ID id_path;
125
- ID id_port;
126
- ID id_scheme;
127
- ID id_sprintf;
128
- ID id_to_s;
129
- ID id_user;
130
- ID id_verify_observe_options;
35
+ ID cb_sym_add;
36
+ ID cb_sym_append;
37
+ ID cb_sym_assemble_hash;
38
+ ID cb_sym_body;
39
+ ID cb_sym_bucket;
40
+ ID cb_sym_cas;
41
+ ID cb_sym_chunked;
42
+ ID cb_sym_content_type;
43
+ ID cb_sym_create;
44
+ ID cb_sym_cluster;
45
+ ID cb_sym_decrement;
46
+ ID cb_sym_default_arithmetic_init;
47
+ ID cb_sym_default_flags;
48
+ ID cb_sym_default_format;
49
+ ID cb_sym_default_observe_timeout;
50
+ ID cb_sym_default_ttl;
51
+ ID cb_sym_delete;
52
+ ID cb_sym_delta;
53
+ ID cb_sym_development;
54
+ ID cb_sym_document;
55
+ ID cb_sym_environment;
56
+ ID cb_sym_extended;
57
+ ID cb_sym_flags;
58
+ ID cb_sym_format;
59
+ ID cb_sym_found;
60
+ ID cb_sym_get;
61
+ ID cb_sym_hostname;
62
+ ID cb_sym_http_request;
63
+ ID cb_sym_increment;
64
+ ID cb_sym_initial;
65
+ ID cb_sym_key_prefix;
66
+ ID cb_sym_lock;
67
+ ID cb_sym_management;
68
+ ID cb_sym_marshal;
69
+ ID cb_sym_method;
70
+ ID cb_sym_node_list;
71
+ ID cb_sym_not_found;
72
+ ID cb_sym_num_replicas;
73
+ ID cb_sym_observe;
74
+ ID cb_sym_password;
75
+ ID cb_sym_periodic;
76
+ ID cb_sym_persisted;
77
+ ID cb_sym_plain;
78
+ ID cb_sym_pool;
79
+ ID cb_sym_port;
80
+ ID cb_sym_post;
81
+ ID cb_sym_prepend;
82
+ ID cb_sym_production;
83
+ ID cb_sym_put;
84
+ ID cb_sym_quiet;
85
+ ID cb_sym_replace;
86
+ ID cb_sym_replica;
87
+ ID cb_sym_send_threshold;
88
+ ID cb_sym_set;
89
+ ID cb_sym_stats;
90
+ ID cb_sym_timeout;
91
+ ID cb_sym_touch;
92
+ ID cb_sym_ttl;
93
+ ID cb_sym_type;
94
+ ID cb_sym_unlock;
95
+ ID cb_sym_username;
96
+ ID cb_sym_version;
97
+ ID cb_sym_view;
98
+ ID cb_id_arity;
99
+ ID cb_id_call;
100
+ ID cb_id_delete;
101
+ ID cb_id_dump;
102
+ ID cb_id_dup;
103
+ ID cb_id_flatten_bang;
104
+ ID cb_id_has_key_p;
105
+ ID cb_id_host;
106
+ ID cb_id_iv_body;
107
+ ID cb_id_iv_cas;
108
+ ID cb_id_iv_completed;
109
+ ID cb_id_iv_error;
110
+ ID cb_id_iv_flags;
111
+ ID cb_id_iv_from_master;
112
+ ID cb_id_iv_headers;
113
+ ID cb_id_iv_inner_exception;
114
+ ID cb_id_iv_key;
115
+ ID cb_id_iv_node;
116
+ ID cb_id_iv_operation;
117
+ ID cb_id_iv_status;
118
+ ID cb_id_iv_time_to_persist;
119
+ ID cb_id_iv_time_to_replicate;
120
+ ID cb_id_iv_value;
121
+ ID cb_id_load;
122
+ ID cb_id_match;
123
+ ID cb_id_observe_and_wait;
124
+ ID cb_id_parse;
125
+ ID cb_id_parse_body_bang;
126
+ ID cb_id_password;
127
+ ID cb_id_path;
128
+ ID cb_id_port;
129
+ ID cb_id_scheme;
130
+ ID cb_id_sprintf;
131
+ ID cb_id_to_s;
132
+ ID cb_id_user;
133
+ ID cb_id_verify_observe_options;
131
134
 
132
135
  /* Errors */
133
- VALUE eBaseError;
134
- VALUE eValueFormatError;
135
- VALUE eHTTPError;
136
+ VALUE cb_eBaseError;
137
+ VALUE cb_eValueFormatError;
138
+ VALUE cb_eHTTPError;
136
139
 
137
- /* LCB_SUCCESS = 0x00 */
138
- /* LCB_AUTH_CONTINUE = 0x01 */
139
- VALUE eAuthError; /* LCB_AUTH_ERROR = 0x02 */
140
- VALUE eDeltaBadvalError; /* LCB_DELTA_BADVAL = 0x03 */
141
- VALUE eTooBigError; /* LCB_E2BIG = 0x04 */
142
- VALUE eBusyError; /* LCB_EBUSY = 0x05 */
143
- VALUE eInternalError; /* LCB_EINTERNAL = 0x06 */
144
- VALUE eInvalidError; /* LCB_EINVAL = 0x07 */
145
- VALUE eNoMemoryError; /* LCB_ENOMEM = 0x08 */
146
- VALUE eRangeError; /* LCB_ERANGE = 0x09 */
147
- VALUE eLibcouchbaseError; /* LCB_ERROR = 0x0a */
148
- VALUE eTmpFailError; /* LCB_ETMPFAIL = 0x0b */
149
- VALUE eKeyExistsError; /* LCB_KEY_EEXISTS = 0x0c */
150
- VALUE eNotFoundError; /* LCB_KEY_ENOENT = 0x0d */
151
- VALUE eDlopenFailedError; /* LCB_DLOPEN_FAILED = 0x0e */
152
- VALUE eDlsymFailedError; /* LCB_DLSYM_FAILED = 0x0f */
153
- VALUE eNetworkError; /* LCB_NETWORK_ERROR = 0x10 */
154
- VALUE eNotMyVbucketError; /* LCB_NOT_MY_VBUCKET = 0x11 */
155
- VALUE eNotStoredError; /* LCB_NOT_STORED = 0x12 */
156
- VALUE eNotSupportedError; /* LCB_NOT_SUPPORTED = 0x13 */
157
- VALUE eUnknownCommandError; /* LCB_UNKNOWN_COMMAND = 0x14 */
158
- VALUE eUnknownHostError; /* LCB_UNKNOWN_HOST = 0x15 */
159
- VALUE eProtocolError; /* LCB_PROTOCOL_ERROR = 0x16 */
160
- VALUE eTimeoutError; /* LCB_ETIMEDOUT = 0x17 */
161
- VALUE eConnectError; /* LCB_CONNECT_ERROR = 0x18 */
162
- VALUE eBucketNotFoundError; /* LCB_BUCKET_ENOENT = 0x19 */
163
- VALUE eClientNoMemoryError; /* LCB_CLIENT_ENOMEM = 0x1a */
164
- VALUE eClientTmpFailError; /* LCB_CLIENT_ETMPFAIL = 0x1b */
165
- VALUE eBadHandleError; /* LCB_EBADHANDLE = 0x1c */
140
+ /* LCB_SUCCESS = 0x00 */
141
+ /* LCB_AUTH_CONTINUE = 0x01 */
142
+ VALUE cb_eAuthError; /* LCB_AUTH_ERROR = 0x02 */
143
+ VALUE cb_eDeltaBadvalError; /* LCB_DELTA_BADVAL = 0x03 */
144
+ VALUE cb_eTooBigError; /* LCB_E2BIG = 0x04 */
145
+ VALUE cb_eBusyError; /* LCB_EBUSY = 0x05 */
146
+ VALUE cb_eInternalError; /* LCB_EINTERNAL = 0x06 */
147
+ VALUE cb_eInvalidError; /* LCB_EINVAL = 0x07 */
148
+ VALUE cb_eNoMemoryError; /* LCB_ENOMEM = 0x08 */
149
+ VALUE cb_eRangeError; /* LCB_ERANGE = 0x09 */
150
+ VALUE cb_eLibcouchbaseError; /* LCB_ERROR = 0x0a */
151
+ VALUE cb_eTmpFailError; /* LCB_ETMPFAIL = 0x0b */
152
+ VALUE cb_eKeyExistsError; /* LCB_KEY_EEXISTS = 0x0c */
153
+ VALUE cb_eNotFoundError; /* LCB_KEY_ENOENT = 0x0d */
154
+ VALUE cb_eDlopenFailedError; /* LCB_DLOPEN_FAILED = 0x0e */
155
+ VALUE cb_eDlsymFailedError; /* LCB_DLSYM_FAILED = 0x0f */
156
+ VALUE cb_eNetworkError; /* LCB_NETWORK_ERROR = 0x10 */
157
+ VALUE cb_eNotMyVbucketError; /* LCB_NOT_MY_VBUCKET = 0x11 */
158
+ VALUE cb_eNotStoredError; /* LCB_NOT_STORED = 0x12 */
159
+ VALUE cb_eNotSupportedError; /* LCB_NOT_SUPPORTED = 0x13 */
160
+ VALUE cb_eUnknownCommandError; /* LCB_UNKNOWN_COMMAND = 0x14 */
161
+ VALUE cb_eUnknownHostError; /* LCB_UNKNOWN_HOST = 0x15 */
162
+ VALUE cb_eProtocolError; /* LCB_PROTOCOL_ERROR = 0x16 */
163
+ VALUE cb_eTimeoutError; /* LCB_ETIMEDOUT = 0x17 */
164
+ VALUE cb_eConnectError; /* LCB_CONNECT_ERROR = 0x18 */
165
+ VALUE cb_eBucketNotFoundError; /* LCB_BUCKET_ENOENT = 0x19 */
166
+ VALUE cb_eClientNoMemoryError; /* LCB_CLIENT_ENOMEM = 0x1a */
167
+ VALUE cb_eClientTmpFailError; /* LCB_CLIENT_ETMPFAIL = 0x1b */
168
+ VALUE cb_eBadHandleError; /* LCB_EBADHANDLE = 0x1c */
166
169
 
167
170
 
168
171
  /* Ruby Extension initializer */
169
172
  void
170
173
  Init_couchbase_ext(void)
171
174
  {
172
- mMultiJson = rb_const_get(rb_cObject, rb_intern("MultiJson"));
173
- mURI = rb_const_get(rb_cObject, rb_intern("URI"));
174
- mMarshal = rb_const_get(rb_cObject, rb_intern("Marshal"));
175
- mCouchbase = rb_define_module("Couchbase");
175
+ cb_mMultiJson = rb_const_get(rb_cObject, rb_intern("MultiJson"));
176
+ cb_mURI = rb_const_get(rb_cObject, rb_intern("URI"));
177
+ cb_mMarshal = rb_const_get(rb_cObject, rb_intern("Marshal"));
178
+ cb_mCouchbase = rb_define_module("Couchbase");
176
179
 
177
- mError = rb_define_module_under(mCouchbase, "Error");
180
+ cb_mError = rb_define_module_under(cb_mCouchbase, "Error");
178
181
  /* Document-class: Couchbase::Error::Base
179
182
  * The base error class
180
183
  *
181
184
  * @since 1.0.0
182
185
  */
183
- eBaseError = rb_define_class_under(mError, "Base", rb_eStandardError);
186
+ cb_eBaseError = rb_define_class_under(cb_mError, "Base", rb_eStandardError);
184
187
  /* Document-class: Couchbase::Error::Auth
185
188
  * Authentication error
186
189
  *
@@ -188,7 +191,7 @@ Init_couchbase_ext(void)
188
191
  *
189
192
  * @since 1.0.0
190
193
  */
191
- eAuthError = rb_define_class_under(mError, "Auth", eBaseError);
194
+ cb_eAuthError = rb_define_class_under(cb_mError, "Auth", cb_eBaseError);
192
195
  /* Document-class: Couchbase::Error::BucketNotFound
193
196
  * Bucket not found
194
197
  *
@@ -196,7 +199,7 @@ Init_couchbase_ext(void)
196
199
  *
197
200
  * @since 1.0.0
198
201
  */
199
- eBucketNotFoundError = rb_define_class_under(mError, "BucketNotFound", eBaseError);
202
+ cb_eBucketNotFoundError = rb_define_class_under(cb_mError, "BucketNotFound", cb_eBaseError);
200
203
  /* Document-class: Couchbase::Error::Busy
201
204
  * The cluster is too busy
202
205
  *
@@ -205,13 +208,13 @@ Init_couchbase_ext(void)
205
208
  *
206
209
  * @since 1.0.0
207
210
  */
208
- eBusyError = rb_define_class_under(mError, "Busy", eBaseError);
211
+ cb_eBusyError = rb_define_class_under(cb_mError, "Busy", cb_eBaseError);
209
212
  /* Document-class: Couchbase::Error::DeltaBadval
210
213
  * The given value is not a number
211
214
  *
212
215
  * @since 1.0.0
213
216
  */
214
- eDeltaBadvalError = rb_define_class_under(mError, "DeltaBadval", eBaseError);
217
+ cb_eDeltaBadvalError = rb_define_class_under(cb_mError, "DeltaBadval", cb_eBaseError);
215
218
  /* Document-class: Couchbase::Error::Internal
216
219
  * Internal error
217
220
  *
@@ -220,13 +223,13 @@ Init_couchbase_ext(void)
220
223
  *
221
224
  * @since 1.0.0
222
225
  */
223
- eInternalError = rb_define_class_under(mError, "Internal", eBaseError);
226
+ cb_eInternalError = rb_define_class_under(cb_mError, "Internal", cb_eBaseError);
224
227
  /* Document-class: Couchbase::Error::Invalid
225
228
  * Invalid arguments
226
229
  *
227
230
  * @since 1.0.0
228
231
  */
229
- eInvalidError = rb_define_class_under(mError, "Invalid", eBaseError);
232
+ cb_eInvalidError = rb_define_class_under(cb_mError, "Invalid", cb_eBaseError);
230
233
  /* Document-class: Couchbase::Error::KeyExists
231
234
  * Key already exists
232
235
  *
@@ -234,13 +237,13 @@ Init_couchbase_ext(void)
234
237
  *
235
238
  * @since 1.0.0
236
239
  */
237
- eKeyExistsError = rb_define_class_under(mError, "KeyExists", eBaseError);
240
+ cb_eKeyExistsError = rb_define_class_under(cb_mError, "KeyExists", cb_eBaseError);
238
241
  /* Document-class: Couchbase::Error::Libcouchbase
239
242
  * Generic error
240
243
  *
241
244
  * @since 1.0.0
242
245
  */
243
- eLibcouchbaseError = rb_define_class_under(mError, "Libcouchbase", eBaseError);
246
+ cb_eLibcouchbaseError = rb_define_class_under(cb_mError, "Libcouchbase", cb_eBaseError);
244
247
  /* Document-class: Couchbase::Error::Network
245
248
  * Network error
246
249
  *
@@ -249,7 +252,7 @@ Init_couchbase_ext(void)
249
252
  *
250
253
  * @since 1.0.0
251
254
  */
252
- eNetworkError = rb_define_class_under(mError, "Network", eBaseError);
255
+ cb_eNetworkError = rb_define_class_under(cb_mError, "Network", cb_eBaseError);
253
256
  /* Document-class: Couchbase::Error::NoMemory
254
257
  * Out of memory error (on Server)
255
258
  *
@@ -257,19 +260,19 @@ Init_couchbase_ext(void)
257
260
  *
258
261
  * @since 1.0.0
259
262
  */
260
- eNoMemoryError = rb_define_class_under(mError, "NoMemory", eBaseError);
263
+ cb_eNoMemoryError = rb_define_class_under(cb_mError, "NoMemory", cb_eBaseError);
261
264
  /* Document-class: Couchbase::Error::ClientNoMemory
262
265
  * Out of memory error (on Client)
263
266
  *
264
267
  * @since 1.2.0.dp6
265
268
  */
266
- eClientNoMemoryError = rb_define_class_under(mError, "ClientNoMemory", eBaseError);
269
+ cb_eClientNoMemoryError = rb_define_class_under(cb_mError, "ClientNoMemory", cb_eBaseError);
267
270
  /* Document-class: Couchbase::Error::NotFound
268
271
  * No such key
269
272
  *
270
273
  * @since 1.0.0
271
274
  */
272
- eNotFoundError = rb_define_class_under(mError, "NotFound", eBaseError);
275
+ cb_eNotFoundError = rb_define_class_under(cb_mError, "NotFound", cb_eBaseError);
273
276
  /* Document-class: Couchbase::Error::NotMyVbucket
274
277
  * The vbucket is not located on this server
275
278
  *
@@ -279,7 +282,7 @@ Init_couchbase_ext(void)
279
282
  *
280
283
  * @since 1.0.0
281
284
  */
282
- eNotMyVbucketError = rb_define_class_under(mError, "NotMyVbucket", eBaseError);
285
+ cb_eNotMyVbucketError = rb_define_class_under(cb_mError, "NotMyVbucket", cb_eBaseError);
283
286
  /* Document-class: Couchbase::Error::NotStored
284
287
  * Not stored
285
288
  *
@@ -287,7 +290,7 @@ Init_couchbase_ext(void)
287
290
  *
288
291
  * @since 1.0.0
289
292
  */
290
- eNotStoredError = rb_define_class_under(mError, "NotStored", eBaseError);
293
+ cb_eNotStoredError = rb_define_class_under(cb_mError, "NotStored", cb_eBaseError);
291
294
  /* Document-class: Couchbase::Error::NotSupported
292
295
  * Not supported
293
296
  *
@@ -297,7 +300,7 @@ Init_couchbase_ext(void)
297
300
  *
298
301
  * @since 1.0.0
299
302
  */
300
- eNotSupportedError = rb_define_class_under(mError, "NotSupported", eBaseError);
303
+ cb_eNotSupportedError = rb_define_class_under(cb_mError, "NotSupported", cb_eBaseError);
301
304
  /* Document-class: Couchbase::Error::Range
302
305
  * Invalid range
303
306
  *
@@ -305,7 +308,7 @@ Init_couchbase_ext(void)
305
308
  *
306
309
  * @since 1.0.0
307
310
  */
308
- eRangeError = rb_define_class_under(mError, "Range", eBaseError);
311
+ cb_eRangeError = rb_define_class_under(cb_mError, "Range", cb_eBaseError);
309
312
  /* Document-class: Couchbase::Error::TemporaryFail
310
313
  * Temporary failure
311
314
  *
@@ -314,7 +317,7 @@ Init_couchbase_ext(void)
314
317
  *
315
318
  * @since 1.0.0
316
319
  */
317
- eTmpFailError = rb_define_class_under(mError, "TemporaryFail", eBaseError);
320
+ cb_eTmpFailError = rb_define_class_under(cb_mError, "TemporaryFail", cb_eBaseError);
318
321
  /* Document-class: Couchbase::Error::ClientTemporaryFail
319
322
  * Temporary failure (on Client)
320
323
  *
@@ -323,7 +326,7 @@ Init_couchbase_ext(void)
323
326
  *
324
327
  * @since 1.2.0
325
328
  */
326
- eClientTmpFailError = rb_define_class_under(mError, "ClientTemporaryFail", eBaseError);
329
+ cb_eClientTmpFailError = rb_define_class_under(cb_mError, "ClientTemporaryFail", cb_eBaseError);
327
330
  /* Document-class: Couchbase::Error::TooBig
328
331
  * Object too big
329
332
  *
@@ -331,7 +334,7 @@ Init_couchbase_ext(void)
331
334
  *
332
335
  * @since 1.0.0
333
336
  */
334
- eTooBigError = rb_define_class_under(mError, "TooBig", eBaseError);
337
+ cb_eTooBigError = rb_define_class_under(cb_mError, "TooBig", cb_eBaseError);
335
338
  /* Document-class: Couchbase::Error::UnknownCommand
336
339
  * Unknown command
337
340
  *
@@ -339,7 +342,7 @@ Init_couchbase_ext(void)
339
342
  *
340
343
  * @since 1.0.0
341
344
  */
342
- eUnknownCommandError = rb_define_class_under(mError, "UnknownCommand", eBaseError);
345
+ cb_eUnknownCommandError = rb_define_class_under(cb_mError, "UnknownCommand", cb_eBaseError);
343
346
  /* Document-class: Couchbase::Error::UnknownHost
344
347
  * Unknown host
345
348
  *
@@ -347,13 +350,13 @@ Init_couchbase_ext(void)
347
350
  *
348
351
  * @since 1.0.0
349
352
  */
350
- eUnknownHostError = rb_define_class_under(mError, "UnknownHost", eBaseError);
353
+ cb_eUnknownHostError = rb_define_class_under(cb_mError, "UnknownHost", cb_eBaseError);
351
354
  /* Document-class: Couchbase::Error::ValueFormat
352
355
  * Failed to decode or encode value
353
356
  *
354
357
  * @since 1.0.0
355
358
  */
356
- eValueFormatError = rb_define_class_under(mError, "ValueFormat", eBaseError);
359
+ cb_eValueFormatError = rb_define_class_under(cb_mError, "ValueFormat", cb_eBaseError);
357
360
  /* Document-class: Couchbase::Error::Protocol
358
361
  * Protocol error
359
362
  *
@@ -362,7 +365,7 @@ Init_couchbase_ext(void)
362
365
  *
363
366
  * @since 1.0.0
364
367
  */
365
- eProtocolError = rb_define_class_under(mError, "Protocol", eBaseError);
368
+ cb_eProtocolError = rb_define_class_under(cb_mError, "Protocol", cb_eBaseError);
366
369
  /* Document-class: Couchbase::Error::Timeout
367
370
  * Timeout error
368
371
  *
@@ -370,13 +373,13 @@ Init_couchbase_ext(void)
370
373
  *
371
374
  * @since 1.1.0
372
375
  */
373
- eTimeoutError = rb_define_class_under(mError, "Timeout", eBaseError);
376
+ cb_eTimeoutError = rb_define_class_under(cb_mError, "Timeout", cb_eBaseError);
374
377
  /* Document-class: Couchbase::Error::Connect
375
378
  * Connect error
376
379
  *
377
380
  * @since 1.1.0
378
381
  */
379
- eConnectError = rb_define_class_under(mError, "Connect", eBaseError);
382
+ cb_eConnectError = rb_define_class_under(cb_mError, "Connect", cb_eBaseError);
380
383
  /* Document-class: Couchbase::Error::BadHandle
381
384
  * Invalid handle type.
382
385
  *
@@ -384,7 +387,7 @@ Init_couchbase_ext(void)
384
387
  *
385
388
  * @since 1.2.0
386
389
  */
387
- eBadHandleError = rb_define_class_under(mError, "BadHandle", eBaseError);
390
+ cb_eBadHandleError = rb_define_class_under(cb_mError, "BadHandle", cb_eBaseError);
388
391
 
389
392
  /* Document-class: Couchbase::Error::DlopenFailed
390
393
  * dlopen() failed
@@ -393,23 +396,24 @@ Init_couchbase_ext(void)
393
396
  *
394
397
  * @since 1.2.0
395
398
  */
396
- eDlopenFailedError = rb_define_class_under(mError, "DlopenFailed", eBaseError);
399
+ cb_eDlopenFailedError = rb_define_class_under(cb_mError, "DlopenFailed", cb_eBaseError);
397
400
 
398
401
  /* Document-class: Couchbase::Error::DlsymFailed
399
402
  * dlsym() failed
400
403
  *
401
- * Failed to locate the requested symbol in the shared object
404
+ * Failed to locate the requested cb_symbol in the shared object
402
405
  *
403
406
  * @since 1.2.0
404
407
  */
405
- eDlsymFailedError = rb_define_class_under(mError, "DlsymFailed", eBaseError);
408
+ cb_eDlsymFailedError = rb_define_class_under(cb_mError, "DlsymFailed", cb_eBaseError);
406
409
 
407
410
  /* Document-class: Couchbase::Error::HTTP
408
411
  * HTTP error with status code
409
412
  *
410
413
  * @since 1.2.0
411
414
  */
412
- eHTTPError = rb_define_class_under(mError, "HTTP", eBaseError);
415
+ cb_eHTTPError = rb_define_class_under(cb_mError, "HTTP", cb_eBaseError);
416
+ cb_id_iv_body = rb_intern("@body");
413
417
  /* Document-method: error
414
418
  *
415
419
  * The underlying libcouchbase library could return one of the following
@@ -431,7 +435,7 @@ Init_couchbase_ext(void)
431
435
  * 0x0c :: LCB_KEY_EEXISTS (Key exists (with a different CAS value))
432
436
  * 0x0d :: LCB_KEY_ENOENT (No such key)
433
437
  * 0x0e :: LCB_DLOPEN_FAILED (Failed to open shared object)
434
- * 0x0f :: LCB_DLSYM_FAILED (Failed to locate the requested symbol in shared object)
438
+ * 0x0f :: LCB_DLSYM_FAILED (Failed to locate the requested cb_symbol in shared object)
435
439
  * 0x10 :: LCB_NETWORK_ERROR (Network error)
436
440
  * 0x11 :: LCB_NOT_MY_VBUCKET (The vbucket is not located on this server)
437
441
  * 0x12 :: LCB_NOT_STORED (Not stored)
@@ -451,44 +455,44 @@ Init_couchbase_ext(void)
451
455
  *
452
456
  * @return [Fixnum] the error code from libcouchbase
453
457
  */
454
- rb_define_attr(eBaseError, "error", 1, 0);
455
- id_iv_error = rb_intern("@error");
458
+ rb_define_attr(cb_eBaseError, "error", 1, 0);
459
+ cb_id_iv_error = rb_intern("@error");
456
460
  /* Document-method: status
457
461
  *
458
462
  * @since 1.2.0.beta
459
463
  *
460
464
  * @return [Fixnum] The HTTP status code */
461
- rb_define_attr(eBaseError, "status", 1, 0);
462
- id_iv_status = rb_intern("@status");
465
+ rb_define_attr(cb_eBaseError, "status", 1, 0);
466
+ cb_id_iv_status = rb_intern("@status");
463
467
  /* Document-method: key
464
468
  *
465
469
  * @since 1.0.0
466
470
  *
467
471
  * @return [String] the key which generated error */
468
- rb_define_attr(eBaseError, "key", 1, 0);
469
- id_iv_key = rb_intern("@key");
472
+ rb_define_attr(cb_eBaseError, "key", 1, 0);
473
+ cb_id_iv_key = rb_intern("@key");
470
474
  /* Document-method: cas
471
475
  *
472
476
  * @since 1.0.0
473
477
  *
474
478
  * @return [Fixnum] the version of the key (+nil+ unless accessible) */
475
- rb_define_attr(eBaseError, "cas", 1, 0);
476
- id_iv_cas = rb_intern("@cas");
479
+ rb_define_attr(cb_eBaseError, "cas", 1, 0);
480
+ cb_id_iv_cas = rb_intern("@cas");
477
481
  /* Document-method: operation
478
482
  *
479
483
  * @since 1.0.0
480
484
  *
481
485
  * @return [Symbol] the operation (+nil+ unless accessible) */
482
- rb_define_attr(eBaseError, "operation", 1, 0);
483
- id_iv_operation = rb_intern("@operation");
486
+ rb_define_attr(cb_eBaseError, "operation", 1, 0);
487
+ cb_id_iv_operation = rb_intern("@operation");
484
488
  /* Document-method: inner_exception
485
489
  *
486
490
  * @since 1.2.0.beta4
487
491
  *
488
492
  * @return [Exception] the inner exception or +nil+. Some exceptions like
489
493
  * {Error::ValueFormat} wrap the original exception */
490
- rb_define_attr(eBaseError, "inner_exception", 1, 0);
491
- id_iv_inner_exception = rb_intern("@inner_exception");
494
+ rb_define_attr(cb_eBaseError, "inner_exception", 1, 0);
495
+ cb_id_iv_inner_exception = rb_intern("@inner_exception");
492
496
 
493
497
  /* Document-class: Couchbase::Result
494
498
  *
@@ -496,63 +500,63 @@ Init_couchbase_ext(void)
496
500
  *
497
501
  * @since 1.0.0
498
502
  */
499
- cResult = rb_define_class_under(mCouchbase, "Result", rb_cObject);
500
- rb_define_method(cResult, "inspect", cb_result_inspect, 0);
501
- rb_define_method(cResult, "success?", cb_result_success_p, 0);
503
+ cb_cResult = rb_define_class_under(cb_mCouchbase, "Result", rb_cObject);
504
+ rb_define_method(cb_cResult, "inspect", cb_result_inspect, 0);
505
+ rb_define_method(cb_cResult, "success?", cb_result_success_p, 0);
502
506
  /* Document-method: operation
503
507
  *
504
508
  * @since 1.0.0
505
509
  *
506
510
  * @return [Symbol]
507
511
  */
508
- rb_define_attr(cResult, "operation", 1, 0);
512
+ rb_define_attr(cb_cResult, "operation", 1, 0);
509
513
  /* Document-method: error
510
514
  *
511
515
  * @since 1.0.0
512
516
  *
513
517
  * @return [Couchbase::Error::Base]
514
518
  */
515
- rb_define_attr(cResult, "error", 1, 0);
519
+ rb_define_attr(cb_cResult, "error", 1, 0);
516
520
  /* Document-method: key
517
521
  *
518
522
  * @since 1.0.0
519
523
  *
520
524
  * @return [String]
521
525
  */
522
- rb_define_attr(cResult, "key", 1, 0);
523
- id_iv_key = rb_intern("@key");
526
+ rb_define_attr(cb_cResult, "key", 1, 0);
527
+ cb_id_iv_key = rb_intern("@key");
524
528
  /* Document-method: value
525
529
  *
526
530
  * @since 1.0.0
527
531
  *
528
532
  * @return [String]
529
533
  */
530
- rb_define_attr(cResult, "value", 1, 0);
531
- id_iv_value = rb_intern("@value");
534
+ rb_define_attr(cb_cResult, "value", 1, 0);
535
+ cb_id_iv_value = rb_intern("@value");
532
536
  /* Document-method: cas
533
537
  *
534
538
  * @since 1.0.0
535
539
  *
536
540
  * @return [Fixnum]
537
541
  */
538
- rb_define_attr(cResult, "cas", 1, 0);
539
- id_iv_cas = rb_intern("@cas");
542
+ rb_define_attr(cb_cResult, "cas", 1, 0);
543
+ cb_id_iv_cas = rb_intern("@cas");
540
544
  /* Document-method: flags
541
545
  *
542
546
  * @since 1.0.0
543
547
  *
544
548
  * @return [Fixnum]
545
549
  */
546
- rb_define_attr(cResult, "flags", 1, 0);
547
- id_iv_flags = rb_intern("@flags");
550
+ rb_define_attr(cb_cResult, "flags", 1, 0);
551
+ cb_id_iv_flags = rb_intern("@flags");
548
552
  /* Document-method: node
549
553
  *
550
554
  * @since 1.0.0
551
555
  *
552
556
  * @return [String]
553
557
  */
554
- rb_define_attr(cResult, "node", 1, 0);
555
- id_iv_node = rb_intern("@node");
558
+ rb_define_attr(cb_cResult, "node", 1, 0);
559
+ cb_id_iv_node = rb_intern("@node");
556
560
  /* Document-method: headers
557
561
  *
558
562
  * @since 1.2.0
@@ -561,14 +565,14 @@ Init_couchbase_ext(void)
561
565
  *
562
566
  * @return [Hash]
563
567
  */
564
- rb_define_attr(cResult, "headers", 1, 0);
565
- id_iv_headers = rb_intern("@headers");
568
+ rb_define_attr(cb_cResult, "headers", 1, 0);
569
+ cb_id_iv_headers = rb_intern("@headers");
566
570
  /* Document-method: completed
567
571
  * In {Bucket::CouchRequest} operations used to mark the final call
568
572
  * @return [Boolean] */
569
- rb_define_attr(cResult, "completed", 1, 0);
570
- rb_define_alias(cResult, "completed?", "completed");
571
- id_iv_completed = rb_intern("@completed");
573
+ rb_define_attr(cb_cResult, "completed", 1, 0);
574
+ rb_define_alias(cb_cResult, "completed?", "completed");
575
+ cb_id_iv_completed = rb_intern("@completed");
572
576
  /* Document-method: status
573
577
  *
574
578
  * @since 1.2.0.dp6
@@ -582,8 +586,8 @@ Init_couchbase_ext(void)
582
586
  *
583
587
  * @return [Symbol]
584
588
  */
585
- rb_define_attr(cResult, "status", 1, 0);
586
- id_iv_status = rb_intern("@status");
589
+ rb_define_attr(cb_cResult, "status", 1, 0);
590
+ cb_id_iv_status = rb_intern("@status");
587
591
  /* Document-method: from_master
588
592
  *
589
593
  * @since 1.2.0.dp6
@@ -593,9 +597,9 @@ Init_couchbase_ext(void)
593
597
  * True if key stored on master
594
598
  * @return [Boolean]
595
599
  */
596
- rb_define_attr(cResult, "from_master", 1, 0);
597
- rb_define_alias(cResult, "from_master?", "from_master");
598
- id_iv_from_master = rb_intern("@from_master");
600
+ rb_define_attr(cb_cResult, "from_master", 1, 0);
601
+ rb_define_alias(cb_cResult, "from_master?", "from_master");
602
+ cb_id_iv_from_master = rb_intern("@from_master");
599
603
  /* Document-method: time_to_persist
600
604
  *
601
605
  * @since 1.2.0.dp6
@@ -605,9 +609,9 @@ Init_couchbase_ext(void)
605
609
  * Average time needed to persist key on the disk (zero if unavailable)
606
610
  * @return [Fixnum]
607
611
  */
608
- rb_define_attr(cResult, "time_to_persist", 1, 0);
609
- rb_define_alias(cResult, "ttp", "time_to_persist");
610
- id_iv_time_to_persist = rb_intern("@time_to_persist");
612
+ rb_define_attr(cb_cResult, "time_to_persist", 1, 0);
613
+ rb_define_alias(cb_cResult, "ttp", "time_to_persist");
614
+ cb_id_iv_time_to_persist = rb_intern("@time_to_persist");
611
615
  /* Document-method: time_to_persist
612
616
  *
613
617
  * @since 1.2.0.dp6
@@ -617,9 +621,9 @@ Init_couchbase_ext(void)
617
621
  * Average time needed to replicate key on the disk (zero if unavailable)
618
622
  * @return [Fixnum]
619
623
  */
620
- rb_define_attr(cResult, "time_to_replicate", 1, 0);
621
- rb_define_alias(cResult, "ttr", "time_to_replicate");
622
- id_iv_time_to_replicate = rb_intern("@time_to_replicate");
624
+ rb_define_attr(cb_cResult, "time_to_replicate", 1, 0);
625
+ rb_define_alias(cb_cResult, "ttr", "time_to_replicate");
626
+ cb_id_iv_time_to_replicate = rb_intern("@time_to_replicate");
623
627
 
624
628
  /* Document-class: Couchbase::Bucket
625
629
  *
@@ -628,60 +632,60 @@ Init_couchbase_ext(void)
628
632
  *
629
633
  * @since 1.0.0
630
634
  */
631
- cBucket = rb_define_class_under(mCouchbase, "Bucket", rb_cObject);
635
+ cb_cBucket = rb_define_class_under(cb_mCouchbase, "Bucket", rb_cObject);
632
636
 
633
637
  /* 0x03: Bitmask for flag bits responsible for format */
634
- rb_define_const(cBucket, "FMT_MASK", INT2FIX(FMT_MASK));
638
+ rb_define_const(cb_cBucket, "FMT_MASK", INT2FIX(CB_FMT_MASK));
635
639
  /* 0x00: Document format. The (default) format supports most of ruby
636
640
  * types which could be mapped to JSON data (hashes, arrays, strings,
637
641
  * numbers). Future version will be able to run map/reduce queries on
638
642
  * the values in the document form (hashes). */
639
- rb_define_const(cBucket, "FMT_DOCUMENT", INT2FIX(FMT_DOCUMENT));
643
+ rb_define_const(cb_cBucket, "FMT_DOCUMENT", INT2FIX(CB_FMT_DOCUMENT));
640
644
  /* 0x01: Marshal format. The format which supports transparent
641
645
  * serialization of ruby objects with standard <tt>Marshal.dump</tt> and
642
646
  * <tt>Marhal.load</tt> methods. */
643
- rb_define_const(cBucket, "FMT_MARSHAL", INT2FIX(FMT_MARSHAL));
647
+ rb_define_const(cb_cBucket, "FMT_MARSHAL", INT2FIX(CB_FMT_MARSHAL));
644
648
  /* 0x02: Plain format. The format which force client don't apply any
645
649
  * conversions to the value, but it should be passed as String. It
646
650
  * could be useful for building custom algorithms or formats. For
647
651
  * example implement set:
648
652
  * http://dustin.github.com/2011/02/17/memcached-set.html */
649
- rb_define_const(cBucket, "FMT_PLAIN", INT2FIX(FMT_PLAIN));
653
+ rb_define_const(cb_cBucket, "FMT_PLAIN", INT2FIX(CB_FMT_PLAIN));
650
654
 
651
- rb_define_alloc_func(cBucket, cb_bucket_alloc);
652
- rb_define_method(cBucket, "initialize", cb_bucket_init, -1);
653
- rb_define_method(cBucket, "initialize_copy", cb_bucket_init_copy, 1);
654
- rb_define_method(cBucket, "inspect", cb_bucket_inspect, 0);
655
+ rb_define_alloc_func(cb_cBucket, cb_bucket_alloc);
656
+ rb_define_method(cb_cBucket, "initialize", cb_bucket_init, -1);
657
+ rb_define_method(cb_cBucket, "initialize_copy", cb_bucket_init_copy, 1);
658
+ rb_define_method(cb_cBucket, "inspect", cb_bucket_inspect, 0);
655
659
 
656
- rb_define_method(cBucket, "add", cb_bucket_add, -1);
657
- rb_define_method(cBucket, "append", cb_bucket_append, -1);
658
- rb_define_method(cBucket, "prepend", cb_bucket_prepend, -1);
659
- rb_define_method(cBucket, "replace", cb_bucket_replace, -1);
660
- rb_define_method(cBucket, "set", cb_bucket_set, -1);
661
- rb_define_method(cBucket, "get", cb_bucket_get, -1);
662
- rb_define_method(cBucket, "run", cb_bucket_run, -1);
663
- rb_define_method(cBucket, "stop", cb_bucket_stop, 0);
664
- rb_define_method(cBucket, "touch", cb_bucket_touch, -1);
665
- rb_define_method(cBucket, "delete", cb_bucket_delete, -1);
666
- rb_define_method(cBucket, "stats", cb_bucket_stats, -1);
667
- rb_define_method(cBucket, "version", cb_bucket_version, -1);
668
- rb_define_method(cBucket, "incr", cb_bucket_incr, -1);
669
- rb_define_method(cBucket, "decr", cb_bucket_decr, -1);
670
- rb_define_method(cBucket, "unlock", cb_bucket_unlock, -1);
671
- rb_define_method(cBucket, "disconnect", cb_bucket_disconnect, 0);
672
- rb_define_method(cBucket, "reconnect", cb_bucket_reconnect, -1);
673
- rb_define_method(cBucket, "make_http_request", cb_bucket_make_http_request, -1);
674
- rb_define_method(cBucket, "observe", cb_bucket_observe, -1);
660
+ rb_define_method(cb_cBucket, "add", cb_bucket_add, -1);
661
+ rb_define_method(cb_cBucket, "append", cb_bucket_append, -1);
662
+ rb_define_method(cb_cBucket, "prepend", cb_bucket_prepend, -1);
663
+ rb_define_method(cb_cBucket, "replace", cb_bucket_replace, -1);
664
+ rb_define_method(cb_cBucket, "set", cb_bucket_set, -1);
665
+ rb_define_method(cb_cBucket, "get", cb_bucket_get, -1);
666
+ rb_define_method(cb_cBucket, "run", cb_bucket_run, -1);
667
+ rb_define_method(cb_cBucket, "stop", cb_bucket_stop, 0);
668
+ rb_define_method(cb_cBucket, "touch", cb_bucket_touch, -1);
669
+ rb_define_method(cb_cBucket, "delete", cb_bucket_delete, -1);
670
+ rb_define_method(cb_cBucket, "stats", cb_bucket_stats, -1);
671
+ rb_define_method(cb_cBucket, "version", cb_bucket_version, -1);
672
+ rb_define_method(cb_cBucket, "incr", cb_bucket_incr, -1);
673
+ rb_define_method(cb_cBucket, "decr", cb_bucket_decr, -1);
674
+ rb_define_method(cb_cBucket, "unlock", cb_bucket_unlock, -1);
675
+ rb_define_method(cb_cBucket, "disconnect", cb_bucket_disconnect, 0);
676
+ rb_define_method(cb_cBucket, "reconnect", cb_bucket_reconnect, -1);
677
+ rb_define_method(cb_cBucket, "make_http_request", cb_bucket_make_http_request, -1);
678
+ rb_define_method(cb_cBucket, "observe", cb_bucket_observe, -1);
675
679
 
676
- rb_define_alias(cBucket, "decrement", "decr");
677
- rb_define_alias(cBucket, "increment", "incr");
680
+ rb_define_alias(cb_cBucket, "decrement", "decr");
681
+ rb_define_alias(cb_cBucket, "increment", "incr");
678
682
 
679
- rb_define_alias(cBucket, "[]", "get");
680
- rb_define_alias(cBucket, "[]=", "set");
681
- rb_define_method(cBucket, "[]=", cb_bucket_aset, -1);
683
+ rb_define_alias(cb_cBucket, "[]", "get");
684
+ rb_define_alias(cb_cBucket, "[]=", "set");
685
+ rb_define_method(cb_cBucket, "[]=", cb_bucket_aset, -1);
682
686
 
683
- rb_define_method(cBucket, "connected?", cb_bucket_connected_p, 0);
684
- rb_define_method(cBucket, "async?", cb_bucket_async_p, 0);
687
+ rb_define_method(cb_cBucket, "connected?", cb_bucket_connected_p, 0);
688
+ rb_define_method(cb_cBucket, "async?", cb_bucket_async_p, 0);
685
689
 
686
690
  /* Document-method: quiet
687
691
  * Flag specifying behaviour for operations on missing keys
@@ -700,10 +704,10 @@ Init_couchbase_ext(void)
700
704
  * connection.get("miss") #=> will raise Couchbase::Error::NotFound
701
705
  *
702
706
  * @return [true, false] */
703
- /* rb_define_attr(cBucket, "quiet", 1, 1); */
704
- rb_define_method(cBucket, "quiet", cb_bucket_quiet_get, 0);
705
- rb_define_method(cBucket, "quiet=", cb_bucket_quiet_set, 1);
706
- rb_define_alias(cBucket, "quiet?", "quiet");
707
+ /* rb_define_attr(cb_cBucket, "quiet", 1, 1); */
708
+ rb_define_method(cb_cBucket, "quiet", cb_bucket_quiet_get, 0);
709
+ rb_define_method(cb_cBucket, "quiet=", cb_bucket_quiet_set, 1);
710
+ rb_define_alias(cb_cBucket, "quiet?", "quiet");
707
711
 
708
712
  /* Document-method: default_flags
709
713
  * Default flags for new values.
@@ -722,9 +726,9 @@ Init_couchbase_ext(void)
722
726
  * @note Amending format bit will also change #default_format value
723
727
  *
724
728
  * @return [Fixnum] the effective flags */
725
- /* rb_define_attr(cBucket, "default_flags", 1, 1); */
726
- rb_define_method(cBucket, "default_flags", cb_bucket_default_flags_get, 0);
727
- rb_define_method(cBucket, "default_flags=", cb_bucket_default_flags_set, 1);
729
+ /* rb_define_attr(cb_cBucket, "default_flags", 1, 1); */
730
+ rb_define_method(cb_cBucket, "default_flags", cb_bucket_default_flags_get, 0);
731
+ rb_define_method(cb_cBucket, "default_flags=", cb_bucket_default_flags_set, 1);
728
732
 
729
733
  /* Document-method: default_format
730
734
  * Default format for new values.
@@ -754,7 +758,7 @@ Init_couchbase_ext(void)
754
758
  * your ruby object with standard <tt>Marshal.dump</tt> and
755
759
  * <tt>Marhal.load</tt> methods.
756
760
  *
757
- * @example Selecting plain format using symbol
761
+ * @example Selecting plain format using cb_symbol
758
762
  * connection.format = :document
759
763
  *
760
764
  * @example Selecting plain format using Fixnum constant
@@ -763,9 +767,9 @@ Init_couchbase_ext(void)
763
767
  * @note Amending default_format will also change #default_flags value
764
768
  *
765
769
  * @return [Symbol] the effective format */
766
- /* rb_define_attr(cBucket, "default_format", 1, 1); */
767
- rb_define_method(cBucket, "default_format", cb_bucket_default_format_get, 0);
768
- rb_define_method(cBucket, "default_format=", cb_bucket_default_format_set, 1);
770
+ /* rb_define_attr(cb_cBucket, "default_format", 1, 1); */
771
+ rb_define_method(cb_cBucket, "default_format", cb_bucket_default_format_get, 0);
772
+ rb_define_method(cb_cBucket, "default_format=", cb_bucket_default_format_set, 1);
769
773
 
770
774
  /* Document-method: timeout
771
775
  *
@@ -774,9 +778,23 @@ Init_couchbase_ext(void)
774
778
  * @return [Fixnum] The timeout for the operations in microseconds. The
775
779
  * client will raise {Couchbase::Error::Timeout} exception for all
776
780
  * commands which weren't completed in given timeslot. */
777
- /* rb_define_attr(cBucket, "timeout", 1, 1); */
778
- rb_define_method(cBucket, "timeout", cb_bucket_timeout_get, 0);
779
- rb_define_method(cBucket, "timeout=", cb_bucket_timeout_set, 1);
781
+ /* rb_define_attr(cb_cBucket, "timeout", 1, 1); */
782
+ rb_define_method(cb_cBucket, "timeout", cb_bucket_timeout_get, 0);
783
+ rb_define_method(cb_cBucket, "timeout=", cb_bucket_timeout_set, 1);
784
+
785
+ /* Document-method: default_arithmetic_init
786
+ *
787
+ * @since 1.2.0
788
+ *
789
+ * @return [Fixnum, true] The initial value for arithmetic operations
790
+ * {Bucket#incr} and {Bucket#decr}. Setting this attribute will force
791
+ * aforementioned operations create keys unless they exists in the
792
+ * bucket and will use given value. You can also just specify +true+
793
+ * if you'd like just force key creation with zero default value.
794
+ */
795
+ /* rb_define_attr(cb_cBucket, "default_arithmetic_init", 1, 1); */
796
+ rb_define_method(cb_cBucket, "default_arithmetic_init", cb_bucket_default_arithmetic_init_get, 0);
797
+ rb_define_method(cb_cBucket, "default_arithmetic_init=", cb_bucket_default_arithmetic_init_set, 1);
780
798
 
781
799
  /* Document-method: key_prefix
782
800
  *
@@ -784,9 +802,9 @@ Init_couchbase_ext(void)
784
802
  *
785
803
  * @return [String] The library will prepend +key_prefix+ to each key to
786
804
  * provide simple namespacing. */
787
- /* rb_define_attr(cBucket, "key_prefix", 1, 1); */
788
- rb_define_method(cBucket, "key_prefix", cb_bucket_key_prefix_get, 0);
789
- rb_define_method(cBucket, "key_prefix=", cb_bucket_key_prefix_set, 1);
805
+ /* rb_define_attr(cb_cBucket, "key_prefix", 1, 1); */
806
+ rb_define_method(cb_cBucket, "key_prefix", cb_bucket_key_prefix_get, 0);
807
+ rb_define_method(cb_cBucket, "key_prefix=", cb_bucket_key_prefix_set, 1);
790
808
 
791
809
  /* Document-method: on_error
792
810
  * Error callback for asynchronous mode.
@@ -812,9 +830,9 @@ Init_couchbase_ext(void)
812
830
  * ...
813
831
  *
814
832
  * @return [Proc] the effective callback */
815
- /* rb_define_attr(cBucket, "on_error", 1, 1); */
816
- rb_define_method(cBucket, "on_error", cb_bucket_on_error_get, 0);
817
- rb_define_method(cBucket, "on_error=", cb_bucket_on_error_set, 1);
833
+ /* rb_define_attr(cb_cBucket, "on_error", 1, 1); */
834
+ rb_define_method(cb_cBucket, "on_error", cb_bucket_on_error_get, 0);
835
+ rb_define_method(cb_cBucket, "on_error=", cb_bucket_on_error_set, 1);
818
836
 
819
837
  /* Document-method: url
820
838
  *
@@ -828,8 +846,8 @@ Init_couchbase_ext(void)
828
846
  *
829
847
  * @return [String] the address of the cluster management interface
830
848
  */
831
- /* rb_define_attr(cBucket, "url", 1, 0); */
832
- rb_define_method(cBucket, "url", cb_bucket_url_get, 0);
849
+ /* rb_define_attr(cb_cBucket, "url", 1, 0); */
850
+ rb_define_method(cb_cBucket, "url", cb_bucket_url_get, 0);
833
851
  /* Document-method: hostname
834
852
  *
835
853
  * The hostname of the current node
@@ -840,8 +858,8 @@ Init_couchbase_ext(void)
840
858
  *
841
859
  * @return [String] the host name of the management interface (default: "localhost")
842
860
  */
843
- /* rb_define_attr(cBucket, "hostname", 1, 0); */
844
- rb_define_method(cBucket, "hostname", cb_bucket_hostname_get, 0);
861
+ /* rb_define_attr(cb_cBucket, "hostname", 1, 0); */
862
+ rb_define_method(cb_cBucket, "hostname", cb_bucket_hostname_get, 0);
845
863
  /* Document-method: port
846
864
  *
847
865
  * The port of the current node
@@ -852,8 +870,8 @@ Init_couchbase_ext(void)
852
870
  *
853
871
  * @return [Fixnum] the port number of the management interface (default: 8091)
854
872
  */
855
- /* rb_define_attr(cBucket, "port", 1, 0); */
856
- rb_define_method(cBucket, "port", cb_bucket_port_get, 0);
873
+ /* rb_define_attr(cb_cBucket, "port", 1, 0); */
874
+ rb_define_method(cb_cBucket, "port", cb_bucket_port_get, 0);
857
875
  /* Document-method: authority
858
876
  *
859
877
  * The authority ("hostname:port") of the current node
@@ -864,8 +882,8 @@ Init_couchbase_ext(void)
864
882
  *
865
883
  * @return [String] host with port
866
884
  */
867
- /* rb_define_attr(cBucket, "authority", 1, 0); */
868
- rb_define_method(cBucket, "authority", cb_bucket_authority_get, 0);
885
+ /* rb_define_attr(cb_cBucket, "authority", 1, 0); */
886
+ rb_define_method(cb_cBucket, "authority", cb_bucket_authority_get, 0);
869
887
  /* Document-method: bucket
870
888
  *
871
889
  * The bucket name of the current connection
@@ -876,9 +894,9 @@ Init_couchbase_ext(void)
876
894
  *
877
895
  * @return [String] the bucket name
878
896
  */
879
- /* rb_define_attr(cBucket, "bucket", 1, 0); */
880
- rb_define_method(cBucket, "bucket", cb_bucket_bucket_get, 0);
881
- rb_define_alias(cBucket, "name", "bucket");
897
+ /* rb_define_attr(cb_cBucket, "bucket", 1, 0); */
898
+ rb_define_method(cb_cBucket, "bucket", cb_bucket_bucket_get, 0);
899
+ rb_define_alias(cb_cBucket, "name", "bucket");
882
900
  /* Document-method: pool
883
901
  *
884
902
  * The pool name of the current connection
@@ -889,8 +907,8 @@ Init_couchbase_ext(void)
889
907
  *
890
908
  * @return [String] the pool name (usually "default")
891
909
  */
892
- /* rb_define_attr(cBucket, "pool", 1, 0); */
893
- rb_define_method(cBucket, "pool", cb_bucket_pool_get, 0);
910
+ /* rb_define_attr(cb_cBucket, "pool", 1, 0); */
911
+ rb_define_method(cb_cBucket, "pool", cb_bucket_pool_get, 0);
894
912
  /* Document-method: username
895
913
  *
896
914
  * The user name used to connect to the cluster
@@ -902,8 +920,8 @@ Init_couchbase_ext(void)
902
920
  * @return [String] the username for protected buckets (usually matches
903
921
  * the bucket name)
904
922
  */
905
- /* rb_define_attr(cBucket, "username", 1, 0); */
906
- rb_define_method(cBucket, "username", cb_bucket_username_get, 0);
923
+ /* rb_define_attr(cb_cBucket, "username", 1, 0); */
924
+ rb_define_method(cb_cBucket, "username", cb_bucket_username_get, 0);
907
925
  /* Document-method: password
908
926
  *
909
927
  * The password used to connect to the cluster
@@ -912,8 +930,8 @@ Init_couchbase_ext(void)
912
930
  *
913
931
  * @return [String] the password for protected buckets
914
932
  */
915
- /* rb_define_attr(cBucket, "password", 1, 0); */
916
- rb_define_method(cBucket, "password", cb_bucket_password_get, 0);
933
+ /* rb_define_attr(cb_cBucket, "password", 1, 0); */
934
+ rb_define_method(cb_cBucket, "password", cb_bucket_password_get, 0);
917
935
  /* Document-method: environment
918
936
  *
919
937
  * The environment of the connection (+:development+ or +:production+)
@@ -922,8 +940,8 @@ Init_couchbase_ext(void)
922
940
  *
923
941
  * @return [Symbol]
924
942
  */
925
- /* rb_define_attr(cBucket, "environment", 1, 0); */
926
- rb_define_method(cBucket, "environment", cb_bucket_environment_get, 0);
943
+ /* rb_define_attr(cb_cBucket, "environment", 1, 0); */
944
+ rb_define_method(cb_cBucket, "environment", cb_bucket_environment_get, 0);
927
945
  /* Document-method: num_replicas
928
946
  *
929
947
  * @since 1.2.0.dp6
@@ -932,8 +950,8 @@ Init_couchbase_ext(void)
932
950
  *
933
951
  * @return [Fixnum]
934
952
  */
935
- /* rb_define_attr(cBucket, "num_replicas", 1, 0); */
936
- rb_define_method(cBucket, "num_replicas", cb_bucket_num_replicas_get, 0);
953
+ /* rb_define_attr(cb_cBucket, "num_replicas", 1, 0); */
954
+ rb_define_method(cb_cBucket, "num_replicas", cb_bucket_num_replicas_get, 0);
937
955
  /* Document-method: default_observe_timeout
938
956
  *
939
957
  * @since 1.2.0.dp6
@@ -943,116 +961,118 @@ Init_couchbase_ext(void)
943
961
  *
944
962
  * @return [Fixnum]
945
963
  */
946
- /* rb_define_attr(cBucket, "default_observe_timeout", 1, 1); */
947
- rb_define_method(cBucket, "default_observe_timeout", cb_bucket_default_observe_timeout_get, 0);
948
- rb_define_method(cBucket, "default_observe_timeout=", cb_bucket_default_observe_timeout_set, 1);
964
+ /* rb_define_attr(cb_cBucket, "default_observe_timeout", 1, 1); */
965
+ rb_define_method(cb_cBucket, "default_observe_timeout", cb_bucket_default_observe_timeout_get, 0);
966
+ rb_define_method(cb_cBucket, "default_observe_timeout=", cb_bucket_default_observe_timeout_set, 1);
949
967
 
950
- cCouchRequest = rb_define_class_under(cBucket, "CouchRequest", rb_cObject);
951
- rb_define_alloc_func(cCouchRequest, cb_http_request_alloc);
968
+ cb_cCouchRequest = rb_define_class_under(cb_cBucket, "CouchRequest", rb_cObject);
969
+ rb_define_alloc_func(cb_cCouchRequest, cb_http_request_alloc);
952
970
 
953
- rb_define_method(cCouchRequest, "initialize", cb_http_request_init, -1);
954
- rb_define_method(cCouchRequest, "inspect", cb_http_request_inspect, 0);
955
- rb_define_method(cCouchRequest, "on_body", cb_http_request_on_body, 0);
956
- rb_define_method(cCouchRequest, "perform", cb_http_request_perform, 0);
957
- rb_define_method(cCouchRequest, "pause", cb_http_request_pause, 0);
958
- rb_define_method(cCouchRequest, "continue", cb_http_request_continue, 0);
971
+ rb_define_method(cb_cCouchRequest, "initialize", cb_http_request_init, -1);
972
+ rb_define_method(cb_cCouchRequest, "inspect", cb_http_request_inspect, 0);
973
+ rb_define_method(cb_cCouchRequest, "on_body", cb_http_request_on_body, 0);
974
+ rb_define_method(cb_cCouchRequest, "perform", cb_http_request_perform, 0);
975
+ rb_define_method(cb_cCouchRequest, "pause", cb_http_request_pause, 0);
976
+ rb_define_method(cb_cCouchRequest, "continue", cb_http_request_continue, 0);
959
977
 
960
- /* rb_define_attr(cCouchRequest, "path", 1, 0); */
961
- rb_define_method(cCouchRequest, "path", cb_http_request_path_get, 0);
962
- /* rb_define_attr(cCouchRequest, "extended", 1, 0); */
963
- rb_define_method(cCouchRequest, "extended", cb_http_request_extended_get, 0);
964
- rb_define_alias(cCouchRequest, "extended?", "extended");
965
- /* rb_define_attr(cCouchRequest, "chunked", 1, 0); */
966
- rb_define_method(cCouchRequest, "chunked", cb_http_request_chunked_get, 0);
967
- rb_define_alias(cCouchRequest, "chunked?", "chunked");
978
+ /* rb_define_attr(cb_cCouchRequest, "path", 1, 0); */
979
+ rb_define_method(cb_cCouchRequest, "path", cb_http_request_path_get, 0);
980
+ /* rb_define_attr(cb_cCouchRequest, "extended", 1, 0); */
981
+ rb_define_method(cb_cCouchRequest, "extended", cb_http_request_extended_get, 0);
982
+ rb_define_alias(cb_cCouchRequest, "extended?", "extended");
983
+ /* rb_define_attr(cb_cCouchRequest, "chunked", 1, 0); */
984
+ rb_define_method(cb_cCouchRequest, "chunked", cb_http_request_chunked_get, 0);
985
+ rb_define_alias(cb_cCouchRequest, "chunked?", "chunked");
968
986
 
969
- cTimer = rb_define_class_under(mCouchbase, "Timer", rb_cObject);
970
- rb_define_alloc_func(cTimer, cb_timer_alloc);
971
- rb_define_method(cTimer, "initialize", cb_timer_init, -1);
972
- rb_define_method(cTimer, "inspect", cb_timer_inspect, 0);
973
- rb_define_method(cTimer, "cancel", cb_timer_cancel, 0);
987
+ cb_cTimer = rb_define_class_under(cb_mCouchbase, "Timer", rb_cObject);
988
+ rb_define_alloc_func(cb_cTimer, cb_timer_alloc);
989
+ rb_define_method(cb_cTimer, "initialize", cb_timer_init, -1);
990
+ rb_define_method(cb_cTimer, "inspect", cb_timer_inspect, 0);
991
+ rb_define_method(cb_cTimer, "cancel", cb_timer_cancel, 0);
974
992
 
975
- /* Define symbols */
976
- id_arity = rb_intern("arity");
977
- id_call = rb_intern("call");
978
- id_delete = rb_intern("delete");
979
- id_dump = rb_intern("dump");
980
- id_dup = rb_intern("dup");
981
- id_flatten_bang = rb_intern("flatten!");
982
- id_has_key_p = rb_intern("has_key?");
983
- id_host = rb_intern("host");
984
- id_load = rb_intern("load");
985
- id_match = rb_intern("match");
986
- id_observe_and_wait = rb_intern("observe_and_wait");
987
- id_parse = rb_intern("parse");
988
- id_password = rb_intern("password");
989
- id_path = rb_intern("path");
990
- id_port = rb_intern("port");
991
- id_scheme = rb_intern("scheme");
992
- id_sprintf = rb_intern("sprintf");
993
- id_to_s = rb_intern("to_s");
994
- id_user = rb_intern("user");
995
- id_verify_observe_options = rb_intern("verify_observe_options");
993
+ /* Define cb_symbols */
994
+ cb_id_arity = rb_intern("arity");
995
+ cb_id_call = rb_intern("call");
996
+ cb_id_delete = rb_intern("delete");
997
+ cb_id_dump = rb_intern("dump");
998
+ cb_id_dup = rb_intern("dup");
999
+ cb_id_flatten_bang = rb_intern("flatten!");
1000
+ cb_id_has_key_p = rb_intern("has_key?");
1001
+ cb_id_host = rb_intern("host");
1002
+ cb_id_load = rb_intern("load");
1003
+ cb_id_match = rb_intern("match");
1004
+ cb_id_observe_and_wait = rb_intern("observe_and_wait");
1005
+ cb_id_parse = rb_intern("parse");
1006
+ cb_id_parse_body_bang = rb_intern("parse_body!");
1007
+ cb_id_password = rb_intern("password");
1008
+ cb_id_path = rb_intern("path");
1009
+ cb_id_port = rb_intern("port");
1010
+ cb_id_scheme = rb_intern("scheme");
1011
+ cb_id_sprintf = rb_intern("sprintf");
1012
+ cb_id_to_s = rb_intern("to_s");
1013
+ cb_id_user = rb_intern("user");
1014
+ cb_id_verify_observe_options = rb_intern("verify_observe_options");
996
1015
 
997
- sym_add = ID2SYM(rb_intern("add"));
998
- sym_append = ID2SYM(rb_intern("append"));
999
- sym_assemble_hash = ID2SYM(rb_intern("assemble_hash"));
1000
- sym_body = ID2SYM(rb_intern("body"));
1001
- sym_bucket = ID2SYM(rb_intern("bucket"));
1002
- sym_cas = ID2SYM(rb_intern("cas"));
1003
- sym_chunked = ID2SYM(rb_intern("chunked"));
1004
- sym_content_type = ID2SYM(rb_intern("content_type"));
1005
- sym_create = ID2SYM(rb_intern("create"));
1006
- sym_cluster = ID2SYM(rb_intern("cluster"));
1007
- sym_decrement = ID2SYM(rb_intern("decrement"));
1008
- sym_default_flags = ID2SYM(rb_intern("default_flags"));
1009
- sym_default_format = ID2SYM(rb_intern("default_format"));
1010
- sym_default_ttl = ID2SYM(rb_intern("default_ttl"));
1011
- sym_delete = ID2SYM(rb_intern("delete"));
1012
- sym_delta = ID2SYM(rb_intern("delta"));
1013
- sym_development = ID2SYM(rb_intern("development"));
1014
- sym_document = ID2SYM(rb_intern("document"));
1015
- sym_environment = ID2SYM(rb_intern("environment"));
1016
- sym_extended = ID2SYM(rb_intern("extended"));
1017
- sym_flags = ID2SYM(rb_intern("flags"));
1018
- sym_format = ID2SYM(rb_intern("format"));
1019
- sym_found = ID2SYM(rb_intern("found"));
1020
- sym_get = ID2SYM(rb_intern("get"));
1021
- sym_hostname = ID2SYM(rb_intern("hostname"));
1022
- sym_http_request = ID2SYM(rb_intern("http_request"));
1023
- sym_increment = ID2SYM(rb_intern("increment"));
1024
- sym_initial = ID2SYM(rb_intern("initial"));
1025
- sym_key_prefix = ID2SYM(rb_intern("key_prefix"));
1026
- sym_lock = ID2SYM(rb_intern("lock"));
1027
- sym_management = ID2SYM(rb_intern("management"));
1028
- sym_marshal = ID2SYM(rb_intern("marshal"));
1029
- sym_method = ID2SYM(rb_intern("method"));
1030
- sym_node_list = ID2SYM(rb_intern("node_list"));
1031
- sym_not_found = ID2SYM(rb_intern("not_found"));
1032
- sym_num_replicas = ID2SYM(rb_intern("num_replicas"));
1033
- sym_observe = ID2SYM(rb_intern("observe"));
1034
- sym_password = ID2SYM(rb_intern("password"));
1035
- sym_periodic = ID2SYM(rb_intern("periodic"));
1036
- sym_persisted = ID2SYM(rb_intern("persisted"));
1037
- sym_plain = ID2SYM(rb_intern("plain"));
1038
- sym_pool = ID2SYM(rb_intern("pool"));
1039
- sym_port = ID2SYM(rb_intern("port"));
1040
- sym_post = ID2SYM(rb_intern("post"));
1041
- sym_prepend = ID2SYM(rb_intern("prepend"));
1042
- sym_production = ID2SYM(rb_intern("production"));
1043
- sym_put = ID2SYM(rb_intern("put"));
1044
- sym_quiet = ID2SYM(rb_intern("quiet"));
1045
- sym_replace = ID2SYM(rb_intern("replace"));
1046
- sym_replica = ID2SYM(rb_intern("replica"));
1047
- sym_send_threshold = ID2SYM(rb_intern("send_threshold"));
1048
- sym_set = ID2SYM(rb_intern("set"));
1049
- sym_stats = ID2SYM(rb_intern("stats"));
1050
- sym_timeout = ID2SYM(rb_intern("timeout"));
1051
- sym_touch = ID2SYM(rb_intern("touch"));
1052
- sym_ttl = ID2SYM(rb_intern("ttl"));
1053
- sym_type = ID2SYM(rb_intern("type"));
1054
- sym_unlock = ID2SYM(rb_intern("unlock"));
1055
- sym_username = ID2SYM(rb_intern("username"));
1056
- sym_version = ID2SYM(rb_intern("version"));
1057
- sym_view = ID2SYM(rb_intern("view"));
1016
+ cb_sym_add = ID2SYM(rb_intern("add"));
1017
+ cb_sym_append = ID2SYM(rb_intern("append"));
1018
+ cb_sym_assemble_hash = ID2SYM(rb_intern("assemble_hash"));
1019
+ cb_sym_body = ID2SYM(rb_intern("body"));
1020
+ cb_sym_bucket = ID2SYM(rb_intern("bucket"));
1021
+ cb_sym_cas = ID2SYM(rb_intern("cas"));
1022
+ cb_sym_chunked = ID2SYM(rb_intern("chunked"));
1023
+ cb_sym_cluster = ID2SYM(rb_intern("cluster"));
1024
+ cb_sym_content_type = ID2SYM(rb_intern("content_type"));
1025
+ cb_sym_create = ID2SYM(rb_intern("create"));
1026
+ cb_sym_decrement = ID2SYM(rb_intern("decrement"));
1027
+ cb_sym_default_arithmetic_init = ID2SYM(rb_intern("default_arithmetic_init"));
1028
+ cb_sym_default_flags = ID2SYM(rb_intern("default_flags"));
1029
+ cb_sym_default_format = ID2SYM(rb_intern("default_format"));
1030
+ cb_sym_default_ttl = ID2SYM(rb_intern("default_ttl"));
1031
+ cb_sym_delete = ID2SYM(rb_intern("delete"));
1032
+ cb_sym_delta = ID2SYM(rb_intern("delta"));
1033
+ cb_sym_development = ID2SYM(rb_intern("development"));
1034
+ cb_sym_document = ID2SYM(rb_intern("document"));
1035
+ cb_sym_environment = ID2SYM(rb_intern("environment"));
1036
+ cb_sym_extended = ID2SYM(rb_intern("extended"));
1037
+ cb_sym_flags = ID2SYM(rb_intern("flags"));
1038
+ cb_sym_format = ID2SYM(rb_intern("format"));
1039
+ cb_sym_found = ID2SYM(rb_intern("found"));
1040
+ cb_sym_get = ID2SYM(rb_intern("get"));
1041
+ cb_sym_hostname = ID2SYM(rb_intern("hostname"));
1042
+ cb_sym_http_request = ID2SYM(rb_intern("http_request"));
1043
+ cb_sym_increment = ID2SYM(rb_intern("increment"));
1044
+ cb_sym_initial = ID2SYM(rb_intern("initial"));
1045
+ cb_sym_key_prefix = ID2SYM(rb_intern("key_prefix"));
1046
+ cb_sym_lock = ID2SYM(rb_intern("lock"));
1047
+ cb_sym_management = ID2SYM(rb_intern("management"));
1048
+ cb_sym_marshal = ID2SYM(rb_intern("marshal"));
1049
+ cb_sym_method = ID2SYM(rb_intern("method"));
1050
+ cb_sym_node_list = ID2SYM(rb_intern("node_list"));
1051
+ cb_sym_not_found = ID2SYM(rb_intern("not_found"));
1052
+ cb_sym_num_replicas = ID2SYM(rb_intern("num_replicas"));
1053
+ cb_sym_observe = ID2SYM(rb_intern("observe"));
1054
+ cb_sym_password = ID2SYM(rb_intern("password"));
1055
+ cb_sym_periodic = ID2SYM(rb_intern("periodic"));
1056
+ cb_sym_persisted = ID2SYM(rb_intern("persisted"));
1057
+ cb_sym_plain = ID2SYM(rb_intern("plain"));
1058
+ cb_sym_pool = ID2SYM(rb_intern("pool"));
1059
+ cb_sym_port = ID2SYM(rb_intern("port"));
1060
+ cb_sym_post = ID2SYM(rb_intern("post"));
1061
+ cb_sym_prepend = ID2SYM(rb_intern("prepend"));
1062
+ cb_sym_production = ID2SYM(rb_intern("production"));
1063
+ cb_sym_put = ID2SYM(rb_intern("put"));
1064
+ cb_sym_quiet = ID2SYM(rb_intern("quiet"));
1065
+ cb_sym_replace = ID2SYM(rb_intern("replace"));
1066
+ cb_sym_replica = ID2SYM(rb_intern("replica"));
1067
+ cb_sym_send_threshold = ID2SYM(rb_intern("send_threshold"));
1068
+ cb_sym_set = ID2SYM(rb_intern("set"));
1069
+ cb_sym_stats = ID2SYM(rb_intern("stats"));
1070
+ cb_sym_timeout = ID2SYM(rb_intern("timeout"));
1071
+ cb_sym_touch = ID2SYM(rb_intern("touch"));
1072
+ cb_sym_ttl = ID2SYM(rb_intern("ttl"));
1073
+ cb_sym_type = ID2SYM(rb_intern("type"));
1074
+ cb_sym_unlock = ID2SYM(rb_intern("unlock"));
1075
+ cb_sym_username = ID2SYM(rb_intern("username"));
1076
+ cb_sym_version = ID2SYM(rb_intern("version"));
1077
+ cb_sym_view = ID2SYM(rb_intern("view"));
1058
1078
  }