Shows how to connect to the cluster and perform operations
#include <stdio.h>
#include <libcouchbase/api3.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#define PRIx64 "I64x"
#else
#include <inttypes.h>
#endif
static void
{
fprintf(stderr, "%s. Received code 0x%X (%s)\n",
exit(EXIT_FAILURE);
}
static void
{
fprintf(stderr,
"KEY: %.*s\n", (
int)rb->
nkey, rb->
key);
fprintf(stderr,
"CAS: 0x%"PRIx64
"\n", rb->
cas);
fprintf(stderr,
"VALUE: %.*s\n", (
int)rg->
nvalue, rg->
value);
fprintf(stderr,
"FLAGS: 0x%x\n", rg->
itmflags);
}
} else {
}
(void)instance;
}
int main(int argc, char *argv[])
{
if (argc < 2) {
fprintf(stderr, "Usage: %s couchbase://host/bucket [ password ]\n", argv[0]);
exit(EXIT_FAILURE);
}
if (argc >= 3) {
}
die(NULL, "Couldn't create couchbase handle", err);
}
die(instance, "Couldn't schedule connection", err);
}
die(instance, "Couldn't bootstrap from cluster", err);
}
die(instance, "Couldn't schedule storage operation", err);
}
fprintf(stderr, "Will wait for storage operation to complete..\n");
die(instance, "Couldn't schedule retrieval operation", err);
}
fprintf(stderr, "Will wait to retrieve item..\n");
return 0;
}