Couchbase C Client  2.5.6
couchbase.h
Go to the documentation of this file.
1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  * Copyright 2010-2012 Couchbase, Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef LIBCOUCHBASE_COUCHBASE_H
19 #define LIBCOUCHBASE_COUCHBASE_H 1
20 
26 #define LCB_CONFIG_MCD_PORT 11210
27 #define LCB_CONFIG_MCD_SSL_PORT 11207
28 #define LCB_CONFIG_HTTP_PORT 8091
29 #define LCB_CONFIG_HTTP_SSL_PORT 18091
30 #define LCB_CONFIG_MCCOMPAT_PORT 11211
31 
32 struct lcb_st;
33 
41 typedef struct lcb_st *lcb_t;
42 struct lcb_http_request_st;
43 typedef struct lcb_http_request_st *lcb_http_request_t;
44 
45 #include <stddef.h>
46 #include <time.h>
47 #include <stdarg.h>
48 #include <stdio.h>
49 #include <libcouchbase/sysdefs.h>
50 #include <libcouchbase/assert.h>
51 #include <libcouchbase/visibility.h>
52 #include <libcouchbase/error.h>
53 #include <libcouchbase/iops.h>
54 #include <libcouchbase/http.h>
55 #include <libcouchbase/configuration.h>
56 #include <libcouchbase/kvbuf.h>
57 #include <libcouchbase/_cxxwrap.h>
58 
59 #ifdef __cplusplus
60 extern "C"{
61 #endif
62 
63 typedef lcb_U8 lcb_datatype_t;
64 typedef lcb_U32 lcb_USECS;
65 
66 
67 /******************************************************************************
68  ******************************************************************************
69  ******************************************************************************
70  ** INITIALIZATION **
71  ******************************************************************************
72  ******************************************************************************
73  ******************************************************************************/
74 
232 typedef enum {
235 } lcb_type_t;
236 
237 #ifndef __LCB_DOXYGEN__
238 /* These are definitions for some of the older fields of the `lcb_create_st`
239  * structure. They are here for backwards compatibility and should not be
240  * used by new code */
241 typedef enum { LCB_CONFIG_TRANSPORT_LIST_END = 0, LCB_CONFIG_TRANSPORT_HTTP = 1, LCB_CONFIG_TRANSPORT_CCCP, LCB_CONFIG_TRANSPORT_MAX } lcb_config_transport_t;
242 #define LCB_CREATE_V0_FIELDS const char *host; const char *user; const char *passwd; const char *bucket; struct lcb_io_opt_st *io;
243 #define LCB_CREATE_V1_FIELDS LCB_CREATE_V0_FIELDS lcb_type_t type;
244 #define LCB_CREATE_V2_FIELDS LCB_CREATE_V1_FIELDS const char *mchosts; const lcb_config_transport_t* transports;
245 struct lcb_create_st0 { LCB_CREATE_V0_FIELDS };
246 struct lcb_create_st1 { LCB_CREATE_V1_FIELDS };
247 struct lcb_create_st2 { LCB_CREATE_V2_FIELDS };
248 #endif
249 
254  const char *connstr;
255  const char *username;
256  const char *passwd;
257  void *_pad_bucket;
258  struct lcb_io_opt_st *io;
259  lcb_type_t type;
260 };
261 
266  int version;
267 
270  union lcb_CRST_u {
271  struct lcb_create_st0 v0;
272  struct lcb_create_st1 v1;
273  struct lcb_create_st2 v2;
275  } v;
276  LCB_DEPR_CTORS_CRST
277 };
278 
322 LIBCOUCHBASE_API
323 lcb_error_t lcb_create(lcb_t *instance, const struct lcb_create_st *options);
324 
347 LIBCOUCHBASE_API
348 lcb_error_t lcb_connect(lcb_t instance);
349 
359 typedef void (*lcb_bootstrap_callback)(lcb_t instance, lcb_error_t err);
360 
371 LIBCOUCHBASE_API
374 
387 LIBCOUCHBASE_API
427 #define LCB_CMD_BASE \
428  \
431  lcb_U32 cmdflags; \
432  \
433  \
441  lcb_U32 exptime; \
442  \
443  \
448  lcb_U64 cas; \
449  \
450  \
451  lcb_KEYBUF key; \
452  \
453  \
454  lcb_KEYBUF _hashkey
455 
458 typedef struct lcb_CMDBASE {
459  LCB_CMD_BASE;
460 } lcb_CMDBASE;
461 
468 #define LCB_CMD_F_INTERNAL_CALLBACK (1 << 0)
469 
486 #define LCB_CMD_SET_KEY(cmd, keybuf, keylen) \
487  LCB_KREQ_SIMPLE(&(cmd)->key, keybuf, keylen)
488 
500 #define LCB_CMD__SETVBID(cmd, vbid) do { \
501  (cmd)->_hashkey.type = LCB_KV_VBID; \
502  (cmd)->_hashkey.contig.nbytes = vbid; \
503 } while (0);
504 
539 #define LCB_RESP_BASE \
540  \
544  void *cookie; \
545  const void *key; \
546  lcb_SIZE nkey; \
547  lcb_CAS cas; \
548  lcb_error_t rc; \
549  lcb_U16 version; \
550  lcb_U16 rflags;
558 typedef struct {
560 } lcb_RESPBASE;
561 
562 
563 #define LCB_RESP_SERVER_FIELDS \
564  \
565  const char *server;
566 
571 typedef struct {
573  LCB_RESP_SERVER_FIELDS
575 
577 typedef struct lcb_MUTATION_TOKEN {
578  lcb_U64 uuid_;
579  lcb_U64 seqno_;
580  lcb_U16 vbid_;
582 
588 typedef enum {
591 
598 
601 
605 
609 } lcb_RESPFLAGS;
610 
624 typedef enum {
642  LCB_CALLBACK_STOREDUR,
644  LCB_CALLBACK_SDMUTATE,
645  LCB_CALLBACK__MAX /* Number of callbacks */
647 
648 /* The following callback types cannot be set using lcb_install_callback3(),
649  * however, their value is passed along as the second argument of their
650  * respective callbacks. This allows you to still use the same callback,
651  * differentiating their meaning by the type. */
652 
654 #define LCB_CALLBACK_VIEWQUERY -1
655 
657 #define LCB_CALLBACK_N1QL -2
658 
669 typedef void (*lcb_RESPCALLBACK)
670  (lcb_t instance, int cbtype, const lcb_RESPBASE* resp);
671 
693 LIBCOUCHBASE_API
695 lcb_install_callback3(lcb_t instance, int cbtype, lcb_RESPCALLBACK cb);
696 
709 LIBCOUCHBASE_API
711 lcb_get_callback3(lcb_t instance, int cbtype);
712 
721 LIBCOUCHBASE_API
722 const char *
723 lcb_strcbtype(int cbtype);
724 
739 #define LCB_CMDGET_F_CLEAREXP (1<<16)
740 
765 typedef struct {
766  LCB_CMD_BASE;
773  int lock;
774 } lcb_CMDGET;
775 
777 typedef struct {
779  const void *value;
780  lcb_SIZE nvalue;
781  void* bufh;
782  lcb_datatype_t datatype;
783  lcb_U32 itmflags;
784 } lcb_RESPGET;
785 
826 LIBCOUCHBASE_API
828 lcb_get3(lcb_t instance, const void *cookie, const lcb_CMDGET *cmd);
843 typedef enum {
847 
850 
854 } lcb_replica_t;
855 
867 typedef struct {
868  LCB_CMD_BASE;
891 
897  int index;
899 
947 LIBCOUCHBASE_API
949 lcb_rget3(lcb_t instance, const void *cookie, const lcb_CMDGETREPLICA *cmd);
966 typedef enum {
971  LCB_ADD = 0x01,
972 
977  LCB_REPLACE = 0x02,
978 
980  LCB_SET = 0x03,
981 
1008  LCB_APPEND = 0x04,
1009 
1014 } lcb_storage_t;
1015 
1026 typedef struct {
1027  LCB_CMD_BASE;
1028 
1034 
1040  lcb_U32 flags;
1041 
1043  lcb_datatype_t datatype;
1044 
1050 } lcb_CMDSTORE;
1051 
1055 typedef struct {
1057 
1060 } lcb_RESPSTORE;
1061 
1075 #define LCB_CMD_SET_VALUE(scmd, valbuf, vallen) do { \
1076  (scmd)->value.vtype = LCB_KV_COPY; \
1077  (scmd)->value.u_buf.contig.bytes = valbuf; \
1078  (scmd)->value.u_buf.contig.nbytes = vallen; \
1079 } while (0);
1080 
1097 #define LCB_CMD_SET_VALUEIOV(scmd, iovs, niovs) do { \
1098  (scmd)->value.vtype = LCB_KV_IOVCOPY; \
1099  (scmd)->value.u_buf.multi.iov = iovs; \
1100  (scmd)->value.u_buf.multi.niov = niovs; \
1101 } while (0);
1102 
1153 LIBCOUCHBASE_API
1155 lcb_store3(lcb_t instance, const void *cookie, const lcb_CMDSTORE *cmd);
1176 
1188 
1225 LIBCOUCHBASE_API
1227 lcb_remove3(lcb_t instance, const void *cookie, const lcb_CMDREMOVE * cmd);
1266 typedef struct lcb_MULTICMD_CTX_st {
1273  lcb_error_t (*addcmd)(struct lcb_MULTICMD_CTX_st *ctx, const lcb_CMDBASE *cmd);
1274 
1284  lcb_error_t (*done)(struct lcb_MULTICMD_CTX_st *ctx, const void *cookie);
1285 
1293  void (*fail)(struct lcb_MULTICMD_CTX_st *ctx);
1313 typedef enum {
1320 
1334 
1343 } lcb_DURMODE;
1344 
1346 typedef struct {
1355  lcb_U32 timeout;
1356 
1365  lcb_U32 interval;
1366 
1380  lcb_U16 persist_to;
1381 
1395  lcb_U16 replicate_to;
1396 
1403 
1408  lcb_U8 cap_max;
1409 
1414  lcb_U8 pollopts;
1416 
1419 typedef struct lcb_durability_opts_st {
1420  int version;
1421  union {
1423  } v;
1425 
1428 #define LCB_CMDENDURE_F_MUTATION_TOKEN 1<<16
1429 
1437 typedef struct {
1438  LCB_CMD_BASE;
1439  const lcb_MUTATION_TOKEN *mutation_token;
1440 } lcb_CMDENDURE;
1441 
1443 typedef struct {
1449  lcb_U16 nresponses;
1450 
1456 
1462 
1467  lcb_U8 npersisted;
1468 
1473  lcb_U8 nreplicated;
1474 } lcb_RESPENDURE;
1475 
1596 LIBCOUCHBASE_API
1598 lcb_endure3_ctxnew(lcb_t instance,
1599  const lcb_durability_opts_t *options, lcb_error_t *err);
1600 
1605 typedef struct {
1606  LCB_CMD_BASE;
1608  lcb_U32 flags;
1609  lcb_datatype_t datatype;
1618 
1625 } lcb_CMDSTOREDUR;
1626 
1630 typedef struct {
1634 
1641 
1650 LIBCOUCHBASE_API
1652 lcb_storedur3(lcb_t instance, const void *cookie, const lcb_CMDSTOREDUR *cmd);
1653 
1654 #define LCB_DURABILITY_VALIDATE_CAPMAX 1<<1
1655 
1683 LIBCOUCHBASE_API
1686  lcb_U16 *persist_to, lcb_U16 *replicate_to, int options);
1697 #define LCB_CMDOBSERVE_F_MASTER_ONLY 1<<16
1698 
1703 typedef struct {
1704  LCB_CMD_BASE;
1707  const lcb_U16* servers_;
1708  size_t nservers_;
1709 } lcb_CMDOBSERVE;
1710 
1714 typedef enum {
1723 
1724  LCB_OBSERVE_MAX = 0x82
1725 } lcb_observe_t;
1726 
1732 typedef struct {
1734  lcb_U8 status;
1735  lcb_U8 ismaster;
1736  lcb_U32 ttp;
1737  lcb_U32 ttr;
1738 } lcb_RESPOBSERVE;
1739 
1774 LIBCOUCHBASE_API
1776 lcb_observe3_ctxnew(lcb_t instance);
1777 
1782 typedef struct {
1783  LCB_CMD_BASE;
1788  lcb_U16 server_index;
1789  lcb_U16 vbid;
1790  lcb_U64 uuid;
1791 } lcb_CMDOBSEQNO;
1792 
1799 typedef struct {
1801  lcb_U16 vbid;
1802  lcb_U16 server_index;
1803  lcb_U64 cur_uuid;
1805  lcb_U64 mem_seqno;
1811  lcb_U64 old_uuid;
1812 
1817  lcb_U64 old_seqno;
1818 } lcb_RESPOBSEQNO;
1819 
1827 LIBCOUCHBASE_API
1829 lcb_observe_seqno3(lcb_t instance, const void *cookie, const lcb_CMDOBSEQNO *cmd);
1830 
1856 #define LCB_MUTATION_TOKEN_ID(p) (p)->uuid_
1857 
1858 #define LCB_MUTATION_TOKEN_SEQ(p) (p)->seqno_
1859 
1860 #define LCB_MUTATION_TOKEN_VB(p) (p)->vbid_
1861 
1862 #define LCB_MUTATION_TOKEN_ISVALID(p) \
1863  (p && !((p)->uuid_ == 0 && (p)->seqno_ == 0 && (p)->vbid_ == 0))
1864 
1874 LIBCOUCHBASE_API
1875 const lcb_MUTATION_TOKEN *
1876 lcb_resp_get_mutation_token(int cbtype, const lcb_RESPBASE *rb);
1877 
1927 LIBCOUCHBASE_API
1928 const lcb_MUTATION_TOKEN *
1929 lcb_get_mutation_token(lcb_t instance, const lcb_KEYBUF *kb, lcb_error_t *errp);
1930 
1954 typedef struct {
1955  LCB_CMD_BASE;
1959  lcb_int64_t delta;
1962  lcb_U64 initial;
1965  int create;
1966 } lcb_CMDCOUNTER;
1967 
1971 typedef struct {
1974  lcb_U64 value;
1975 } lcb_RESPCOUNTER;
1976 
2017 LIBCOUCHBASE_API
2019 lcb_counter3(lcb_t instance, const void *cookie, const lcb_CMDCOUNTER *cmd);
2046 
2050 
2074 LIBCOUCHBASE_API
2076 lcb_unlock3(lcb_t instance, const void *cookie, const lcb_CMDUNLOCK *cmd);
2099 
2103 
2130 LIBCOUCHBASE_API
2132 lcb_touch3(lcb_t instance, const void *cookie, const lcb_CMDTOUCH *cmd);
2156 
2162 #define LCB_CMDSTATS_F_KV (1 << 16)
2163 
2168 typedef struct {
2170  LCB_RESP_SERVER_FIELDS
2171  const char *value;
2172  lcb_SIZE nvalue;
2173 } lcb_RESPSTATS;
2174 
2214 LIBCOUCHBASE_API
2216 lcb_stats3(lcb_t instance, const void *cookie, const lcb_CMDSTATS * cmd);
2226 typedef struct {
2228  LCB_RESP_SERVER_FIELDS
2229  const char *mcversion;
2230  lcb_SIZE nversion;
2232 
2234 LIBCOUCHBASE_API
2236 lcb_server_versions3(lcb_t instance, const void *cookie, const lcb_CMDBASE * cmd);
2237 
2245 typedef enum {
2246  LCB_VERBOSITY_DETAIL = 0x00,
2247  LCB_VERBOSITY_DEBUG = 0x01,
2248  LCB_VERBOSITY_INFO = 0x02,
2249  LCB_VERBOSITY_WARNING = 0x03
2251 
2252 typedef struct {
2253  /* unused */
2254  LCB_CMD_BASE;
2255  const char *server;
2256  lcb_verbosity_level_t level;
2257 } lcb_CMDVERBOSITY;
2260 LIBCOUCHBASE_API
2262 lcb_server_verbosity3(lcb_t instance, const void *cookie, const lcb_CMDVERBOSITY *cmd);
2276 typedef lcb_CMDBASE lcb_CMDCBFLUSH;
2278 
2301 LIBCOUCHBASE_API
2303 lcb_cbflush3(lcb_t instance, const void *cookie, const lcb_CMDCBFLUSH *cmd);
2304 
2305 
2306 typedef lcb_CMDBASE lcb_CMDFLUSH;
2312 LIBCOUCHBASE_API
2314 lcb_flush3(lcb_t instance, const void *cookie, const lcb_CMDFLUSH *cmd);
2333 typedef enum {
2339 
2347 
2352 
2355 
2356  LCB_HTTP_TYPE_MAX
2357 } lcb_http_type_t;
2358 
2365 typedef enum {
2366  LCB_HTTP_METHOD_GET = 0,
2367  LCB_HTTP_METHOD_POST = 1,
2368  LCB_HTTP_METHOD_PUT = 2,
2369  LCB_HTTP_METHOD_DELETE = 3,
2370  LCB_HTTP_METHOD_MAX = 4
2372 
2382 #define LCB_CMDHTTP_F_STREAM 1<<16
2383 
2389 #define LCB_CMDHTTP_F_CASTMO 1<<17
2390 
2395 typedef struct {
2396  LCB_CMD_BASE;
2406  const char *body;
2407 
2409  lcb_SIZE nbody;
2410 
2413  lcb_http_request_t *reqhandle;
2414 
2416  const char *content_type;
2417 
2420  const char *username;
2421 
2424  const char *password;
2425 
2428  const char *host;
2429 } lcb_CMDHTTP;
2430 
2439 typedef struct {
2444  short htstatus;
2445 
2448  const char * const * headers;
2449 
2452  const void *body;
2454  lcb_SIZE nbody;
2456  lcb_http_request_t _htreq;
2457 } lcb_RESPHTTP;
2458 
2513 LIBCOUCHBASE_API
2515 lcb_http3(lcb_t instance, const void *cookie, const lcb_CMDHTTP *cmd);
2516 
2540 LIBCOUCHBASE_API
2541 void
2542 lcb_cancel_http_request(lcb_t instance, lcb_http_request_t request);
2607 LIBCOUCHBASE_API
2608 void lcb_set_cookie(lcb_t instance, const void *cookie);
2609 
2617 LIBCOUCHBASE_API
2618 const void *lcb_get_cookie(lcb_t instance);
2650 LIBCOUCHBASE_API
2651 lcb_error_t lcb_wait(lcb_t instance);
2652 
2679 LIBCOUCHBASE_API
2681 
2683 typedef enum {
2686 
2695 } lcb_WAITFLAGS;
2696 
2704 LIBCOUCHBASE_API
2705 void lcb_wait3(lcb_t instance, lcb_WAITFLAGS flags);
2706 
2718 LIBCOUCHBASE_API
2719 void lcb_breakout(lcb_t instance);
2720 
2727 LIBCOUCHBASE_API
2728 int lcb_is_waiting(lcb_t instance);
2787 LIBCOUCHBASE_API
2788 void
2789 lcb_refresh_config(lcb_t instance);
2790 
2865 LIBCOUCHBASE_API
2866 void lcb_sched_enter(lcb_t instance);
2867 
2886 LIBCOUCHBASE_API
2887 void lcb_sched_leave(lcb_t instance);
2888 
2889 
2916 LIBCOUCHBASE_API
2917 void lcb_sched_fail(lcb_t instance);
2918 
2936 LIBCOUCHBASE_API
2937 void lcb_sched_flush(lcb_t instance);
2938 
2957 LIBCOUCHBASE_API
2958 void lcb_destroy(lcb_t instance);
2959 
2964 typedef void (*lcb_destroy_callback)(const void *cookie);
2965 
2971 LIBCOUCHBASE_API
3000 LIBCOUCHBASE_API
3001 void lcb_destroy_async(lcb_t instance, const void *arg);
3007 #define LCB_DATATYPE_JSON 0x01
3008 
3010 typedef enum { LCB_VALUE_RAW = 0x00, LCB_VALUE_F_JSON = 0x01, LCB_VALUE_F_SNAPPYCOMP } lcb_VALUEFLAGS;
3011 
3012 
3028 typedef enum {
3037 
3043 
3046 
3052 } lcb_GETNODETYPE;
3053 
3056 #define LCB_GETNODE_UNAVAILABLE "invalid_host:0"
3057 
3100 LIBCOUCHBASE_API
3101 const char *
3102 lcb_get_node(lcb_t instance, lcb_GETNODETYPE type, unsigned index);
3103 
3121 LIBCOUCHBASE_API
3122 const char *
3123 lcb_get_keynode(lcb_t instance, const void *key, size_t nkey);
3124 
3133 LIBCOUCHBASE_API
3134 lcb_S32 lcb_get_num_replicas(lcb_t instance);
3135 
3142 LIBCOUCHBASE_API
3143 lcb_S32 lcb_get_num_nodes(lcb_t instance);
3144 
3145 
3163 LIBCOUCHBASE_API
3164 const char *const *lcb_get_server_list(lcb_t instance);
3165 
3180 LIBCOUCHBASE_API
3181 void
3182 lcb_dump(lcb_t instance, FILE *fp, lcb_U32 flags);
3244 LIBCOUCHBASE_API
3245 lcb_error_t lcb_cntl(lcb_t instance, int mode, int cmd, void *arg);
3246 
3295 LIBCOUCHBASE_API
3297 lcb_cntl_string(lcb_t instance, const char *key, const char *value);
3298 
3307 LIBCOUCHBASE_API
3308 lcb_error_t lcb_cntl_setu32(lcb_t instance, int cmd, lcb_U32 arg);
3309 
3319 LIBCOUCHBASE_API
3320 lcb_U32 lcb_cntl_getu32(lcb_t instance, int cmd);
3321 
3327 LIBCOUCHBASE_API
3328 int
3329 lcb_cntl_exists(int ctl); /* settings */
3331 
3413 };
3414 typedef enum lcb_timeunit_t lcb_timeunit_t;
3415 
3428 LIBCOUCHBASE_API
3430 
3431 
3440 LIBCOUCHBASE_API
3442 
3458 typedef void (*lcb_timings_callback)(lcb_t instance,
3459  const void *cookie,
3460  lcb_timeunit_t timeunit,
3461  lcb_U32 min,
3462  lcb_U32 max,
3463  lcb_U32 total,
3464  lcb_U32 maxtotal);
3465 
3475 LIBCOUCHBASE_API
3477  const void *cookie,
3478  lcb_timings_callback callback);
3494 #if !defined(LCB_VERSION_STRING) || defined(__LCB_DOXYGEN__)
3495 
3496 #define LCB_VERSION_STRING "unknown"
3497 #endif
3498 
3499 #if !defined(LCB_VERSION) || defined(__LCB_DOXYGEN__)
3500 
3515 #define LCB_VERSION 0x000000
3516 #endif
3517 
3518 #if !defined(LCB_VERSION_CHANGESET) || defined(__LCB_DOXYGEN__)
3519 
3520 #define LCB_VERSION_CHANGESET "0xdeadbeef"
3521 #endif
3522 
3533 LIBCOUCHBASE_API
3534 const char *lcb_get_version(lcb_U32 *version);
3535 
3537 LIBCOUCHBASE_API LCB_EXTERN_VAR
3538 const lcb_U32 lcb_version_g;
3539 
3541 #define LCB_SUPPORTS_SSL 1
3542 
3543 #define LCB_SUPPORTS_SNAPPY 2
3544 
3551 LIBCOUCHBASE_API
3552 int
3553 lcb_supports_feature(int n);
3554 
3563 LIBCOUCHBASE_API
3564 void *lcb_mem_alloc(lcb_SIZE size);
3565 
3567 LIBCOUCHBASE_API
3568 void lcb_mem_free(void *ptr);
3569 
3579 LCB_INTERNAL_API
3580 void lcb_run_loop(lcb_t instance);
3581 
3583 LCB_INTERNAL_API
3584 void lcb_stop_loop(lcb_t instance);
3585 
3587 /* This returns the library's idea of time */
3588 LCB_INTERNAL_API
3589 lcb_U64 lcb_nstime(void);
3590 
3591 typedef enum {
3600 } lcb_DUMPFLAGS;
3601 
3603 struct lcb_histogram_st;
3604 typedef struct lcb_histogram_st lcb_HISTOGRAM;
3605 
3611 LCB_INTERNAL_API
3612 lcb_HISTOGRAM *
3613 lcb_histogram_create(void);
3614 
3619 LCB_INTERNAL_API
3620 void
3621 lcb_histogram_destroy(lcb_HISTOGRAM *hg);
3622 
3629 LCB_INTERNAL_API
3630 void
3631 lcb_histogram_record(lcb_HISTOGRAM *hg, lcb_U64 duration);
3632 
3633 typedef void (*lcb_HISTOGRAM_CALLBACK)
3634  (const void *cookie, lcb_timeunit_t timeunit, lcb_U32 min, lcb_U32 max,
3635  lcb_U32 total, lcb_U32 maxtotal);
3636 
3644 LCB_INTERNAL_API
3645 void
3646 lcb_histogram_read(const lcb_HISTOGRAM *hg, const void *cookie,
3647  lcb_HISTOGRAM_CALLBACK cb);
3648 
3659 LCB_INTERNAL_API
3660 void lcb_histogram_print(lcb_HISTOGRAM* hg, FILE* stream);
3661 
3662 /* Post-include some other headers */
3663 #ifdef __cplusplus
3664 }
3665 #endif /* __cplusplus */
3666 #include <libcouchbase/subdoc.h>
3667 #include <libcouchbase/cntl.h>
3668 #include <libcouchbase/deprecated.h>
3669 #include <libcouchbase/api-legacy.h>
3670 #endif /* LIBCOUCHBASE_COUCHBASE_H */
Structure for performing an HTTP request.
Definition: couchbase.h:2395
const void * value
Value buffer for the item.
Definition: couchbase.h:779
void lcb_dump(lcb_t instance, FILE *fp, lcb_U32 flags)
Write a textual dump to a file.
lcb_datatype_t datatype
Do not set this value for now.
Definition: couchbase.h:1043
int lcb_supports_feature(int n)
Execute an arbitrary request against a host and port.
Definition: couchbase.h:2351
int version
Indicates which field in the lcb_CRST_u union should be used.
Definition: couchbase.h:266
Dump memory usage/reservation information about buffers.
Definition: couchbase.h:3597
lcb_MULTICMD_CTX * lcb_observe3_ctxnew(lcb_t instance)
Create a new multi context for an observe operation.
void lcb_destroy_async(lcb_t instance, const void *arg)
Asynchronously schedule the destruction of an instance.
lcb_error_t lcb_cbflush3(lcb_t instance, const void *cookie, const lcb_CMDCBFLUSH *cmd)
uncommitted
lcb_stats3()
Definition: couchbase.h:632
The item missing on the disk and the memory.
Definition: couchbase.h:1720
Handle for administrative access.
Definition: couchbase.h:234
lcb_U32 ttr
Unused.
Definition: couchbase.h:1737
LCB_INTERNAL_API void lcb_histogram_print(lcb_HISTOGRAM *hg, FILE *stream)
Print the histogram to the specified FILE.
void lcb_refresh_config(lcb_t instance)
Force the library to refetch the cluster configuration.
lcb_RESPCALLBACK lcb_install_callback3(lcb_t instance, int cbtype, lcb_RESPCALLBACK cb)
lcb_observe3_ctxnew()
Definition: couchbase.h:636
Options for lcb_endure3_ctxnew() (wrapper)
Definition: couchbase.h:1419
struct lcb_io_opt_st * io
IO Options.
Definition: couchbase.h:258
void(* lcb_bootstrap_callback)(lcb_t instance, lcb_error_t err)
Bootstrap callback.
Definition: couchbase.h:359
Time is in nanoseconds.
Definition: couchbase.h:3409
Response structure for the version command.
Definition: couchbase.h:2226
Response structure for counter operations.
Definition: couchbase.h:1971
void(* lcb_destroy_callback)(const void *cookie)
Callback received when instance is about to be destroyed.
Definition: couchbase.h:2964
lcb_timeunit_t
Time units reported by lcb_get_timings()
Definition: couchbase.h:3408
Only return a node which is connected, or a node which is known to be up.
Definition: couchbase.h:3036
Response structure for cluster statistics.
Definition: couchbase.h:2168
lcb_verbosity_level_t
level field for lcb_server_verbosity3 ()
Definition: couchbase.h:2245
Execute an N1QL Query.
Definition: couchbase.h:2354
lcb_error_t lcb_server_verbosity3(lcb_t instance, const void *cookie, const lcb_CMDVERBOSITY *cmd)
lcb_error_t lcb_unlock3(lcb_t instance, const void *cookie, const lcb_CMDUNLOCK *cmd)
Unlock a previously locked item using lcb_CMDGET::lock.
Use sequence-number based polling.
Definition: couchbase.h:1342
lcb_error_t lcb_wait(lcb_t instance)
Wait for the execution of all batched requests.
Use the preferred durability.
Definition: couchbase.h:1319
void lcb_sched_enter(lcb_t instance)
Enter a scheduling context.
void lcb_sched_flush(lcb_t instance)
Request commands to be flushed to the network.
Query all the replicas sequentially, retrieving the first successful response.
Definition: couchbase.h:846
void(* lcb_timings_callback)(lcb_t instance, const void *cookie, lcb_timeunit_t timeunit, lcb_U32 min, lcb_U32 max, lcb_U32 total, lcb_U32 maxtotal)
The following function is called for each bucket in the timings histogram when you call lcb_get_timin...
Definition: couchbase.h:3458
lcb_U32 itmflags
User-defined flags for the item.
Definition: couchbase.h:783
const char * connstr
Connection string.
Definition: couchbase.h:254
Response structure for endure.
Definition: couchbase.h:1443
Response structure for lcb_observe_seqno3()
Definition: couchbase.h:1799
lcb_error_t lcb_get_bootstrap_status(lcb_t instance)
Gets the initial bootstrap status.
lcb_CMDBASE lcb_CMDTOUCH
Command structure for a touch request.
Definition: couchbase.h:2098
lcb_RESPBASE lcb_RESPREMOVE
Response structure for removal operation.
Definition: couchbase.h:1187
Default callback invoked as a fallback.
Definition: couchbase.h:625
Command structure for lcb_storedur3() This is much like lcb_CMDSTORE, but also includes durability op...
Definition: couchbase.h:1605
Time is in microseconds.
Definition: couchbase.h:3410
LCB_EXTERN_VAR const lcb_U32 lcb_version_g
Global/extern variable containing the version of the library.
Definition: couchbase.h:3538
void lcb_wait3(lcb_t instance, lcb_WAITFLAGS flags)
Wait for completion of scheduled operations.
Response structure for lcb_store3()
Definition: couchbase.h:1055
lcb_DURMODE
Type of durability polling to use.
Definition: couchbase.h:1313
lcb_U64 cur_uuid
UUID for this vBucket as known to the server.
Definition: couchbase.h:1803
Deprecated APIs.
Will cause the operation to fail unless the key already exists in the cluster.
Definition: couchbase.h:977
void * lcb_mem_alloc(lcb_SIZE size)
Functions to allocate and free memory related to libcouchbase.
lcb_error_t lcb_http3(lcb_t instance, const void *cookie, const lcb_CMDHTTP *cmd)
lcb_error_t lcb_touch3(lcb_t instance, const void *cookie, const lcb_CMDTOUCH *cmd)
Spool a touch request.
int lock
If set to true, the exptime field inside options will take to mean the time the lock should be held...
Definition: couchbase.h:773
lcb_http_method_t
HTTP Request method enumeration These just enumerate the various types of HTTP request methods suppor...
Definition: couchbase.h:2365
lcb_error_t lcb_counter3(lcb_t instance, const void *cookie, const lcb_CMDCOUNTER *cmd)
Schedule single counter operation.
const char * lcb_strcbtype(int cbtype)
lcb_SIZE nvalue
Length of value.
Definition: couchbase.h:780
lcb_storage_t operation
Definition: couchbase.h:1610
Base structure for informational commands from servers This contains an additional lcb_RESPSERVERBASE...
Definition: couchbase.h:571
lcb_U32 lcb_cntl_getu32(lcb_t instance, int cmd)
Retrieve an lcb_U32 setting.
lcb_U32 flags
Definition: couchbase.h:1608
The response was a result of a not-my-vbucket error.
Definition: couchbase.h:600
Common ABI header for all commands.
Definition: couchbase.h:458
Like LCB_APPEND, but prepends the new value to the existing value.
Definition: couchbase.h:1013
lcb_U8 check_delete
this flag inverts the sense of the durability check and ensures that the key does not exist...
Definition: couchbase.h:1402
This union contains the set of current and historical options.
Definition: couchbase.h:270
lcb_server_versions3()
Definition: couchbase.h:633
struct lcb_create_st3 v3
Use this field.
Definition: couchbase.h:274
Response structure for an observe command.
Definition: couchbase.h:1732
lcb_U64 value
Contains the current value after the operation was performed.
Definition: couchbase.h:1974
lcb_error_t lcb_get_timings(lcb_t instance, const void *cookie, lcb_timings_callback callback)
Get the timings histogram.
lcb_storage_t
Values for lcb_CMDSTORE::operation.
Definition: couchbase.h:966
lcb_get3()
Definition: couchbase.h:626
int index
Valid only when strategy is LCB_REPLICA_SELECT, specifies the replica index number to query...
Definition: couchbase.h:897
lcb_U16 nresponses
Total number of polls (i.e.
Definition: couchbase.h:1449
Execute a management API request.
Definition: couchbase.h:2346
Handle for data access (default)
Definition: couchbase.h:233
char replicate_to
Number of nodes to replicate to.
Definition: couchbase.h:1624
Equivalent to LCB_NODE_HTCONFIG|LCB_NODE_CONNECTED
Definition: couchbase.h:3045
Dump the raw vbucket configuration.
Definition: couchbase.h:3593
lcb_http3()
Definition: couchbase.h:639
lcb_error_t lcb_cntl_setu32(lcb_t instance, int cmd, lcb_U32 arg)
Convenience function to set a value as an lcb_U32.
int lcb_cntl_exists(int ctl)
Determine if a specific control code exists.
lcb_touch3()
Definition: couchbase.h:629
Options for lcb_endure3_ctxnew()
Definition: couchbase.h:1346
void lcb_destroy(lcb_t instance)
Destroy (and release all allocated resources) an instance of lcb.
lcb_error_t lcb_connect(lcb_t instance)
Schedule the initial connection This function will schedule the initial connection for the handle...
Get a view (CAPI) node.
Definition: couchbase.h:3034
lcb_destroy_callback lcb_set_destroy_callback(lcb_t, lcb_destroy_callback)
Set the callback to be invoked when the instance is destroyed asynchronously.
void(* lcb_RESPCALLBACK)(lcb_t instance, int cbtype, const lcb_RESPBASE *resp)
Definition: couchbase.h:670
Definition of all of the error codes used by libcouchbase.
lcb_observe_t
Possible statuses for keys in OBSERVE response.
Definition: couchbase.h:1714
lcb_VALBUF value
Definition: couchbase.h:1607
Command structure for endure.
Definition: couchbase.h:1437
Time is in milliseconds.
Definition: couchbase.h:3411
lcb_SIZE nvalue
Length of value.
Definition: couchbase.h:2172
The item found in the memory, but not yet on the disk.
Definition: couchbase.h:1716
lcb_U8 pollopts
Set the polling method to use.
Definition: couchbase.h:1414
lcb_cbflush3()
Definition: couchbase.h:640
const char * mcversion
The version string.
Definition: couchbase.h:2229
lcb_U32 interval
The durability check may involve more than a single call to observe - or more than a single packet se...
Definition: couchbase.h:1365
Structure representing a synchronization token.
Definition: couchbase.h:577
Multi Command Context API Some commands (notably, OBSERVE and its higher level equivalent, endue) are handled more efficiently at the cluster side by stuffing multiple items into a single packet.
Definition: couchbase.h:1266
lcb_int64_t delta
Delta value.
Definition: couchbase.h:1959
lcb_CMDBASE lcb_CMDUNLOCK
Command for lcb_unlock3()
Definition: couchbase.h:2045
Equivalent to LCB_NODE_HTCONFIG|LCB_NODE_NEVERNULL.
Definition: couchbase.h:3051
Will cause the operation to fail if the key already exists in the cluster.
Definition: couchbase.h:971
lcb_error_t lcb_store3(lcb_t instance, const void *cookie, const lcb_CMDSTORE *cmd)
Schedule a single storage request.
lcb_error_t lcb_durability_validate(lcb_t instance, lcb_U16 *persist_to, lcb_U16 *replicate_to, int options)
const lcb_MUTATION_TOKEN * lcb_get_mutation_token(lcb_t instance, const lcb_KEYBUF *kb, lcb_error_t *errp)
lcb_U32 timeout
Upper limit in microseconds from the scheduling of the command.
Definition: couchbase.h:1355
const lcb_RESPENDURE * dur_resp
Internal durability response structure.
Definition: couchbase.h:1633
lcb_flush3()
Definition: couchbase.h:635
lcb_U64 old_seqno
If old_uuid is nonzero, contains the highest sequence number persisted in the old_uuid snapshot...
Definition: couchbase.h:1817
The response was artificially generated inside the client.
Definition: couchbase.h:597
lcb_storage_t op
The type of operation which was performed.
Definition: couchbase.h:1059
lcb_U32 flags
Format flags used by clients to determine the underlying encoding of the value.
Definition: couchbase.h:1040
lcb_error_t lcb_observe_seqno3(lcb_t instance, const void *cookie, const lcb_CMDOBSEQNO *cmd)
Get the persistence/replication status for a given mutation token.
lcb_U64 old_uuid
In the case where the command's uuid is not the most current, this contains the last known UUID...
Definition: couchbase.h:1811
Structure for an observe request.
Definition: couchbase.h:1703
lcb_unlock3()
Definition: couchbase.h:631
lcb_U16 vbid_
Use LCB_MUTATION_TOKEN_VB()
Definition: couchbase.h:580
lcb_S32 lcb_get_num_nodes(lcb_t instance)
Get the number of the nodes in the cluster.
Query all the replicas concurrently, retrieving all the responses.
Definition: couchbase.h:849
lcb_error_t lcb_tick_nowait(lcb_t instance)
lcb_CALLBACKTYPE
The type of response passed to the callback.
Definition: couchbase.h:624
lcb_replica_t
Select get-replica mode.
Definition: couchbase.h:843
Command codes for libcouchbase.
lcb_replica_t strategy
Strategy for selecting a replica.
Definition: couchbase.h:890
const char * password
Password to authenticate with, if left empty, will use the credentials passed to lcb_create() ...
Definition: couchbase.h:2424
const char * body
If the request requires a body (e.g.
Definition: couchbase.h:2406
lcb_http_type_t type
Type of request to issue.
Definition: couchbase.h:2401
lcb_U8 exists_master
Whether this item exists in the master in its current form.
Definition: couchbase.h:1455
Command for retrieving a single item.
Definition: couchbase.h:765
lcb_rget3()
Definition: couchbase.h:637
lcb_remove3()
Definition: couchbase.h:630
Command structure for lcb_observe_seqno3().
Definition: couchbase.h:1782
Low level structures used by commands for buffers.
Command for counter operations.
Definition: couchbase.h:1954
const char * username
Username for bucket.
Definition: couchbase.h:255
lcb_U8 nreplicated
Total number of replica nodes to which this mutation has been replicated.
Definition: couchbase.h:1473
lcb_error_t lcb_server_versions3(lcb_t instance, const void *cookie, const lcb_CMDBASE *cmd)
lcb_bootstrap_callback lcb_set_bootstrap_callback(lcb_t instance, lcb_bootstrap_callback callback)
Set the callback for notification of success or failure of initial connection.
lcb_U16 replicate_to
how many nodes the key should be persisted to (excluding master).
Definition: couchbase.h:1395
lcb_counter3()
Definition: couchbase.h:628
Query the specific replica specified by the lcb_rget3_cmd_t::index field.
Definition: couchbase.h:853
Structure for HTTP responses.
Definition: couchbase.h:2439
lcb_U16 server_index
Server index to target.
Definition: couchbase.h:1788
lcb_store3()
Definition: couchbase.h:627
lcb_U64 seqno_
Use LCB_MUTATION_TOKEN_SEQ()
Definition: couchbase.h:579
lcb_U64 uuid_
Use LCB_MUTATION_TOKEN_ID()
Definition: couchbase.h:578
const char * username
Username to authenticate with, if left empty, will use the credentials passed to lcb_create() ...
Definition: couchbase.h:2420
void lcb_sched_leave(lcb_t instance)
Leave the current scheduling context, scheduling the commands within the context to be flushed to the...
lcb_U8 cap_max
If replication/persistence requirements are excessive, cap to the maximum available.
Definition: couchbase.h:1408
short htstatus
HTTP status code.
Definition: couchbase.h:2444
const char *const * headers
List of key-value headers.
Definition: couchbase.h:2448
lcb_U64 persisted_seqno
Highest persisted sequence.
Definition: couchbase.h:1804
lcb_CMDBASE lcb_CMDREMOVE
Command for removing an item from the server.
Definition: couchbase.h:1175
lcb_U8 persisted_master
True if item was persisted on the master node.
Definition: couchbase.h:1461
Get a data (memcached) node.
Definition: couchbase.h:3032
const char * value
The value, if any, for the given statistic.
Definition: couchbase.h:2171
lcb_server_verbosity3()
Definition: couchbase.h:634
int create
Boolean value.
Definition: couchbase.h:1965
const char * lcb_get_keynode(lcb_t instance, const void *key, size_t nkey)
Get the target server for a given key.
Response structure for `LCB_CALLBACK_STOREDUR.
Definition: couchbase.h:1630
lcb_U64 uuid
UUID known to client which should be queried.
Definition: couchbase.h:1790
struct lcb_st * lcb_t
Library handle representing a connection to a data bucket.
Definition: couchbase.h:41
Base response structure for callbacks.
Definition: couchbase.h:558
const char * content_type
For views, set this to application/json
Definition: couchbase.h:2416
Wrapper structure for lcb_create()
Definition: couchbase.h:264
lcb_type_t
Handle types.
Definition: couchbase.h:232
lcb_error_t
Error codes returned by the library.
Definition: error.h:506
lcb_RESPFLAGS
Response flags.
Definition: couchbase.h:588
lcb_RESPCALLBACK lcb_get_callback3(lcb_t instance, int cbtype)
lcb_U8 npersisted
Total number of nodes (including master) on which this mutation has been persisted.
Definition: couchbase.h:1467
lcb_storage_t operation
Controls how the operation is perfomed.
Definition: couchbase.h:1049
void lcb_cancel_http_request(lcb_t instance, lcb_http_request_t request)
Cancel ongoing HTTP request.
Get an HTTP configuration (Rest API) node.
Definition: couchbase.h:3030
lcb_MULTICMD_CTX * lcb_endure3_ctxnew(lcb_t instance, const lcb_durability_opts_t *options, lcb_error_t *err)
Return a new command context for scheduling endure operations.
For lcb_observe_seqno3()
Definition: couchbase.h:641
lcb_error_t lcb_stats3(lcb_t instance, const void *cookie, const lcb_CMDSTATS *cmd)
Schedule a request for statistics from the cluster.
lcb_error_t lcb_enable_timings(lcb_t instance)
Start recording timing metrics for the different operations.
Specifying this flag adds additional semantics which instruct the library to search additional resour...
Definition: couchbase.h:3042
const char * lcb_get_version(lcb_U32 *version)
Get the version of the library.
Unconditionally store the item in the cluster.
Definition: couchbase.h:980
Behave like the old lcb_wait()
Definition: couchbase.h:2685
Flag, only valid for subdoc responses, indicates that the response was processed using the single-ope...
Definition: couchbase.h:608
#define LCB_RESP_BASE
Response specific flags.
Definition: couchbase.h:539
int lcb_is_waiting(lcb_t instance)
Check if instance is blocked in the event loop.
char persist_to
Number of nodes to persist to.
Definition: couchbase.h:1617
const char * lcb_get_node(lcb_t instance, lcb_GETNODETYPE type, unsigned index)
Return a string of host:port for a node of the given type.
lcb_http_request_t * reqhandle
If non-NULL, will be assigned a handle which may be used to subsequently cancel the request...
Definition: couchbase.h:2413
lcb_error_t lcb_create(lcb_t *instance, const struct lcb_create_st *options)
Create an instance of lcb.
lcb_error_t lcb_get3(lcb_t instance, const void *cookie, const lcb_CMDGET *cmd)
Spool a single get operation.
lcb_RESPBASE lcb_RESPTOUCH
Response structure for a touch request.
Definition: couchbase.h:2102
Time is in seconds.
Definition: couchbase.h:3412
Command for requesting an item from a replica.
Definition: couchbase.h:867
void lcb_breakout(lcb_t instance)
Forcefully break from the event loop.
lcb_RESPBASE lcb_RESPUNLOCK
Response structure for an unlock command.
Definition: couchbase.h:2049
lcb_error_t lcb_flush3(lcb_t instance, const void *cookie, const lcb_CMDFLUSH *cmd)
const char * host
If set, this must be a string in the form of http://host:port.
Definition: couchbase.h:2428
lcb_U8 status
Bit set of flags.
Definition: couchbase.h:1734
lcb_error_t lcb_disable_timings(lcb_t instance)
Stop recording (and release all resources from previous measurements) timing metrics.
lcb_U64 mem_seqno
Highest known sequence.
Definition: couchbase.h:1805
void lcb_sched_fail(lcb_t instance)
Fail all commands in the current scheduling context.
const char *const * lcb_get_server_list(lcb_t instance)
Get a list of nodes in the cluster.
Dump information about each packet.
Definition: couchbase.h:3595
lcb_DUMPFLAGS
Definition: couchbase.h:3591
lcb_U16 vbid
vBucket ID to query
Definition: couchbase.h:1789
No more responses are to be received for this request.
Definition: couchbase.h:590
const void * body
If LCB_CMDHTTP_F_STREAM is true, contains the current chunk of response content.
Definition: couchbase.h:2452
lcb_GETNODETYPE
Type of node to retrieve for the lcb_get_node() function.
Definition: couchbase.h:3028
lcb_error_t lcb_cntl_string(lcb_t instance, const char *key, const char *value)
Alternate way to set configuration settings by passing a string key and value.
Rather than setting the contents of the entire document, take the value specified in lcb_CMDSTORE::va...
Definition: couchbase.h:1008
Execute a request against the bucket.
Definition: couchbase.h:2338
Do not check pending operations before running the event loop.
Definition: couchbase.h:2694
lcb_U64 initial
If the item does not exist on the server (and create is true) then this will be the initial value for...
Definition: couchbase.h:1962
int store_ok
If the rc field is not LCB_SUCCESS, this field indicates what failed.
Definition: couchbase.h:1639
lcb_VALBUF value
Value to store on the server.
Definition: couchbase.h:1033
Command for storing an item to the server.
Definition: couchbase.h:1026
lcb_SIZE nversion
Length of the version string.
Definition: couchbase.h:2230
Dump everything.
Definition: couchbase.h:3599
lcb_http_method_t method
HTTP Method to use.
Definition: couchbase.h:2402
The response has additional internal data.
Definition: couchbase.h:604
lcb_WAITFLAGS
Flags for lcb_wait3()
Definition: couchbase.h:2683
lcb_error_t lcb_storedur3(lcb_t instance, const void *cookie, const lcb_CMDSTOREDUR *cmd)
lcb_endure3_ctxnew()
Definition: couchbase.h:638
Common request header for all keys.
Definition: kvbuf.h:61
lcb_U8 ismaster
Set to true if this response came from the master node.
Definition: couchbase.h:1735
lcb_error_t lcb_cntl(lcb_t instance, int mode, int cmd, void *arg)
This function exposes an ioctl/fcntl-like interface to read and write various configuration propertie...
Response structure when retrieving a single item.
Definition: couchbase.h:777
lcb_CMDBASE lcb_CMDSTATS
Command structure for stats request The lcb_CMDSTATS::key field should contain the statistics key...
Definition: couchbase.h:2155
Public I/O integration interface.
lcb_SIZE nbody
Length of the body for the request.
Definition: couchbase.h:2409
lcb_U16 persist_to
how many nodes the key should be persisted to (including master).
Definition: couchbase.h:1380
lcb_http_type_t
The type of HTTP request to execute.
Definition: couchbase.h:2333
The item hit the disk.
Definition: couchbase.h:1718
lcb_S32 lcb_get_num_replicas(lcb_t instance)
Get the number of the replicas in the cluster.
Explicitly request CAS-based durability.
Definition: couchbase.h:1333
Innser structure for lcb_create().
Definition: couchbase.h:253
Structure representing a value to be stored.
Definition: kvbuf.h:110
const char * passwd
Password for bucket.
Definition: couchbase.h:256
No knowledge of the key :)
Definition: couchbase.h:1722
void lcb_mem_free(void *ptr)
Use this to free memory allocated with lcb_mem_alloc.
Definition: couchbase.h:643
lcb_error_t lcb_rget3(lcb_t instance, const void *cookie, const lcb_CMDGETREPLICA *cmd)
Spool a single get-with-replica request.
const lcb_MUTATION_TOKEN * lcb_resp_get_mutation_token(int cbtype, const lcb_RESPBASE *rb)
Retrieves the mutation token from the response structure.
lcb_U32 ttp
Unused.
Definition: couchbase.h:1736
lcb_error_t lcb_remove3(lcb_t instance, const void *cookie, const lcb_CMDREMOVE *cmd)
Spool a removal of an item.
const lcb_U16 * servers_
For internal use: This determines the servers the command should be routed to.
Definition: couchbase.h:1707