Couchbase C Client  3.3.14
Asynchronous C Client for Couchbase
kvbuf.h File Reference

Low level structures used by commands for buffers. More...

Go to the source code of this file.

Data Structures

struct  lcb_CONTIGBUF
 simple buf/length structure for a contiguous series of bytes More...
 
struct  lcb_KEYBUF
 Common request header for all keys. More...
 
struct  lcb_FRAGBUF
 Structure for an IOV buffer to be supplied as a buffer. More...
 
struct  lcb_VALBUF
 Structure representing a value to be stored. More...
 

Macros

#define LCB_KV_HEADER_AND_KEY
 
#define LCB_KEYBUF_IS_EMPTY(k)
 
#define LCB_KREQ_SIMPLE(req, k, nk)
 Initialize a contiguous request backed by a buffer which should be copied.
 

Enumerations

enum  lcb_KVBUFTYPE
 Flags indicating the storage policy for a buffer. More...
 

Detailed Description

Low level structures used by commands for buffers.


Data Structure Documentation

◆ lcb_CONTIGBUF

struct lcb_CONTIGBUF

simple buf/length structure for a contiguous series of bytes

Data Fields
const void * bytes
size_t nbytes Number of total bytes.

◆ lcb_KEYBUF

struct lcb_KEYBUF

Common request header for all keys.

Data Fields
lcb_KVBUFTYPE type The type of key to provide.

This can currently be LCB_KV_COPY (Default) to copy the key into the pipeline buffers, or LCB_KV_HEADER_AND_KEY to provide a buffer with the header storage and the key.

TODO: Currently only LCB_KV_COPY should be used. LCB_KV_HEADER_AND_KEY is used internally but may be exposed later on

lcb_CONTIGBUF contig
lcb_U16 vbid precomputed vbucket id

◆ lcb_FRAGBUF

struct lcb_FRAGBUF

Structure for an IOV buffer to be supplied as a buffer.

This is currently only used for value buffers

Data Fields
lcb_IOV * iov An IOV array.
unsigned int niov Number of elements in iov array.
unsigned int total_length Total length of the items.

This should be set, if known, to prevent the library from manually traversing the iov array to calculate the length.

◆ lcb_VALBUF

struct lcb_VALBUF

Structure representing a value to be stored.

Data Fields
lcb_KVBUFTYPE vtype Value request type.

This may be one of:

  • LCB_KV_COPY: Copy over the value into LCB's own buffers Use the 'contig' field to supply the information.
  • LCB_KV_CONTIG: The buffer is a contiguous chunk of value data. Use the 'contig' field to supply the information.
  • LCB_KV_IOV: The buffer is a series of IOV elements. Use the 'multi' field to supply the information.
union lcb_VALBUF.u_buf u_buf

Macro Definition Documentation

◆ LCB_KREQ_SIMPLE

#define LCB_KREQ_SIMPLE ( req,
k,
nk )

Initialize a contiguous request backed by a buffer which should be copied.

Parameters
reqthe key request to initialize
kthe key to copy
nkthe size of the key

Enumeration Type Documentation

◆ lcb_KVBUFTYPE

Flags indicating the storage policy for a buffer.

Enumerator
LCB_KV_COPY 

The buffer should be copied.

LCB_KV_CONTIG 

The buffer is contiguous and should not be copied.

LCB_KV_IOV 

The buffer is not contiguous and should not be copied.

LCB_KV_VBID 

Indicates that the precomputed vBucket ID should be used.

LCB_KV_IOVCOPY 

The buffers are not contiguous (multi-part buffers) but should be copied.

This avoids having to make the buffers contiguous before passing it into the library (only to have the library copy it again)