Skip to content

Instantly share code, notes, and snippets.

@argv0
Created April 20, 2010 20:06
Show Gist options
  • Select an option

  • Save argv0/372993 to your computer and use it in GitHub Desktop.

Select an option

Save argv0/372993 to your computer and use it in GitHub Desktop.
#define RC_EXPORT __attribute__((visibility ("default")))
// connection handle opaque type
struct riak_connection;
typedef struct riak_connection* riak_connection_handle;
typedef struct riak_data {
void *data;
size_t size;
} riak_data;
typedef struct riak_bkey {
riak_data bucket;
riak_data key;
} riak_bkey;
// request types
typedef struct riak_get_request {
riak_bkey bkey;
unsigned int r_value;
} riak_get_request;
typedef struct riak_put_request {
riak_bkey bkey;
riak_data value;
unsigned int w_value;
unsigned int dw_value;
} riak_put_request;
typedef struct riak_delete_request {
riak_bkey bkey;
unsigned int w_value;
unsigned int dw_value;
} riak_delete_request;
// response types
typedef struct riak_get_response {} riak_get_response;
typedef struct riak_put_response {} riak_put_response;
typedef struct riak_delete_response {} riak_delete_response;
riak_connection_handle riak_connect(char *ip_addr, int port);
int ping(riak_connection_handle handle);
int close(riak_connection_handle handle);
riak_get_response *get(riak_connection_handle handle, riak_get_request request);
riak_put_response *riak_put(riak_connection_handle handle, riak_put_request request);
riak_delete_response *del(riak_connection_handle handle, riak_delete_request request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment