1c229ecbf777525ca5c58309c550b2b39093d163
[awesomized/libmemcached] / libmemcached / memcached_result.h
1 /*
2 * Summary: Result structure used for libmemcached.
3 *
4 * Copy: See Copyright for the status of this software.
5 *
6 * Author: Brian Aker
7 */
8
9 #ifndef __MEMCACHED_RESULT_H__
10 #define __MEMCACHED_RESULT_H__
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 struct memcached_result_st {
17 memcached_allocated is_allocated;
18 memcached_st *root;
19 char key[MEMCACHED_MAX_KEY];
20 size_t key_length;
21 memcached_string_st value;
22 uint32_t flags;
23 uint64_t cas;
24 /* Add result callback function */
25 };
26
27 /* Result Struct */
28 void memcached_result_free(memcached_result_st *result);
29 memcached_result_st *memcached_result_create(memcached_st *ptr,
30 memcached_result_st *result);
31 #define memcached_result_key_value(A) (A)->key
32 #define memcached_result_key_length(A) (A)->key_length
33 #ifdef FIX
34 #define memcached_result_value(A) memcached_string_value((A)->value)
35 #define memcached_result_length(A) memcached_string_length((A)->value)
36 #else
37 char *memcached_result_value(memcached_result_st *ptr);
38 size_t memcached_result_length(memcached_result_st *ptr);
39 #endif
40 #define memcached_result_flags(A) (A)->flags
41 #define memcached_result_cas(A) (A)->cas
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif /* __MEMCACHED_RESULT_H__ */