forked from nemequ/vala-extra-vapis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libmemcached.vapi
556 lines (501 loc) · 24.5 KB
/
libmemcached.vapi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
/* libmemcached Vala Bindings
* Copyright 2012 Evan Nemerson <[email protected]>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
[CCode (cheader_filename = "libmemcached/memcached.h")]
namespace Memcached {
// defaults.h
public const in_port_t DEFAULT_PORT;
public const string DEFAULT_PORT_STRING;
public const uint POINTS_PER_SERVER;
public const uint POINTS_PER_SERVER_KETAMA;
public const uint CONTINUUM_SIZE;
public const uint STRIDE;
public const uint DEFAULT_TIMEOUT;
public const uint DEFAULT_CONNECT_TIMEOUT;
public const uint CONTINUUM_ADDITION;
public const uint EXPIRATION_NOT_ADD;
public const uint SERVER_FAILURE_LIMIT;
public const uint SERVER_FAILURE_RETRY_TIMEOUT;
public const uint SERVER_FAILURE_DEAD_TIMEOUT;
public const uint SERVER_TIMEOUT_LIMIT;
// limits.h
public const uint MAXIMUM_INTEGER_DISPLAY_LENGTH;
public const uint MAX_BUFFER;
public const uint MAX_HOST_SORT_LENGTH;
public const uint MAX_KEY;
public const uint PREFIX_KEY_MAX_SIZE;
public const size_t VERSION_STRING_LENGTH;
public const string CALLBACK_PREFIX_KEY;
// alloc.h
public delegate void FreeFunc (Memcached.Context ptr, void* mem);
public delegate void* MallocFunc (Memcached.Context ptr, size_t size);
public delegate void* ReallocFunc (Memcached.Context ptr, void* mem, size_t size);
public delegate void* CallocFunc (Memcached.Context ptr, size_t nelem, size_t elsize);
// callbacks.h
[CCode (cname = "memcached_execute_fn")]
public delegate Memcached.ReturnCode ExecuteCallback (Memcached.Context ptr, Memcached.Result result);
[CCode (cname = "memcached_server_fn")]
public delegate Memcached.ReturnCode ServerCallback (Memcached.Context ptr, Memcached.Instance server);
[CCode (cname = "memcached_stat_fn")]
public delegate Memcached.ReturnCode StatCallback (Memcached.Instance server, [CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value);
// triggers.h
[CCode (cname = "memcached_clone_fn", has_target = false)]
public delegate Memcached.ReturnCode CloneFunc (Memcached.Context destination, Memcached.Context source);
[CCode (cname = "memcached_cleanup_fn", has_target = false)]
public delegate Memcached.ReturnCode CleanupFunc (Memcached.Context ptr);
[CCode (cname = "memcached_trigger_key_fn", has_target = false)]
public delegate Memcached.ReturnCode KeyTrigger (Memcached.Context ptr, [CCode (array_length_type = "size_t")] uint8[] key, Memcached.Result result);
[CCode (cname = "memcached_trigger_delete_key_fn", has_target = false)]
public delegate Memcached.ReturnCode DeleteKeyTrigger (Memcached.Context ptr, [CCode (array_length_type = "size_t")] uint8[] key);
[CCode (cname = "memcached_dump_fn")]
public delegate Memcached.ReturnCode DumpCallback (Memcached.Context ptr, [CCode (array_length_type = "size_t")] uint8[] key);
[SimpleType]
[IntegerType (rank = 6), CCode (cname = "in_port_t")]
public struct in_port_t {}
[SimpleType]
[IntegerType (rank = 11), CCode (cname = "unsigned long long")]
public struct ulonglong {}
// options.h
[CCode (cname = "libmemcached_check_configuration")]
public Memcached.ReturnCode check_configuration ([CCode (array_length_type = "size_t")] uint8[] option_string, [CCode (array_length_type = "size_t")] uint8[] error_buffer);
// version.h
public string lib_version ();
[Compact, CCode (cname = "memcached_st", has_type_id = false, lower_case_cprefix = "memcached_")]
public class Context {
// memcached.h
public void servers_reset ();
[CCode (cname = "memcached_create")]
public Context (Memcached.Context? ptr = null);
[CCode (cname = "memcached")]
public Context.from_configuration ([CCode (array_length_type = "size_t")] uint8[]? str = null);
public Memcached.ReturnCode reset ();
public void reset_last_disconnected_server ();
[CCode (instance_pos = 2)]
public Memcached.Context clone (Memcached.Context? destination = null);
public void set_user_data<T> (T data);
public T get_user_data<T> ();
public Memcached.ReturnCode push (Memcached.Context source);
public unowned Memcached.Instance server_instance_by_position (uint32 server_key);
public uint32 server_count ();
public uint64 query_id ();
// allocators.h
public Memcached.ReturnCode set_memory_allocator (MallocFunc mem_malloc, FreeFunc mem_free, ReallocFunc mem_realloc, CallocFunc mem_calloc);
public void get_memory_allocator (out MallocFunc mem_malloc, out FreeFunc mem_free, out ReallocFunc mem_realloc, out CallocFunc mem_calloc);
public void* get_memory_allocator_context ();
// analyze.h
public Memcached.Analysis? analyze (Memcached.Stat memc_stat, out Memcached.ReturnCode error);
// auto.h
public Memcached.ReturnCode increment ([CCode (array_length_type = "size_t")] uint8[] key, uint32 offset, out uint64 value);
public Memcached.ReturnCode decrement ([CCode (array_length_type = "size_t")] uint8[] key, uint32 offset, out uint64 value);
public Memcached.ReturnCode increment_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, uint32 offset, out uint64 value);
public Memcached.ReturnCode decrement_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, uint32 offset, out uint64 value);
public Memcached.ReturnCode increment_with_initial ([CCode (array_length_type = "size_t")] uint8[] key, uint64 offset, uint64 initial, time_t expiration, out uint64 value);
public Memcached.ReturnCode decrement_with_initial ([CCode (array_length_type = "size_t")] uint8[] key, uint64 offset, uint64 initial, time_t expiration, out uint64 value);
public Memcached.ReturnCode increment_with_initial_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, uint64 offset, uint64 initial, time_t expiration, out uint64 value);
public Memcached.ReturnCode decrement_with_initial_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, uint64 offset, uint64 initial, time_t expiration, out uint64 value);
// behavior.h
public Memcached.ReturnCode behavior_set (Memcached.Behavior flag, uint64 data);
public uint64 behavior_get (Memcached.Behavior flag);
public Memcached.ReturnCode behavior_set_distribution (Memcached.ServerDistribution type);
public Memcached.ServerDistribution behavior_get_distribution ();
public Memcached.ReturnCode set_key_hash (Memcached.Hash type);
public Memcached.Hash get_key_hash ();
public Memcached.ReturnCode set_distribution_hash (Memcached.Hash type);
public Memcached.Hash get_distribution_hash ();
public Memcached.ReturnCode bucket_set ([CCode (array_length = false)] uint32[] host_map, [CCode (array_length = false)] uint32[] forward_map, uint32 buckets, uint32 replicas);
// callback.h
public Memcached.ReturnCode callback_set (Memcached.Callback flag, void* data);
public void* callback_get (Memcached.Callback flag, out Memcached.ReturnCode error);
// delete.h
public Memcached.ReturnCode @delete ([CCode (array_length_type = "size_t")] uint8[] key, time_t expiration);
public Memcached.ReturnCode delete_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, time_t expiration);
// dump.h
[CCode (cname = "memcached_dump")]
private Memcached.ReturnCode _dump (Memcached.DumpCallback function, uint32 number_of_callbacks);
[CCode (cname = "memcached_dump_wrapper")]
public Memcached.ReturnCode dump (Memcached.DumpCallback function) {
var _function = &function;
return this._dump ((Memcached.DumpCallback) _function, 1);
}
// encoding_key.h
public Memcached.ReturnCode set_encoding_key ([CCode (array_length_type = "size_t")] uint8[] str);
// error.h
public unowned string error ();
public unowned string last_error_message ();
public void error_print ();
public Memcached.ReturnCode last_error ();
public int last_error_errno ();
// exist.h
public Memcached.ReturnCode exist ([CCode (array_length_type = "size_t")] uint8[] key);
public Memcached.ReturnCode exist_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key);
// fetch.h
[CCode (cname = "memcached_fetch_execute")]
private Memcached.ReturnCode _fetch_execute (Memcached.ExecuteCallback callback, uint32 number_of_callbacks);
[CCode (cname = "memcached_fetch_execute_wrapper")]
public Memcached.ReturnCode fetch_execute (Memcached.ExecuteCallback callback) {
var _callback = &callback;
return this._fetch_execute ((Memcached.ExecuteCallback) _callback, 1);
}
// flush_buffers.h
public Memcached.ReturnCode flush_buffers ();
// flush.h
public Memcached.ReturnCode flush (time_t expiration);
// get.h
[CCode (array_length_pos = 1.5, array_length_type = "size_t")]
public uint8[]? @get ([CCode (array_length_type = "size_t")] uint8[] key, out uint32 flags, out Memcached.ReturnCode error);
public Memcached.ReturnCode mget ([CCode (array_length_type = "size_t", array_length_pos = 2.5)] uint8*[] keys, [CCode (array_length = false)] size_t[] keys_length);
[CCode (array_length_pos = 2.5, array_length_type = "size_t")]
public uint8[]? get_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, out uint32 flags, out Memcached.ReturnCode error);
public Memcached.ReturnCode mget_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t", array_length_pos = 3.5)] uint8*[] keys, [CCode (array_length = false)] size_t[] keys_length);
[Deprecated (since = "0.50", replacement = "fetch_result"), CCode (array_length_pos = 1.5, array_length_type = "size_t")]
public uint8[]? fetch ([CCode (array_length_type = "size_t")] uint8[] key, out uint32 flags, out Memcached.ReturnCode error);
public Memcached.Result? fetch_result (Memcached.Result? result, out Memcached.ReturnCode error);
[CCode (cname = "memcached_mget_execute")]
private Memcached.ReturnCode _mget_execute ([CCode (array_length_type = "size_t", array_length_pos = 2.5)] uint8*[] keys, [CCode (array_length = false)] size_t[] keys_length, Memcached.ExecuteCallback function, uint32 number_of_callbacks = 1);
[CCode (cname = "memcached_mget_execute_wrapper")]
public Memcached.ReturnCode mget_execute (uint8*[] keys, size_t[] keys_length, Memcached.ExecuteCallback function) {
var _function = &function;
return this._mget_execute (keys, keys_length, (Memcached.ExecuteCallback) _function, 1);
}
[CCode (cname = "memcached_mget_execute_by_key")]
public Memcached.ReturnCode _mget_execute_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t", array_length_pos = 3.5)] uint8*[] keys, [CCode (array_length = false)] size_t[] keys_length, Memcached.ExecuteCallback function, uint32 number_of_callbacks = 1);
[CCode (cname = "memcached_mget_execute_by_key_wrapper")]
public Memcached.ReturnCode mget_execute_by_key (uint8[] group_key, uint8*[] keys, size_t[] keys_length, Memcached.ExecuteCallback function) {
var _function = &function;
return this._mget_execute_by_key (group_key, keys, keys_length, (Memcached.ExecuteCallback) _function, 1);
}
// hash.h
public uint32 generate_hash_value ([CCode (array_length_type = "size_t")] uint8[] key, Memcached.Hash hash_algorithm);
public uint32 generate_hash ([CCode (array_length_type = "size_t")] uint8[] key);
public void autoeject ();
// result.h
public Memcached.Result result_create (Memcached.Result? result = null);
// sasl.h
public Memcached.ReturnCode set_sasl_auth_data (string username, string password);
public Memcached.ReturnCode destroy_sasl_auth_data ();
// server.h
[CCode (cname = "memcached_server_cursor")]
private Memcached.ReturnCode _server_cursor (Memcached.ServerCallback function, uint32 number_of_callbacks);
[CCode (cname = "memcached_server_cursor_wrapper")]
public Memcached.ReturnCode server_cursor (Memcached.ServerCallback function) {
var _function = &function;
return this._server_cursor ((Memcached.ServerCallback) _function, 1);
}
public unowned Memcached.Instance? server_by_key ([CCode (array_length_type = "size_t")] uint8[] key, out Memcached.ReturnCode error);
public unowned Memcached.Instance? server_get_last_disconnect ();
public Memcached.ReturnCode server_add_udp (string hostname, in_port_t port = Memcached.DEFAULT_PORT);
public Memcached.ReturnCode server_add_unix_socket (string filename);
public Memcached.ReturnCode server_add (string hostname, in_port_t port = Memcached.DEFAULT_PORT);
public Memcached.ReturnCode server_add_udp_with_weight (string hostname, in_port_t port, uint32 weight);
public Memcached.ReturnCode server_add_unix_socket_with_weight (string filename, uint32 weight);
public Memcached.ReturnCode server_add_with_weight (string hostname, in_port_t port, uint32 weight);
// server_list.h
public Memcached.ReturnCode server_push (Memcached.ServerList list);
// stat.h
public void stat_free (Memcached.Stat memc_stat);
public Memcached.Stat? stat (string args, out Memcached.ReturnCode error);
public string stat_get_value (Memcached.Stat memc_stat, string key, out Memcached.ReturnCode error);
[CCode (array_null_terminated = true)]
public string[] stat_get_keys (Memcached.Stat memc_stat, out Memcached.ReturnCode error);
public Memcached.ReturnCode stat_execute (string args, Memcached.StatCallback func);
// storage.h
public Memcached.ReturnCode @set ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode add ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode replace ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode append ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode prepend ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode cas ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags, uint64 cas);
public Memcached.ReturnCode set_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode add_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode prepend_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode append_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags);
public Memcached.ReturnCode cas_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] value, time_t expiration, uint32 flags, uint64 cas);
// strerror.h
public unowned string strerror (Memcached.ReturnCode rc);
// touch.h
public Memcached.ReturnCode touch ([CCode (array_length_type = "size_t")] uint8[] key, time_t expiration);
public Memcached.ReturnCode touch_by_key ([CCode (array_length_type = "size_t")] uint8[] group_key, [CCode (array_length_type = "size_t")] uint8[] key, time_t expiration);
// quit.h
public void quit ();
// verbosity.h
public Memcached.ReturnCode verbosity (uint32 verbosity);
// version.h
public Memcached.ReturnCode version ();
public unowned Memcached.Context iterator () {
return this;
}
public Memcached.Result? next_value () {
Memcached.ReturnCode error;
return this.fetch_result (null, out error);
}
}
// type/analysis.h
[CCode (cname = "memcached_analysis_st", has_copy_function = false, free_function = "memcached_analyze_free")]
public struct Analysis {
public unowned Memcached.Context root;
public uint32 average_item_size;
public uint32 longest_uptime;
public uint32 least_free_server;
public uint32 most_consumed_server;
public uint32 oldest_server;
public double pool_hit_ratio;
public uint64 most_used_bytes;
public uint64 least_remaining_bytes;
}
// result.h
[Compact, CCode (cname = "memcached_result_st")]
public class Result {
public void reset ();
[CCode (cname = "memcached_result_key_value", array_length = false)]
private unowned uint8[] _key_value ();
private size_t key_length ();
[CCode (cname = "memcached_result_key_value_wrapper")]
public unowned uint8[] key_value () {
unowned uint8[] key = this._key_value ();
key.length = (int) this.key_length ();
return key;
}
[CCode (cname = "memcached_result_value", array_length = false)]
private unowned uint8[] _value ();
[CCode (cname = "memcached_result_take_value", array_length = false)]
private uint8[] _take_value ();
private size_t length ();
[CCode (cname = "memcached_result_value_wrapper")]
public unowned uint8[] value () {
unowned uint8[] val = this._value ();
val.length = (int) this.length ();
return val;
}
[CCode (cname = "memcached_result_take_value_wrapper")]
public uint8[] take_value () {
var val = this._take_value ();
val.length = (int) this.length ();
return val;
}
public uint32 flags ();
public uint64 cas ();
public Memcached.ReturnCode set_value (uint8[] value);
public void set_flags (uint32 flags);
public void set_expiration (time_t expiration);
}
// types/behavior.h
[CCode (cname = "memcached_behavior_t")]
public enum Behavior {
NO_BLOCK,
TCP_NODELAY,
HASH,
KETAMA,
SOCKET_SEND_SIZE,
SOCKET_RECV_SIZE,
CACHE_LOOKUPS,
SUPPORT_CAS,
POLL_TIMEOUT,
DISTRIBUTION,
BUFFER_REQUESTS,
USER_DATA,
SORT_HOSTS,
VERIFY_KEY,
CONNECT_TIMEOUT,
RETRY_TIMEOUT,
KETAMA_WEIGHTED,
KETAMA_HASH,
BINARY_PROTOCOL,
SND_TIMEOUT,
RCV_TIMEOUT,
SERVER_FAILURE_LIMIT,
IO_MSG_WATERMARK,
IO_BYTES_WATERMARK,
IO_KEY_PREFETCH,
HASH_WITH_PREFIX_KEY,
NOREPLY,
USE_UDP,
AUTO_EJECT_HOSTS,
NUMBER_OF_REPLICAS,
RANDOMIZE_REPLICA_READ,
CORK,
TCP_KEEPALIVE,
TCP_KEEPIDLE,
LOAD_FROM_FILE,
REMOVE_FAILED_SERVERS,
DEAD_TIMEOUT,
SERVER_TIMEOUT_LIMIT,
MAX;
// behavior.h
[CCode (cname = "libmemcached_string_behavior")]
public string to_string ();
}
// types/callback.h
[CCode (cname = "memcached_callback_t")]
public enum Callback {
PREFIX_KEY = 0,
USER_DATA = 1,
CLEANUP_FUNCTION = 2,
CLONE_FUNCTION = 3,
GET_FAILURE = 7,
DELETE_TRIGGER = 8,
MAX,
NAMESPACE = Memcached.CALLBACK_PREFIX_KEY
}
// types/hash.h
[CCode (cname = "memcached_hash_t")]
public enum Hash {
DEFAULT,
MD5,
CRC,
FNV1_64,
FNV1A_64,
FNV1_32,
FNV1A_32,
HSIES,
MURMUR,
JENKINS,
MURMUR3,
CUSTOM,
MAX
}
// return.h
[CCode (cname = "memcached_return_t", cprefix = "MEMCACHED_", lower_case_cprefix = "memcached_")]
public enum ReturnCode {
SUCCESS,
FAILURE,
HOST_LOOKUP_FAILURE,
CONNECTION_FAILURE,
WRITE_FAILURE,
READ_FAILURE,
UNKNOWN_READ_FAILURE,
PROTOCOL_ERROR,
CLIENT_ERROR,
SERVER_ERROR,
DATA_EXISTS,
DATA_DOES_NOT_EXIST,
NOTSTORED,
STORED,
NOTFOUND,
MEMORY_ALLOCATION_FAILURE,
PARTIAL_READ,
SOME_ERRORS,
NO_SERVERS,
END,
DELETED,
VALUE,
STAT,
ITEM,
ERRNO,
NOT_SUPPORTED,
FETCH_NOTFINISHED,
TIMEOUT,
BUFFERED,
BAD_KEY_PROVIDED,
INVALID_HOST_PROTOCOL,
SERVER_MARKED_DEAD,
UNKNOWN_STAT_KEY,
E2BIG,
INVALID_ARGUMENTS,
KEY_TOO_BIG,
AUTH_PROBLEM,
AUTH_FAILURE,
AUTH_CONTINUE,
PARSE_ERROR,
PARSE_USER_ERROR,
DEPRECATED,
IN_PROGRESS,
SERVER_TEMPORARILY_DISABLED,
SERVER_MEMORY_ALLOCATION_FAILURE,
MAXIMUM_RETURN;
public bool success ();
public bool failed ();
public bool fatal ();
}
// types/server_distribution.h
[CCode (cname = "memcached_server_distribution_t", cprefix = "MEMCACHED_DISTRIBUTION_")]
public enum ServerDistribution {
MODULA,
CONSISTENT,
CONSISTENT_KETAMA,
RANDOM,
CONSISTENT_KETAMA_SPY,
CONSISTENT_WEIGHTED,
VIRTUAL_BUCKET,
CONSISTENT_MAX;
// behavior.h
[CCode (cname = "libmemcached_string_distribution")]
public string to_string ();
}
// parse.h
[Deprecated (since = "0.39", replacement = "Context.from_configuration")]
public Memcached.ServerList servers_parse (string server_strings);
// server.h
[Compact, CCode (cname = "memcached_instance_st", has_type_id = false, lower_case_cprefix = "memcached_server_")]
public class Instance {
public uint32 response_count ();
public unowned string name ();
public in_port_t port ();
public in_port_t srcport ();
public void next_retry (time_t absolute_time);
public unowned string type ();
public uint8 major_version ();
public uint8 minor_version ();
public uint8 micro_version ();
// error.h
public unowned string error ();
public Memcached.ReturnCode error_return ();
}
[CCode (cname = "memcached_server_list_st", has_type_id = false)]
[SimpleType]
public struct ServerList {
public Memcached.ServerList append (string hostname, in_port_t port, out Memcached.ReturnCode error);
public Memcached.ServerList append_with_weight (string hostname, in_port_t port, uint32 weight, out Memcached.ReturnCode error);
public uint32 count ();
}
// stat.h
[CCode (cname = "memcached_stat_st", has_copy_function = false)]
public struct Stat {
ulong connection_structures;
ulong curr_connections;
ulong curr_items;
Posix.pid_t pid;
ulong pointer_size;
ulong rusage_system_microseconds;
ulong rusage_system_seconds;
ulong rusage_user_microseconds;
ulong rusage_user_seconds;
ulong threads;
ulong time;
ulong total_connections;
ulong total_items;
ulong uptime;
ulonglong bytes;
ulonglong bytes_read;
ulonglong bytes_written;
ulonglong cmd_get;
ulonglong cmd_set;
ulonglong evictions;
ulonglong get_hits;
ulonglong get_misses;
ulonglong limit_maxbytes;
uint8 version[Memcached.VERSION_STRING_LENGTH];
void* __future;
unowned Memcached.Context root;
public Memcached.ReturnCode servername (string args, string hostname, in_port_t port);
}
}