move repository from m6w6 to awesomized
[awesomized/libmemcached] / src / libmemcached / array.h
1 /*
2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020-2021 Michael Wallner https://awesome.co/ |
13 +--------------------------------------------------------------------+
14 */
15
16 #pragma once
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 memcached_array_st *memcached_array_clone(Memcached *memc, const memcached_array_st *original);
23
24 memcached_array_st *memcached_strcpy(Memcached *memc, const char *str, size_t str_length);
25
26 void memcached_array_free(memcached_array_st *array);
27
28 size_t memcached_array_size(memcached_array_st *array);
29
30 const char *memcached_array_string(memcached_array_st *array);
31
32 memcached_string_t memcached_array_to_string(memcached_array_st *array);
33
34 bool memcached_array_is_null(memcached_array_st *array);
35
36 #ifdef __cplusplus
37 } // extern "C"
38 #endif
39
40 #ifdef __cplusplus
41 # define memcached_print_array(X) \
42 static_cast<int>(memcached_array_size(X)), memcached_array_string(X)
43 # define memcached_param_array(X) memcached_array_string(X), memcached_array_size(X)
44 #else
45 # define memcached_print_array(X) (int) memcached_array_size((X)), memcached_array_string((X))
46 # define memcached_param_array(X) memcached_array_string(X), memcached_array_size(X)
47 #endif