#ifndef DICT_CLIENT_H #define DICT_CLIENT_H #include "dict.h" #define DEFAULT_DICT_SERVER_SOCKET_FNAME "dict" #define DICT_CLIENT_PROTOCOL_MAJOR_VERSION 3 #define DICT_CLIENT_PROTOCOL_MINOR_VERSION 2 #define DICT_CLIENT_PROTOCOL_VERSION_MIN_MULTI_OK 2 #define DICT_CLIENT_MAX_LINE_LENGTH (64*1024) enum dict_protocol_cmd { /* */ DICT_PROTOCOL_CMD_HELLO = 'H', DICT_PROTOCOL_CMD_LOOKUP = 'L', /* */ DICT_PROTOCOL_CMD_ITERATE = 'I', /* */ DICT_PROTOCOL_CMD_BEGIN = 'B', /* */ DICT_PROTOCOL_CMD_COMMIT = 'C', /* */ DICT_PROTOCOL_CMD_COMMIT_ASYNC = 'D', /* */ DICT_PROTOCOL_CMD_ROLLBACK = 'R', /* */ DICT_PROTOCOL_CMD_SET = 'S', /* */ DICT_PROTOCOL_CMD_UNSET = 'U', /* */ DICT_PROTOCOL_CMD_ATOMIC_INC = 'A', /* */ DICT_PROTOCOL_CMD_TIMESTAMP = 'T', /* */ }; enum dict_protocol_reply { DICT_PROTOCOL_REPLY_ERROR = -1, DICT_PROTOCOL_REPLY_OK = 'O', /* */ DICT_PROTOCOL_REPLY_MULTI_OK = 'M', /* protocol v2.2+ */ DICT_PROTOCOL_REPLY_NOTFOUND = 'N', DICT_PROTOCOL_REPLY_FAIL = 'F', DICT_PROTOCOL_REPLY_WRITE_UNCERTAIN = 'W', DICT_PROTOCOL_REPLY_ASYNC_COMMIT = 'A', DICT_PROTOCOL_REPLY_ITER_FINISHED = '\0', DICT_PROTOCOL_REPLY_ASYNC_ID = '*', DICT_PROTOCOL_REPLY_ASYNC_REPLY = '+', }; #endif