2 * Copyright (C) 2006-2009 Brian Aker
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
8 * Summary: String structure used for libmemcached.
12 #ifndef __MEMCACHED_STRING_H__
13 #define __MEMCACHED_STRING_H__
20 struct memcached_string_st
{
28 bool is_initialized
:1;
32 #define memcached_string_length(A) (size_t)((A)->end - (A)->string)
33 #define memcached_string_set_length(A, B) (A)->end= (A)->string + B
34 #define memcached_string_size(A) (A)->current_size
35 #define memcached_string_value(A) (A)->string
38 memcached_string_st
*memcached_string_create(memcached_st
*ptr
,
39 memcached_string_st
*string
,
42 memcached_return_t
memcached_string_check(memcached_string_st
*string
, size_t need
);
45 char *memcached_string_c_copy(memcached_string_st
*string
);
48 memcached_return_t
memcached_string_append_character(memcached_string_st
*string
,
51 memcached_return_t
memcached_string_append(memcached_string_st
*string
,
52 const char *value
, size_t length
);
54 memcached_return_t
memcached_string_reset(memcached_string_st
*string
);
57 void memcached_string_free(memcached_string_st
*string
);
63 #endif /* __MEMCACHED_STRING_H__ */