annotate src/lib-dict/dict-client.h @ 9575:0a00dcc4f0ea HEAD

lib-storage: Allow shared namespace prefix to use %variable modifiers.
author Timo Sirainen <tss@iki.fi>
date Wed, 26 May 2010 17:07:51 +0100
parents a1b92a251bb9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6410
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 4517
diff changeset
1 #ifndef DICT_CLIENT_H
e4eb71ae8e96 Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents: 4517
diff changeset
2 #define DICT_CLIENT_H
3793
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
4517
e661182eab75 Berkeley DB dict support is now enabled only when using --with-db configure option.
Timo Sirainen <timo.sirainen@movial.fi>
parents: 4516
diff changeset
4 #include "dict.h"
e661182eab75 Berkeley DB dict support is now enabled only when using --with-db configure option.
Timo Sirainen <timo.sirainen@movial.fi>
parents: 4516
diff changeset
5
9174
eed86bcc33aa dict proxy: Use base_dir as the default dict-server location.
Timo Sirainen <tss@iki.fi>
parents: 8664
diff changeset
6 #define DEFAULT_DICT_SERVER_SOCKET_FNAME "dict-server"
3793
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7
4516
aa2f73a4df26 Dictionary changes: Added support for defining value's type. Key is still always a string. Added support for sorting the iteration replies. Added dict_unset(). Added Berkeley DB support. Most of the code written by Tianyan Liu.
Timo Sirainen <timo.sirainen@movial.fi>
parents: 4393
diff changeset
8 #define DICT_CLIENT_PROTOCOL_MAJOR_VERSION 2
3793
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 #define DICT_CLIENT_PROTOCOL_MINOR_VERSION 0
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 #define DICT_CLIENT_MAX_LINE_LENGTH (64*1024)
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 enum {
4516
aa2f73a4df26 Dictionary changes: Added support for defining value's type. Key is still always a string. Added support for sorting the iteration replies. Added dict_unset(). Added Berkeley DB support. Most of the code written by Tianyan Liu.
Timo Sirainen <timo.sirainen@movial.fi>
parents: 4393
diff changeset
14 /* <major-version> <minor-version> <value type> <user> <dict name> */
3793
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 DICT_PROTOCOL_CMD_HELLO = 'H',
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17 DICT_PROTOCOL_CMD_LOOKUP = 'L', /* <key> */
4516
aa2f73a4df26 Dictionary changes: Added support for defining value's type. Key is still always a string. Added support for sorting the iteration replies. Added dict_unset(). Added Berkeley DB support. Most of the code written by Tianyan Liu.
Timo Sirainen <timo.sirainen@movial.fi>
parents: 4393
diff changeset
18 DICT_PROTOCOL_CMD_ITERATE = 'I', /* <flags> <path> */
3793
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20 DICT_PROTOCOL_CMD_BEGIN = 'B', /* <id> */
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 DICT_PROTOCOL_CMD_COMMIT = 'C', /* <id> */
8664
446775a31754 dict proxy: Handle async commits better.
Timo Sirainen <tss@iki.fi>
parents: 8300
diff changeset
22 DICT_PROTOCOL_CMD_COMMIT_ASYNC = 'D', /* <id> */
3793
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 DICT_PROTOCOL_CMD_ROLLBACK = 'R', /* <id> */
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25 DICT_PROTOCOL_CMD_SET = 'S', /* <id> <key> <value> */
4516
aa2f73a4df26 Dictionary changes: Added support for defining value's type. Key is still always a string. Added support for sorting the iteration replies. Added dict_unset(). Added Berkeley DB support. Most of the code written by Tianyan Liu.
Timo Sirainen <timo.sirainen@movial.fi>
parents: 4393
diff changeset
26 DICT_PROTOCOL_CMD_UNSET = 'U', /* <id> <key> */
3793
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
27 DICT_PROTOCOL_CMD_ATOMIC_INC = 'A' /* <id> <key> <diff> */
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28 };
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
29
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
30 enum {
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
31 DICT_PROTOCOL_REPLY_OK = 'O', /* <value> */
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
32 DICT_PROTOCOL_REPLY_NOTFOUND = 'N',
9361
a1b92a251bb9 dict: Added support for async commits. Changed dict_atomic_inc() behavior.
Timo Sirainen <tss@iki.fi>
parents: 9174
diff changeset
33 DICT_PROTOCOL_REPLY_FAIL = 'F',
a1b92a251bb9 dict: Added support for async commits. Changed dict_atomic_inc() behavior.
Timo Sirainen <tss@iki.fi>
parents: 9174
diff changeset
34 DICT_PROTOCOL_REPLY_ASYNC_COMMIT = 'A'
3793
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
35 };
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
36
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
37 const char *dict_client_escape(const char *src);
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38 const char *dict_client_unescape(const char *src);
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
39
0b3f3323e460 Forgot to add
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
40 #endif