Fixed autoconf macros for cross compile
[awesomized/libmemcached] / libmemcached / result.h
1 /* LibMemcached
2 * Copyright (C) 2006-2009 Brian Aker
3 * All rights reserved.
4 *
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
7 *
8 * Summary: Functions to manipulate the result structure.
9 *
10 */
11
12 #ifndef __LIBMEMCACHED_RESULT_H__
13 #define __LIBMEMCACHED_RESULT_H__
14
15 struct memcached_result_st {
16 uint32_t item_flags;
17 time_t item_expiration;
18 size_t key_length;
19 uint64_t item_cas;
20 const memcached_st *root;
21 memcached_string_st value;
22 char item_key[MEMCACHED_MAX_KEY];
23 struct {
24 bool is_allocated:1;
25 bool is_initialized:1;
26 } options;
27 /* Add result callback function */
28 };
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* Result Struct */
35 LIBMEMCACHED_API
36 void memcached_result_free(memcached_result_st *result);
37
38 LIBMEMCACHED_API
39 void memcached_result_reset(memcached_result_st *ptr);
40
41 LIBMEMCACHED_API
42 memcached_result_st *memcached_result_create(const memcached_st *ptr,
43 memcached_result_st *result);
44
45 LIBMEMCACHED_API
46 const char *memcached_result_key_value(const memcached_result_st *self);
47
48 LIBMEMCACHED_API
49 size_t memcached_result_key_length(const memcached_result_st *self);
50
51 LIBMEMCACHED_API
52 const char *memcached_result_value(const memcached_result_st *self);
53
54 LIBMEMCACHED_API
55 size_t memcached_result_length(const memcached_result_st *self);
56
57 LIBMEMCACHED_API
58 uint32_t memcached_result_flags(const memcached_result_st *self);
59
60 LIBMEMCACHED_API
61 uint64_t memcached_result_cas(const memcached_result_st *self);
62
63 LIBMEMCACHED_API
64 memcached_return_t memcached_result_set_value(memcached_result_st *ptr, const char *value, size_t length);
65
66 LIBMEMCACHED_API
67 void memcached_result_set_flags(memcached_result_st *self, uint32_t flags);
68
69 LIBMEMCACHED_API
70 void memcached_result_set_expiration(memcached_result_st *self, time_t expiration);
71
72 #ifdef __cplusplus
73 } // extern "C"
74 #endif
75
76
77 #endif /* __LIBMEMCACHED_RESULT_H__ */