X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fprotocol%2Fcommon.h;h=185aef0b5c7f04d69835ac4a007a81c906b60dac;hb=18ace40ddb7271f3f5e71965f74fe11d7754bd8f;hp=20fa16e554f7f7b157445ae7475e9c744b720da5;hpb=34418e51585216006d5b241fc9104dc4b88d1be0;p=awesomized%2Flibmemcached diff --git a/libmemcached/protocol/common.h b/libmemcached/protocol/common.h index 20fa16e5..185aef0b 100644 --- a/libmemcached/protocol/common.h +++ b/libmemcached/protocol/common.h @@ -3,9 +3,10 @@ #define LIBMEMCACHED_PROTOCOL_COMMON_H #include "config.h" -#include +#if !defined(__cplusplus) +# include +#endif #include -#include /* Define this here, which will turn on the visibilty controls while we're * building libmemcached. @@ -23,8 +24,8 @@ * but some people still do). If it ever shows up as a performance thing * I'll look into optimizing this ;-) */ -typedef bool (*drain_func)(struct memcached_protocol_client_st *client); -typedef protocol_binary_response_status (*spool_func)(struct memcached_protocol_client_st *client, +typedef bool (*drain_func)(memcached_protocol_client_st *client); +typedef protocol_binary_response_status (*spool_func)(memcached_protocol_client_st *client, const void *data, size_t length); @@ -32,7 +33,7 @@ typedef protocol_binary_response_status (*spool_func)(struct memcached_protocol_ * Definition of the per instance structure. */ struct memcached_protocol_st { - struct memcached_binary_protocol_callback_st *callback; + memcached_binary_protocol_callback_st *callback; memcached_protocol_recv_func recv; memcached_protocol_send_func send; @@ -73,7 +74,7 @@ struct chunk_st { #define CHUNK_BUFFERSIZE 2048 -typedef enum MEMCACHED_PROTOCOL_EVENT (*process_data)(struct memcached_protocol_client_st *client, ssize_t *length, void **endptr); +typedef memcached_protocol_event_t (*process_data)(struct memcached_protocol_client_st *client, ssize_t *length, void **endptr); enum ascii_cmd { GET_CMD, @@ -92,12 +93,12 @@ enum ascii_cmd { VERSION_CMD, QUIT_CMD, VERBOSITY_CMD, - UNKNOWN_CMD, + UNKNOWN_CMD }; struct memcached_protocol_client_st { - struct memcached_protocol_st *root; - int sock; + memcached_protocol_st *root; + memcached_socket_t sock; int error; /* Linked list of data to send */