From 569bf51f79bed2a80727c44b32b013acd5a5f04f Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 23 Oct 2020 13:15:46 +0200 Subject: [PATCH] include: apply clang-format --- include/libmemcached-1.0/alloc.h | 56 +- include/libmemcached-1.0/allocators.h | 59 +- include/libmemcached-1.0/analyze.h | 53 +- include/libmemcached-1.0/auto.h | 128 ++--- include/libmemcached-1.0/basic_string.h | 58 +- include/libmemcached-1.0/behavior.h | 71 +-- include/libmemcached-1.0/callback.h | 56 +- include/libmemcached-1.0/callbacks.h | 59 +- include/libmemcached-1.0/configure.h.in | 52 +- include/libmemcached-1.0/defaults.h | 76 +-- include/libmemcached-1.0/delete.h | 58 +- include/libmemcached-1.0/deprecated_types.h | 53 +- include/libmemcached-1.0/dump.h | 55 +- include/libmemcached-1.0/encoding_key.h | 52 +- include/libmemcached-1.0/error.h | 64 +-- include/libmemcached-1.0/exception.hpp | 103 ++-- include/libmemcached-1.0/exist.h | 55 +- include/libmemcached-1.0/fetch.h | 57 +- include/libmemcached-1.0/flush.h | 50 +- include/libmemcached-1.0/flush_buffers.h | 50 +- include/libmemcached-1.0/get.h | 114 ++-- include/libmemcached-1.0/hash.h | 55 +- include/libmemcached-1.0/limits.h | 61 +- include/libmemcached-1.0/memcached.h | 56 +- include/libmemcached-1.0/memcached.hpp | 540 ++++++------------ include/libmemcached-1.0/options.h | 53 +- include/libmemcached-1.0/parse.h | 24 +- include/libmemcached-1.0/platform.h | 73 +-- include/libmemcached-1.0/quit.h | 50 +- include/libmemcached-1.0/result.h | 56 +- include/libmemcached-1.0/return.h | 103 +--- include/libmemcached-1.0/sasl.h | 63 +- include/libmemcached-1.0/server.h | 99 ++-- include/libmemcached-1.0/server_list.h | 73 +-- include/libmemcached-1.0/stats.h | 57 +- include/libmemcached-1.0/storage.h | 143 ++--- include/libmemcached-1.0/strerror.h | 51 +- include/libmemcached-1.0/struct/allocator.h | 50 +- include/libmemcached-1.0/struct/analysis.h | 51 +- include/libmemcached-1.0/struct/callback.h | 50 +- include/libmemcached-1.0/struct/memcached.h | 102 ++-- include/libmemcached-1.0/struct/result.h | 55 +- include/libmemcached-1.0/struct/sasl.h | 57 +- include/libmemcached-1.0/struct/server.h | 71 +-- include/libmemcached-1.0/struct/stat.h | 51 +- include/libmemcached-1.0/struct/string.h | 54 +- include/libmemcached-1.0/touch.h | 62 +- include/libmemcached-1.0/triggers.h | 64 +-- include/libmemcached-1.0/types.h | 51 +- include/libmemcached-1.0/types/behavior.h | 51 +- include/libmemcached-1.0/types/callback.h | 53 +- include/libmemcached-1.0/types/connection.h | 51 +- include/libmemcached-1.0/types/hash.h | 53 +- include/libmemcached-1.0/types/return.h | 55 +- .../types/server_distribution.h | 51 +- include/libmemcached-1.0/verbosity.h | 51 +- include/libmemcached-1.0/version.h | 52 +- include/libmemcached-1.0/visibility.h | 101 ++-- 58 files changed, 1325 insertions(+), 2847 deletions(-) diff --git a/include/libmemcached-1.0/alloc.h b/include/libmemcached-1.0/alloc.h index bc65b951..23bc5cbc 100644 --- a/include/libmemcached-1.0/alloc.h +++ b/include/libmemcached-1.0/alloc.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -46,8 +24,10 @@ extern "C" { */ typedef void (*memcached_free_fn)(const memcached_st *ptr, void *mem, void *context); typedef void *(*memcached_malloc_fn)(const memcached_st *ptr, const size_t size, void *context); -typedef void *(*memcached_realloc_fn)(const memcached_st *ptr, void *mem, const size_t size, void *context); -typedef void *(*memcached_calloc_fn)(const memcached_st *ptr, size_t nelem, const size_t elsize, void *context); +typedef void *(*memcached_realloc_fn)(const memcached_st *ptr, void *mem, const size_t size, + void *context); +typedef void *(*memcached_calloc_fn)(const memcached_st *ptr, size_t nelem, const size_t elsize, + void *context); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/allocators.h b/include/libmemcached-1.0/allocators.h index 86f05a06..c473e725 100644 --- a/include/libmemcached-1.0/allocators.h +++ b/include/libmemcached-1.0/allocators.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -46,14 +24,11 @@ memcached_return_t memcached_set_memory_allocators(memcached_st *ptr, memcached_malloc_fn mem_malloc, memcached_free_fn mem_free, memcached_realloc_fn mem_realloc, - memcached_calloc_fn mem_calloc, - void *context); + memcached_calloc_fn mem_calloc, void *context); LIBMEMCACHED_API -void memcached_get_memory_allocators(const memcached_st *ptr, - memcached_malloc_fn *mem_malloc, - memcached_free_fn *mem_free, - memcached_realloc_fn *mem_realloc, +void memcached_get_memory_allocators(const memcached_st *ptr, memcached_malloc_fn *mem_malloc, + memcached_free_fn *mem_free, memcached_realloc_fn *mem_realloc, memcached_calloc_fn *mem_calloc); LIBMEMCACHED_API diff --git a/include/libmemcached-1.0/analyze.h b/include/libmemcached-1.0/analyze.h index 33cd6ee9..a5c9d45a 100644 --- a/include/libmemcached-1.0/analyze.h +++ b/include/libmemcached-1.0/analyze.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #include "libmemcached-1.0/struct/analysis.h" @@ -44,8 +22,7 @@ extern "C" { #endif LIBMEMCACHED_API -memcached_analysis_st *memcached_analyze(memcached_st *memc, - memcached_stat_st *memc_stat, +memcached_analysis_st *memcached_analyze(memcached_st *memc, memcached_stat_st *memc_stat, memcached_return_t *error); LIBMEMCACHED_API diff --git a/include/libmemcached-1.0/auto.h b/include/libmemcached-1.0/auto.h index f37d50fc..ca1896e0 100644 --- a/include/libmemcached-1.0/auto.h +++ b/include/libmemcached-1.0/auto.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,69 +20,47 @@ extern "C" { #endif LIBMEMCACHED_API - memcached_return_t memcached_increment(memcached_st *ptr, - const char *key, size_t key_length, - uint32_t offset, - uint64_t *value); +memcached_return_t memcached_increment(memcached_st *ptr, const char *key, size_t key_length, + uint32_t offset, uint64_t *value); LIBMEMCACHED_API - memcached_return_t memcached_decrement(memcached_st *ptr, - const char *key, size_t key_length, - uint32_t offset, - uint64_t *value); +memcached_return_t memcached_decrement(memcached_st *ptr, const char *key, size_t key_length, + uint32_t offset, uint64_t *value); LIBMEMCACHED_API - memcached_return_t memcached_increment_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - uint64_t offset, - uint64_t *value); +memcached_return_t memcached_increment_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, uint64_t offset, uint64_t *value); LIBMEMCACHED_API - memcached_return_t memcached_decrement_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - uint64_t offset, - uint64_t *value); +memcached_return_t memcached_decrement_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, uint64_t offset, uint64_t *value); LIBMEMCACHED_API - memcached_return_t memcached_increment_with_initial(memcached_st *ptr, - const char *key, - size_t key_length, - uint64_t offset, - uint64_t initial, - time_t expiration, - uint64_t *value); +memcached_return_t memcached_increment_with_initial(memcached_st *ptr, const char *key, + size_t key_length, uint64_t offset, + uint64_t initial, time_t expiration, + uint64_t *value); LIBMEMCACHED_API - memcached_return_t memcached_decrement_with_initial(memcached_st *ptr, - const char *key, - size_t key_length, - uint64_t offset, - uint64_t initial, - time_t expiration, - uint64_t *value); +memcached_return_t memcached_decrement_with_initial(memcached_st *ptr, const char *key, + size_t key_length, uint64_t offset, + uint64_t initial, time_t expiration, + uint64_t *value); LIBMEMCACHED_API - memcached_return_t memcached_increment_with_initial_by_key(memcached_st *ptr, - const char *group_key, - size_t group_key_length, - const char *key, - size_t key_length, - uint64_t offset, - uint64_t initial, - time_t expiration, - uint64_t *value); +memcached_return_t memcached_increment_with_initial_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, uint64_t offset, + uint64_t initial, time_t expiration, + uint64_t *value); LIBMEMCACHED_API - memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *ptr, - const char *group_key, - size_t group_key_length, - const char *key, - size_t key_length, - uint64_t offset, - uint64_t initial, - time_t expiration, - uint64_t *value); +memcached_return_t memcached_decrement_with_initial_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, uint64_t offset, + uint64_t initial, time_t expiration, + uint64_t *value); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/basic_string.h b/include/libmemcached-1.0/basic_string.h index de8d3d51..27b160ce 100644 --- a/include/libmemcached-1.0/basic_string.h +++ b/include/libmemcached-1.0/basic_string.h @@ -1,38 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -43,13 +22,12 @@ struct memcached_string_t { size_t size; }; -#define memcached_size(X) (X).size; -#define memcached_c_str(X) (X).c_str; +#define memcached_size(X) (X).size; +#define memcached_c_str(X) (X).c_str; #define memcached_string_param(X) (X).c_str, (X).size #ifdef __cplusplus -#define memcached_string_printf(X) int((X).size), (X).c_str +# define memcached_string_printf(X) int((X).size), (X).c_str #else -#define memcached_string_printf(X) (int)((X).size), (X).c_str +# define memcached_string_printf(X) (int) ((X).size), (X).c_str #endif - diff --git a/include/libmemcached-1.0/behavior.h b/include/libmemcached-1.0/behavior.h index c6633532..42864b45 100644 --- a/include/libmemcached-1.0/behavior.h +++ b/include/libmemcached-1.0/behavior.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,13 +20,15 @@ extern "C" { #endif LIBMEMCACHED_API -memcached_return_t memcached_behavior_set(memcached_st *ptr, const memcached_behavior_t flag, uint64_t data); +memcached_return_t memcached_behavior_set(memcached_st *ptr, const memcached_behavior_t flag, + uint64_t data); LIBMEMCACHED_API uint64_t memcached_behavior_get(memcached_st *ptr, const memcached_behavior_t flag); LIBMEMCACHED_API -memcached_return_t memcached_behavior_set_distribution(memcached_st *ptr, memcached_server_distribution_t type); +memcached_return_t memcached_behavior_set_distribution(memcached_st *ptr, + memcached_server_distribution_t type); LIBMEMCACHED_API memcached_server_distribution_t memcached_behavior_get_distribution(memcached_st *ptr); @@ -60,23 +40,22 @@ LIBMEMCACHED_API memcached_hash_t memcached_behavior_get_key_hash(memcached_st *ptr); LIBMEMCACHED_API -memcached_return_t memcached_behavior_set_distribution_hash(memcached_st *ptr, memcached_hash_t type); +memcached_return_t memcached_behavior_set_distribution_hash(memcached_st *ptr, + memcached_hash_t type); LIBMEMCACHED_API memcached_hash_t memcached_behavior_get_distribution_hash(memcached_st *ptr); LIBMEMCACHED_API - const char *libmemcached_string_behavior(const memcached_behavior_t flag); +const char *libmemcached_string_behavior(const memcached_behavior_t flag); LIBMEMCACHED_API - const char *libmemcached_string_distribution(const memcached_server_distribution_t flag); +const char *libmemcached_string_distribution(const memcached_server_distribution_t flag); LIBMEMCACHED_API - memcached_return_t memcached_bucket_set(memcached_st *self, - const uint32_t *host_map, - const uint32_t *forward_map, - const uint32_t buckets, - const uint32_t replicas); +memcached_return_t memcached_bucket_set(memcached_st *self, const uint32_t *host_map, + const uint32_t *forward_map, const uint32_t buckets, + const uint32_t replicas); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/callback.h b/include/libmemcached-1.0/callback.h index a62e9aa6..2adef8e0 100644 --- a/include/libmemcached-1.0/callback.h +++ b/include/libmemcached-1.0/callback.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,12 +20,10 @@ extern "C" { #endif LIBMEMCACHED_API -memcached_return_t memcached_callback_set(memcached_st *ptr, - const memcached_callback_t flag, +memcached_return_t memcached_callback_set(memcached_st *ptr, const memcached_callback_t flag, const void *data); LIBMEMCACHED_API -void *memcached_callback_get(memcached_st *ptr, - const memcached_callback_t flag, +void *memcached_callback_get(memcached_st *ptr, const memcached_callback_t flag, memcached_return_t *error); #ifdef __cplusplus diff --git a/include/libmemcached-1.0/callbacks.h b/include/libmemcached-1.0/callbacks.h index 7ab8cb1c..4c578acb 100644 --- a/include/libmemcached-1.0/callbacks.h +++ b/include/libmemcached-1.0/callbacks.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -41,9 +19,12 @@ extern "C" { #endif -typedef memcached_return_t (*memcached_execute_fn)(const memcached_st *ptr, memcached_result_st *result, void *context); -typedef memcached_return_t (*memcached_server_fn)(const memcached_st *ptr, const memcached_instance_st * server, void *context); -typedef memcached_return_t (*memcached_stat_fn)(const memcached_instance_st * server, +typedef memcached_return_t (*memcached_execute_fn)(const memcached_st *ptr, + memcached_result_st *result, void *context); +typedef memcached_return_t (*memcached_server_fn)(const memcached_st *ptr, + const memcached_instance_st *server, + void *context); +typedef memcached_return_t (*memcached_stat_fn)(const memcached_instance_st *server, const char *key, size_t key_length, const char *value, size_t value_length, void *context); diff --git a/include/libmemcached-1.0/configure.h.in b/include/libmemcached-1.0/configure.h.in index 07d84429..dc54d90b 100644 --- a/include/libmemcached-1.0/configure.h.in +++ b/include/libmemcached-1.0/configure.h.in @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker, Trond Norbye All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -45,7 +23,7 @@ extern "C" { #cmakedefine01 LIBMEMCACHED_WITH_SASL_SUPPORT #define LIBMEMCACHED_VERSION_STRING "@LIBMEMCACHED_VERSION@" -#define LIBMEMCACHED_VERSION_HEX @LIBMEMCACHED_VERSION_HEX@ +#define LIBMEMCACHED_VERSION_HEX @LIBMEMCACHED_VERSION_HEX@ #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/defaults.h b/include/libmemcached-1.0/defaults.h index d440f8c8..3ce5667c 100644 --- a/include/libmemcached-1.0/defaults.h +++ b/include/libmemcached-1.0/defaults.h @@ -1,56 +1,34 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once /* Public defines */ -#define MEMCACHED_DEFAULT_PORT 11211 -#define MEMCACHED_DEFAULT_PORT_STRING "11211" -#define MEMCACHED_POINTS_PER_SERVER 100 +#define MEMCACHED_DEFAULT_PORT 11211 +#define MEMCACHED_DEFAULT_PORT_STRING "11211" +#define MEMCACHED_POINTS_PER_SERVER 100 #define MEMCACHED_POINTS_PER_SERVER_KETAMA 160 -#define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This would then set max hosts to 100 */ -#define MEMCACHED_STRIDE 4 -#define MEMCACHED_DEFAULT_TIMEOUT 5000 +#define MEMCACHED_CONTINUUM_SIZE \ + MEMCACHED_POINTS_PER_SERVER * 100 /* This would then set max hosts to 100 */ +#define MEMCACHED_STRIDE 4 +#define MEMCACHED_DEFAULT_TIMEOUT 5000 #define MEMCACHED_DEFAULT_CONNECT_TIMEOUT 4000 -#define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should build for in the continuum */ -#define MEMCACHED_EXPIRATION_NOT_ADD 0xffffffffU -#define MEMCACHED_SERVER_FAILURE_LIMIT 5 +#define MEMCACHED_CONTINUUM_ADDITION \ + 10 /* How many extra slots we should build for in the continuum */ +#define MEMCACHED_EXPIRATION_NOT_ADD 0xffffffffU +#define MEMCACHED_SERVER_FAILURE_LIMIT 5 #define MEMCACHED_SERVER_FAILURE_RETRY_TIMEOUT 2 -#define MEMCACHED_SERVER_FAILURE_DEAD_TIMEOUT 0 -#define MEMCACHED_SERVER_TIMEOUT_LIMIT 0 - +#define MEMCACHED_SERVER_FAILURE_DEAD_TIMEOUT 0 +#define MEMCACHED_SERVER_TIMEOUT_LIMIT 0 diff --git a/include/libmemcached-1.0/delete.h b/include/libmemcached-1.0/delete.h index 617d5857..80645066 100644 --- a/include/libmemcached-1.0/delete.h +++ b/include/libmemcached-1.0/delete.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -47,10 +24,9 @@ memcached_return_t memcached_delete(memcached_st *ptr, const char *key, size_t k time_t expiration); LIBMEMCACHED_API -memcached_return_t memcached_delete_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - time_t expiration); +memcached_return_t memcached_delete_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, time_t expiration); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/deprecated_types.h b/include/libmemcached-1.0/deprecated_types.h index 0a6df654..cae0173e 100644 --- a/include/libmemcached-1.0/deprecated_types.h +++ b/include/libmemcached-1.0/deprecated_types.h @@ -1,43 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - /* - * Warning, none of these should ever be used. - */ + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -58,4 +32,3 @@ typedef memcached_trigger_key_fn memcached_trigger_key; typedef memcached_trigger_delete_key_fn memcached_trigger_delete_key; typedef memcached_dump_fn memcached_dump_func; typedef memcached_instance_st *memcached_server_instance_st; - diff --git a/include/libmemcached-1.0/dump.h b/include/libmemcached-1.0/dump.h index b6e639e8..96ed43f1 100644 --- a/include/libmemcached-1.0/dump.h +++ b/include/libmemcached-1.0/dump.h @@ -1,50 +1,27 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once - #ifdef __cplusplus extern "C" { #endif LIBMEMCACHED_API -memcached_return_t memcached_dump(memcached_st *ptr, memcached_dump_fn *function, void *context, uint32_t number_of_callbacks); - +memcached_return_t memcached_dump(memcached_st *ptr, memcached_dump_fn *function, void *context, + uint32_t number_of_callbacks); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/encoding_key.h b/include/libmemcached-1.0/encoding_key.h index 3adbcb62..70289457 100644 --- a/include/libmemcached-1.0/encoding_key.h +++ b/include/libmemcached-1.0/encoding_key.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2012 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,7 +20,7 @@ extern "C" { #endif LIBMEMCACHED_API - memcached_return_t memcached_set_encoding_key(memcached_st*, const char *str, size_t length); +memcached_return_t memcached_set_encoding_key(memcached_st *, const char *str, size_t length); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/error.h b/include/libmemcached-1.0/error.h index 9346bb0b..56eac9dd 100644 --- a/include/libmemcached-1.0/error.h +++ b/include/libmemcached-1.0/error.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * LibMemcached - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,25 +20,25 @@ extern "C" { #endif LIBMEMCACHED_API - const char *memcached_error(const memcached_st *); +const char *memcached_error(const memcached_st *); LIBMEMCACHED_API - const char *memcached_last_error_message(const memcached_st *); +const char *memcached_last_error_message(const memcached_st *); LIBMEMCACHED_API - void memcached_error_print(const memcached_st *); +void memcached_error_print(const memcached_st *); LIBMEMCACHED_API - memcached_return_t memcached_last_error(const memcached_st *); +memcached_return_t memcached_last_error(const memcached_st *); LIBMEMCACHED_API - int memcached_last_error_errno(const memcached_st *); +int memcached_last_error_errno(const memcached_st *); LIBMEMCACHED_API - const char *memcached_server_error(const memcached_instance_st * ptr); +const char *memcached_server_error(const memcached_instance_st *ptr); LIBMEMCACHED_API - memcached_return_t memcached_server_error_return(const memcached_instance_st * ptr); +memcached_return_t memcached_server_error_return(const memcached_instance_st *ptr); #ifdef __cplusplus } // extern "C" diff --git a/include/libmemcached-1.0/exception.hpp b/include/libmemcached-1.0/exception.hpp index 4759072a..d7d74812 100644 --- a/include/libmemcached-1.0/exception.hpp +++ b/include/libmemcached-1.0/exception.hpp @@ -1,60 +1,57 @@ /* - * Summary: Exceptions for the C++ interface - * - * Copy: See Copyright for the status of this software. - * - */ - -/** - * @file - * @brief Exception declarations - */ + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once #include #include -namespace memcache -{ - class Exception : public std::runtime_error - { - public: - Exception(const std::string& msg, int in_errno) - : - std::runtime_error(msg), - _errno(in_errno) - {} - - Exception(const char *msg, int in_errno) - : - std::runtime_error(std::string(msg)), - _errno(in_errno) {} - - virtual ~Exception() throw() {} - - int getErrno() const - { - return _errno; - } - - private: - int _errno; - }; - - class Warning : public Exception - { - public: - Warning(const std::string& msg, int in_errno) : Exception(msg, in_errno) {} - Warning(const char *msg, int in_errno) : Exception(msg, in_errno) {} - }; - - class Error : public Exception - { - public: - Error(const std::string& msg, int in_errno) : Exception(msg, in_errno) {} - Error(const char *msg, int in_errno) : Exception(msg, in_errno) {} - virtual ~Error() throw() {} - }; - -} /* namespace libmemcached */ +namespace memcache { +class Exception : public std::runtime_error { +public: + Exception(const std::string &msg, int in_errno) + : std::runtime_error(msg) + , _errno(in_errno) {} + + Exception(const char *msg, int in_errno) + : std::runtime_error(std::string(msg)) + , _errno(in_errno) {} + + virtual ~Exception() throw() {} + + int getErrno() const { return _errno; } + +private: + int _errno; +}; + +class Warning : public Exception { +public: + Warning(const std::string &msg, int in_errno) + : Exception(msg, in_errno) {} + Warning(const char *msg, int in_errno) + : Exception(msg, in_errno) {} +}; + +class Error : public Exception { +public: + Error(const std::string &msg, int in_errno) + : Exception(msg, in_errno) {} + Error(const char *msg, int in_errno) + : Exception(msg, in_errno) {} + virtual ~Error() throw() {} +}; + +} // namespace memcache diff --git a/include/libmemcached-1.0/exist.h b/include/libmemcached-1.0/exist.h index ef60a81a..7ec1e4bb 100644 --- a/include/libmemcached-1.0/exist.h +++ b/include/libmemcached-1.0/exist.h @@ -1,38 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -44,9 +23,9 @@ LIBMEMCACHED_API memcached_return_t memcached_exist(memcached_st *memc, const char *key, size_t key_length); LIBMEMCACHED_API -memcached_return_t memcached_exist_by_key(memcached_st *memc, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length); +memcached_return_t memcached_exist_by_key(memcached_st *memc, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length); #ifdef __cplusplus } #endif diff --git a/include/libmemcached-1.0/fetch.h b/include/libmemcached-1.0/fetch.h index bff186ac..62a6c135 100644 --- a/include/libmemcached-1.0/fetch.h +++ b/include/libmemcached-1.0/fetch.h @@ -1,52 +1,27 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once - #ifdef __cplusplus extern "C" { #endif LIBMEMCACHED_API -memcached_return_t memcached_fetch_execute(memcached_st *ptr, - memcached_execute_fn *callback, - void *context, - uint32_t number_of_callbacks); +memcached_return_t memcached_fetch_execute(memcached_st *ptr, memcached_execute_fn *callback, + void *context, uint32_t number_of_callbacks); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/flush.h b/include/libmemcached-1.0/flush.h index 820a98e7..cdf35a23 100644 --- a/include/libmemcached-1.0/flush.h +++ b/include/libmemcached-1.0/flush.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/flush_buffers.h b/include/libmemcached-1.0/flush_buffers.h index 31b58687..49df03cb 100644 --- a/include/libmemcached-1.0/flush_buffers.h +++ b/include/libmemcached-1.0/flush_buffers.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/get.h b/include/libmemcached-1.0/get.h index 32e4c5f3..db94dfcd 100644 --- a/include/libmemcached-1.0/get.h +++ b/include/libmemcached-1.0/get.h @@ -1,108 +1,62 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once - #ifdef __cplusplus extern "C" { #endif /* Public defines */ LIBMEMCACHED_API -char *memcached_get(memcached_st *ptr, - const char *key, size_t key_length, - size_t *value_length, - uint32_t *flags, - memcached_return_t *error); +char *memcached_get(memcached_st *ptr, const char *key, size_t key_length, size_t *value_length, + uint32_t *flags, memcached_return_t *error); LIBMEMCACHED_API -memcached_return_t memcached_mget(memcached_st *ptr, - const char * const *keys, - const size_t *key_length, - size_t number_of_keys); +memcached_return_t memcached_mget(memcached_st *ptr, const char *const *keys, + const size_t *key_length, size_t number_of_keys); LIBMEMCACHED_API -char *memcached_get_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - size_t *value_length, - uint32_t *flags, - memcached_return_t *error); +char *memcached_get_by_key(memcached_st *ptr, const char *group_key, size_t group_key_length, + const char *key, size_t key_length, size_t *value_length, + uint32_t *flags, memcached_return_t *error); LIBMEMCACHED_API -memcached_return_t memcached_mget_by_key(memcached_st *ptr, - const char *group_key, - size_t group_key_length, - const char * const *keys, - const size_t *key_length, - const size_t number_of_keys); +memcached_return_t memcached_mget_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *const *keys, + const size_t *key_length, const size_t number_of_keys); LIBMEMCACHED_API -char *memcached_fetch(memcached_st *ptr, - char *key, - size_t *key_length, - size_t *value_length, - uint32_t *flags, - memcached_return_t *error); +char *memcached_fetch(memcached_st *ptr, char *key, size_t *key_length, size_t *value_length, + uint32_t *flags, memcached_return_t *error); LIBMEMCACHED_API -memcached_result_st *memcached_fetch_result(memcached_st *ptr, - memcached_result_st *result, +memcached_result_st *memcached_fetch_result(memcached_st *ptr, memcached_result_st *result, memcached_return_t *error); LIBMEMCACHED_API -memcached_return_t memcached_mget_execute(memcached_st *ptr, - const char * const *keys, - const size_t *key_length, - const size_t number_of_keys, - memcached_execute_fn *callback, - void *context, +memcached_return_t memcached_mget_execute(memcached_st *ptr, const char *const *keys, + const size_t *key_length, const size_t number_of_keys, + memcached_execute_fn *callback, void *context, const uint32_t number_of_callbacks); LIBMEMCACHED_API -memcached_return_t memcached_mget_execute_by_key(memcached_st *ptr, - const char *group_key, - size_t group_key_length, - const char * const *keys, - const size_t *key_length, - size_t number_of_keys, - memcached_execute_fn *callback, - void *context, +memcached_return_t memcached_mget_execute_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *const *keys, + const size_t *key_length, size_t number_of_keys, + memcached_execute_fn *callback, void *context, const uint32_t number_of_callbacks); #ifdef __cplusplus diff --git a/include/libmemcached-1.0/hash.h b/include/libmemcached-1.0/hash.h index 9fdb7d6f..d72e6791 100644 --- a/include/libmemcached-1.0/hash.h +++ b/include/libmemcached-1.0/hash.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -43,7 +21,8 @@ extern "C" { /* The two public hash bits */ LIBMEMCACHED_API -uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash_t hash_algorithm); +uint32_t memcached_generate_hash_value(const char *key, size_t key_length, + memcached_hash_t hash_algorithm); LIBMEMCACHED_API const hashkit_st *memcached_get_hashkit(const memcached_st *ptr); @@ -58,7 +37,7 @@ LIBMEMCACHED_API void memcached_autoeject(memcached_st *ptr); LIBMEMCACHED_API - const char * libmemcached_string_hash(memcached_hash_t type); +const char *libmemcached_string_hash(memcached_hash_t type); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/limits.h b/include/libmemcached-1.0/limits.h index c2a636f2..f4d0ed65 100644 --- a/include/libmemcached-1.0/limits.h +++ b/include/libmemcached-1.0/limits.h @@ -1,51 +1,28 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once -#define MEMCACHED_MAX_BUFFER 8196 -#define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */ +#define MEMCACHED_MAX_BUFFER 8196 +#define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */ #define MEMCACHED_MAX_NAMESPACE 128 -#define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */ +#define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */ #define MEMCACHED_MAX_INTEGER_DISPLAY_LENGTH 20 -#define MEMCACHED_VERSION_STRING_LENGTH 24 +#define MEMCACHED_VERSION_STRING_LENGTH 24 /* legacy */ #define MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH MEMCACHED_MAX_INTEGER_DISPLAY_LENGTH -#define MEMCACHED_PREFIX_KEY_MAX_SIZE MEMCACHED_MAX_NAMESPACE +#define MEMCACHED_PREFIX_KEY_MAX_SIZE MEMCACHED_MAX_NAMESPACE diff --git a/include/libmemcached-1.0/memcached.h b/include/libmemcached-1.0/memcached.h index 5a7f870e..065fb24f 100644 --- a/include/libmemcached-1.0/memcached.h +++ b/include/libmemcached-1.0/memcached.h @@ -1,43 +1,22 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once -/* This seems to be required for older compilers @note http://stackoverflow.com/questions/8132399/how-to-printf-uint64-t */ +/* This seems to be required for older compilers @note + * http://stackoverflow.com/questions/8132399/how-to-printf-uint64-t */ #ifndef __STDC_FORMAT_MACROS # define __STDC_FORMAT_MACROS #endif @@ -160,7 +139,8 @@ LIBMEMCACHED_API memcached_return_t memcached_push(memcached_st *destination, const memcached_st *source); LIBMEMCACHED_API -const memcached_instance_st * memcached_server_instance_by_position(const memcached_st *ptr, uint32_t server_key); +const memcached_instance_st *memcached_server_instance_by_position(const memcached_st *ptr, + uint32_t server_key); LIBMEMCACHED_API uint32_t memcached_server_count(const memcached_st *); diff --git a/include/libmemcached-1.0/memcached.hpp b/include/libmemcached-1.0/memcached.hpp index aa25040c..54e89cf3 100644 --- a/include/libmemcached-1.0/memcached.hpp +++ b/include/libmemcached-1.0/memcached.hpp @@ -1,58 +1,23 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - /* - * Summary: C++ interface for memcached server - * - * Copy: See Copyright for the status of this software. - * - * Authors: Padraig O'Sullivan - * Patrick Galbraith - */ - -/** - * @file memcached.hpp - * @brief Libmemcached C++ interface - */ + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once #include "libmemcached-1.0/memcached.h" #if 0 -#include "libmemcached/exception.hpp" +# include "libmemcached/exception.hpp" #endif #include @@ -62,69 +27,44 @@ #include #include -namespace memcache -{ +namespace memcache { /** * This is the core memcached library (if later, other objects * are needed, they will be created from this class). */ -class Memcache -{ +class Memcache { public: + Memcache() { memc_ = memcached(NULL, 0); } - Memcache() - { - memc_= memcached(NULL, 0); - } + Memcache(const std::string &config) { memc_ = memcached(config.c_str(), config.size()); } - Memcache(const std::string &config) - { - memc_= memcached(config.c_str(), config.size()); - } - - Memcache(const std::string &hostname, in_port_t port) - { - memc_= memcached(NULL, 0); - if (memc_) - { + Memcache(const std::string &hostname, in_port_t port) { + memc_ = memcached(NULL, 0); + if (memc_) { memcached_server_add(memc_, hostname.c_str(), port); } } - Memcache(memcached_st *clone) - { - memc_= memcached_clone(NULL, clone); - } + Memcache(memcached_st *clone) { memc_ = memcached_clone(NULL, clone); } - Memcache(const Memcache &rhs) - { - memc_= memcached_clone(NULL, rhs.getImpl()); - } + Memcache(const Memcache &rhs) { memc_ = memcached_clone(NULL, rhs.getImpl()); } - Memcache &operator=(const Memcache &rhs) - { - if (this != &rhs) - { + Memcache &operator=(const Memcache &rhs) { + if (this != &rhs) { memcached_free(memc_); - memc_= memcached_clone(NULL, rhs.getImpl()); + memc_ = memcached_clone(NULL, rhs.getImpl()); } return *this; } - ~Memcache() - { - memcached_free(memc_); - } + ~Memcache() { memcached_free(memc_); } /** * Get the internal memcached_st * */ - const memcached_st *getImpl() const - { - return memc_; - } + const memcached_st *getImpl() const { return memc_; } /** * Return an error string for the given return structure. @@ -132,48 +72,38 @@ public: * @param[in] rc a memcached_return_t structure * @return error string corresponding to given return code in the library. */ - const std::string getError(memcached_return_t rc) const - { + const std::string getError(memcached_return_t rc) const { /* first parameter to strerror is unused */ return memcached_strerror(NULL, rc); } - bool error(std::string& error_message) const - { - if (memcached_failed(memcached_last_error(memc_))) - { - error_message+= memcached_last_error_message(memc_); + bool error(std::string &error_message) const { + if (memcached_failed(memcached_last_error(memc_))) { + error_message += memcached_last_error_message(memc_); return true; } return false; } - bool error() const - { - if (memcached_failed(memcached_last_error(memc_))) - { + bool error() const { + if (memcached_failed(memcached_last_error(memc_))) { return true; } return false; } - bool error(memcached_return_t& arg) const - { - arg= memcached_last_error(memc_); + bool error(memcached_return_t &arg) const { + arg = memcached_last_error(memc_); return memcached_failed(arg); } - bool setBehavior(memcached_behavior_t flag, uint64_t data) - { + bool setBehavior(memcached_behavior_t flag, uint64_t data) { return (memcached_success(memcached_behavior_set(memc_, flag, data))); } - uint64_t getBehavior(memcached_behavior_t flag) - { - return memcached_behavior_get(memc_, flag); - } + uint64_t getBehavior(memcached_behavior_t flag) { return memcached_behavior_get(memc_, flag); } /** * Configure the memcache object @@ -181,14 +111,12 @@ public: * @param[in] in_config configuration * @return true on success; false otherwise */ - bool configure(const std::string &configuration) - { - memcached_st *new_memc= memcached(configuration.c_str(), configuration.size()); + bool configure(const std::string &configuration) { + memcached_st *new_memc = memcached(configuration.c_str(), configuration.size()); - if (new_memc) - { + if (new_memc) { memcached_free(memc_); - memc_= new_memc; + memc_ = new_memc; return true; } @@ -203,8 +131,7 @@ public: * @param[in] port port number of server to add * @return true on success; false otherwise */ - bool addServer(const std::string &server_name, in_port_t port) - { + bool addServer(const std::string &server_name, in_port_t port) { return memcached_success(memcached_server_add(memc_, server_name.c_str(), port)); } @@ -215,8 +142,7 @@ public: * @param[in] port port number of server to remove * @return true on success; false otherwise */ - bool removeServer(const std::string &server_name, in_port_t port) - { + bool removeServer(const std::string &server_name, in_port_t port) { std::string tmp_str; std::ostringstream strstm; tmp_str.append(","); @@ -225,8 +151,8 @@ public: strstm << port; tmp_str.append(strstm.str()); - //memcached_return_t rc= memcached_server_remove(server); - + // memcached_return_t rc= memcached_server_remove(server); + return false; } @@ -238,39 +164,33 @@ public: * @param[out] ret_val store returned object in this vector * @return a memcached return structure */ - memcached_return_t fetch(std::string &key, - std::vector &ret_val, - uint32_t &flags, - uint64_t &cas_value) - { + memcached_return_t fetch(std::string &key, std::vector &ret_val, uint32_t &flags, + uint64_t &cas_value) { memcached_return_t rc; memcached_result_st *result; - if ((result= memcached_fetch_result(memc_, NULL, &rc))) - { + if ((result = memcached_fetch_result(memc_, NULL, &rc))) { // Key key.assign(memcached_result_key_value(result), memcached_result_key_length(result)); // Actual value, null terminated - ret_val.reserve(memcached_result_length(result) +1); + ret_val.reserve(memcached_result_length(result) + 1); ret_val.assign(memcached_result_value(result), - memcached_result_value(result) +memcached_result_length(result) +1); + memcached_result_value(result) + memcached_result_length(result) + 1); ret_val.resize(memcached_result_length(result)); // Misc - flags= memcached_result_flags(result); - cas_value= memcached_result_cas(result); + flags = memcached_result_flags(result); + cas_value = memcached_result_cas(result); } memcached_result_free(result); return rc; } - memcached_return_t fetch(std::string &key, - std::vector &ret_val) - { - uint32_t flags= 0; - uint64_t cas_value= 0; + memcached_return_t fetch(std::string &key, std::vector &ret_val) { + uint32_t flags = 0; + uint64_t cas_value = 0; return fetch(key, ret_val, flags, cas_value); } @@ -283,18 +203,15 @@ public: * this vector * @return true on success; false otherwise */ - bool get(const std::string &key, std::vector &ret_val) - { - uint32_t flags= 0; + bool get(const std::string &key, std::vector &ret_val) { + uint32_t flags = 0; memcached_return_t rc; - size_t value_length= 0; - - char *value= memcached_get(memc_, key.c_str(), key.length(), - &value_length, &flags, &rc); - if (value != NULL && ret_val.empty()) - { - ret_val.reserve(value_length +1); // Always provide null - ret_val.assign(value, value +value_length +1); + size_t value_length = 0; + + char *value = memcached_get(memc_, key.c_str(), key.length(), &value_length, &flags, &rc); + if (value != NULL && ret_val.empty()) { + ret_val.reserve(value_length + 1); // Always provide null + ret_val.assign(value, value + value_length + 1); ret_val.resize(value_length); free(value); @@ -316,22 +233,16 @@ public: * this vector * @return true on success; false otherwise */ - bool getByKey(const std::string &master_key, - const std::string &key, - std::vector &ret_val) - { - uint32_t flags= 0; + bool getByKey(const std::string &master_key, const std::string &key, std::vector &ret_val) { + uint32_t flags = 0; memcached_return_t rc; - size_t value_length= 0; - - char *value= memcached_get_by_key(memc_, - master_key.c_str(), master_key.length(), - key.c_str(), key.length(), - &value_length, &flags, &rc); - if (value) - { - ret_val.reserve(value_length +1); // Always provide null - ret_val.assign(value, value +value_length +1); + size_t value_length = 0; + + char *value = memcached_get_by_key(memc_, master_key.c_str(), master_key.length(), key.c_str(), + key.length(), &value_length, &flags, &rc); + if (value) { + ret_val.reserve(value_length + 1); // Always provide null + ret_val.assign(value, value + value_length + 1); ret_val.resize(value_length); free(value); @@ -347,8 +258,7 @@ public: * @param[in] keys vector of keys to select * @return true if all keys are found */ - bool mget(const std::vector& keys) - { + bool mget(const std::vector &keys) { std::vector real_keys; std::vector key_len; /* @@ -360,10 +270,9 @@ public: real_keys.reserve(keys.size()); key_len.reserve(keys.size()); - std::vector::const_iterator it= keys.begin(); + std::vector::const_iterator it = keys.begin(); - while (it != keys.end()) - { + while (it != keys.end()) { real_keys.push_back(const_cast((*it).c_str())); key_len.push_back((*it).length()); ++it; @@ -373,8 +282,7 @@ public: * If the std::vector of keys is empty then we cannot * call memcached_mget as we will get undefined behavior. */ - if (not real_keys.empty()) - { + if (not real_keys.empty()) { return memcached_success(memcached_mget(memc_, &real_keys[0], &key_len[0], real_keys.size())); } @@ -392,27 +300,17 @@ public: * @param[in] flags flags to store with the object * @return true on succcess; false otherwise */ - bool set(const std::string &key, - const std::vector &value, - time_t expiration, - uint32_t flags) - { - memcached_return_t rc= memcached_set(memc_, - key.c_str(), key.length(), - value.data(), value.size(), - expiration, flags); + bool set(const std::string &key, const std::vector &value, time_t expiration, + uint32_t flags) { + memcached_return_t rc = memcached_set(memc_, key.c_str(), key.length(), value.data(), + value.size(), expiration, flags); return memcached_success(rc); } - bool set(const std::string &key, - const char* value, const size_t value_length, - time_t expiration, - uint32_t flags) - { - memcached_return_t rc= memcached_set(memc_, - key.c_str(), key.length(), - value, value_length, - expiration, flags); + bool set(const std::string &key, const char *value, const size_t value_length, time_t expiration, + uint32_t flags) { + memcached_return_t rc = + memcached_set(memc_, key.c_str(), key.length(), value, value_length, expiration, flags); return memcached_success(rc); } @@ -427,18 +325,11 @@ public: * @param[in] flags flags to store with the object * @return true on succcess; false otherwise */ - bool setByKey(const std::string& master_key, - const std::string& key, - const std::vector &value, - time_t expiration, - uint32_t flags) - { - return memcached_success(memcached_set_by_key(memc_, master_key.c_str(), - master_key.length(), - key.c_str(), key.length(), - &value[0], value.size(), - expiration, - flags)); + bool setByKey(const std::string &master_key, const std::string &key, + const std::vector &value, time_t expiration, uint32_t flags) { + return memcached_success(memcached_set_by_key(memc_, master_key.c_str(), master_key.length(), + key.c_str(), key.length(), &value[0], + value.size(), expiration, flags)); } /** @@ -451,19 +342,14 @@ public: * @param[in] flags flags to store with the objects * @return true on success; false otherwise */ - bool setAll(const std::vector& keys, - const std::vector< std::vector *>& values, - time_t expiration, - uint32_t flags) - { - bool retval= true; - std::vector::const_iterator key_it= keys.begin(); - std::vector< std::vector *>::const_iterator val_it= values.begin(); - while (key_it != keys.end()) - { - retval= set((*key_it), *(*val_it), expiration, flags); - if (retval == false) - { + bool setAll(const std::vector &keys, const std::vector *> &values, + time_t expiration, uint32_t flags) { + bool retval = true; + std::vector::const_iterator key_it = keys.begin(); + std::vector *>::const_iterator val_it = values.begin(); + while (key_it != keys.end()) { + retval = set((*key_it), *(*val_it), expiration, flags); + if (retval == false) { return retval; } ++key_it; @@ -481,16 +367,12 @@ public: * @param[in] flags flags to store with the objects * @return true on success; false otherwise */ - bool setAll(const std::map >& key_value_map, - time_t expiration, - uint32_t flags) - { - std::map >::const_iterator it= key_value_map.begin(); + bool setAll(const std::map> &key_value_map, + time_t expiration, uint32_t flags) { + std::map>::const_iterator it = key_value_map.begin(); - while (it != key_value_map.end()) - { - if (!set(it->first, it->second, expiration, flags)) - { + while (it != key_value_map.end()) { + if (!set(it->first, it->second, expiration, flags)) { // We should tell the user what the key that failed was return false; } @@ -510,8 +392,7 @@ public: * @param[out] value store the result of the increment here * @return true on success; false otherwise */ - bool increment(const std::string& key, uint32_t offset, uint64_t *value) - { + bool increment(const std::string &key, uint32_t offset, uint64_t *value) { return memcached_success(memcached_increment(memc_, key.c_str(), key.length(), offset, value)); } @@ -525,14 +406,10 @@ public: * @param[out] value store the result of the decrement here * @return true on success; false otherwise */ - bool decrement(const std::string& key, uint32_t offset, uint64_t *value) - { - return memcached_success(memcached_decrement(memc_, key.c_str(), - key.length(), - offset, value)); + bool decrement(const std::string &key, uint32_t offset, uint64_t *value) { + return memcached_success(memcached_decrement(memc_, key.c_str(), key.length(), offset, value)); } - /** * Add an object with the specified key and value to the server. This * function returns false if the object already exists on the server. @@ -541,10 +418,9 @@ public: * @param[in] value of object to add * @return true on success; false otherwise */ - bool add(const std::string& key, const std::vector& value) - { - return memcached_success(memcached_add(memc_, key.c_str(), key.length(), - &value[0], value.size(), 0, 0)); + bool add(const std::string &key, const std::vector &value) { + return memcached_success( + memcached_add(memc_, key.c_str(), key.length(), &value[0], value.size(), 0, 0)); } /** @@ -557,18 +433,11 @@ public: * @param[in] value of object to add * @return true on success; false otherwise */ - bool addByKey(const std::string& master_key, - const std::string& key, - const std::vector& value) - { - return memcached_success(memcached_add_by_key(memc_, - master_key.c_str(), - master_key.length(), - key.c_str(), - key.length(), - &value[0], - value.size(), - 0, 0)); + bool addByKey(const std::string &master_key, const std::string &key, + const std::vector &value) { + return memcached_success(memcached_add_by_key(memc_, master_key.c_str(), master_key.length(), + key.c_str(), key.length(), &value[0], + value.size(), 0, 0)); } /** @@ -579,11 +448,9 @@ public: * @param[in[ value value to replace object with * @return true on success; false otherwise */ - bool replace(const std::string& key, const std::vector& value) - { - return memcached_success(memcached_replace(memc_, key.c_str(), key.length(), - &value[0], value.size(), - 0, 0)); + bool replace(const std::string &key, const std::vector &value) { + return memcached_success( + memcached_replace(memc_, key.c_str(), key.length(), &value[0], value.size(), 0, 0)); } /** @@ -596,18 +463,11 @@ public: * @param[in[ value value to replace object with * @return true on success; false otherwise */ - bool replaceByKey(const std::string& master_key, - const std::string& key, - const std::vector& value) - { - return memcached_success(memcached_replace_by_key(memc_, - master_key.c_str(), - master_key.length(), - key.c_str(), - key.length(), - &value[0], - value.size(), - 0, 0)); + bool replaceByKey(const std::string &master_key, const std::string &key, + const std::vector &value) { + return memcached_success(memcached_replace_by_key(memc_, master_key.c_str(), + master_key.length(), key.c_str(), + key.length(), &value[0], value.size(), 0, 0)); } /** @@ -617,10 +477,9 @@ public: * @param[in] value data to prepend to object's value * @return true on success; false otherwise */ - bool prepend(const std::string& key, const std::vector& value) - { - return memcached_success(memcached_prepend(memc_, key.c_str(), key.length(), - &value[0], value.size(), 0, 0)); + bool prepend(const std::string &key, const std::vector &value) { + return memcached_success( + memcached_prepend(memc_, key.c_str(), key.length(), &value[0], value.size(), 0, 0)); } /** @@ -633,19 +492,11 @@ public: * @param[in] value data to prepend to object's value * @return true on success; false otherwise */ - bool prependByKey(const std::string& master_key, - const std::string& key, - const std::vector& value) - { - return memcached_success(memcached_prepend_by_key(memc_, - master_key.c_str(), - master_key.length(), - key.c_str(), - key.length(), - &value[0], - value.size(), - 0, - 0)); + bool prependByKey(const std::string &master_key, const std::string &key, + const std::vector &value) { + return memcached_success(memcached_prepend_by_key(memc_, master_key.c_str(), + master_key.length(), key.c_str(), + key.length(), &value[0], value.size(), 0, 0)); } /** @@ -655,14 +506,9 @@ public: * @param[in] value data to append to object's value * @return true on success; false otherwise */ - bool append(const std::string& key, const std::vector& value) - { - return memcached_success(memcached_append(memc_, - key.c_str(), - key.length(), - &value[0], - value.size(), - 0, 0)); + bool append(const std::string &key, const std::vector &value) { + return memcached_success( + memcached_append(memc_, key.c_str(), key.length(), &value[0], value.size(), 0, 0)); } /** @@ -675,18 +521,11 @@ public: * @param[in] value data to append to object's value * @return true on success; false otherwise */ - bool appendByKey(const std::string& master_key, - const std::string& key, - const std::vector &value) - { - return memcached_success(memcached_append_by_key(memc_, - master_key.c_str(), - master_key.length(), - key.c_str(), - key.length(), - &value[0], - value.size(), - 0, 0)); + bool appendByKey(const std::string &master_key, const std::string &key, + const std::vector &value) { + return memcached_success(memcached_append_by_key(memc_, master_key.c_str(), master_key.length(), + key.c_str(), key.length(), &value[0], + value.size(), 0, 0)); } /** @@ -697,13 +536,9 @@ public: * @param[in] value value to store for object in server * @param[in] cas_arg "cas" value */ - bool cas(const std::string& key, - const std::vector& value, - uint64_t cas_arg) - { - return memcached_success(memcached_cas(memc_, key.c_str(), key.length(), - &value[0], value.size(), - 0, 0, cas_arg)); + bool cas(const std::string &key, const std::vector &value, uint64_t cas_arg) { + return memcached_success( + memcached_cas(memc_, key.c_str(), key.length(), &value[0], value.size(), 0, 0, cas_arg)); } /** @@ -716,19 +551,11 @@ public: * @param[in] value value to store for object in server * @param[in] cas_arg "cas" value */ - bool casByKey(const std::string& master_key, - const std::string& key, - const std::vector &value, - uint64_t cas_arg) - { - return memcached_success(memcached_cas_by_key(memc_, - master_key.c_str(), - master_key.length(), - key.c_str(), - key.length(), - &value[0], - value.size(), - 0, 0, cas_arg)); + bool casByKey(const std::string &master_key, const std::string &key, + const std::vector &value, uint64_t cas_arg) { + return memcached_success(memcached_cas_by_key(memc_, master_key.c_str(), master_key.length(), + key.c_str(), key.length(), &value[0], + value.size(), 0, 0, cas_arg)); } /** @@ -737,8 +564,7 @@ public: * @param[in] key key of object to delete * @return true on success; false otherwise */ - bool remove(const std::string& key) - { + bool remove(const std::string &key) { return memcached_success(memcached_delete(memc_, key.c_str(), key.length(), 0)); } @@ -749,12 +575,8 @@ public: * @param[in] expiration time to delete the object after * @return true on success; false otherwise */ - bool remove(const std::string& key, time_t expiration) - { - return memcached_success(memcached_delete(memc_, - key.c_str(), - key.length(), - expiration)); + bool remove(const std::string &key, time_t expiration) { + return memcached_success(memcached_delete(memc_, key.c_str(), key.length(), expiration)); } /** @@ -764,15 +586,9 @@ public: * @param[in] key key of object to delete * @return true on success; false otherwise */ - bool removeByKey(const std::string& master_key, - const std::string& key) - { - return memcached_success(memcached_delete_by_key(memc_, - master_key.c_str(), - master_key.length(), - key.c_str(), - key.length(), - 0)); + bool removeByKey(const std::string &master_key, const std::string &key) { + return memcached_success(memcached_delete_by_key(memc_, master_key.c_str(), master_key.length(), + key.c_str(), key.length(), 0)); } /** @@ -783,16 +599,9 @@ public: * @param[in] expiration time to delete the object after * @return true on success; false otherwise */ - bool removeByKey(const std::string& master_key, - const std::string& key, - time_t expiration) - { - return memcached_success(memcached_delete_by_key(memc_, - master_key.c_str(), - master_key.length(), - key.c_str(), - key.length(), - expiration)); + bool removeByKey(const std::string &master_key, const std::string &key, time_t expiration) { + return memcached_success(memcached_delete_by_key(memc_, master_key.c_str(), master_key.length(), + key.c_str(), key.length(), expiration)); } /** @@ -802,8 +611,7 @@ public: * memcached servers * @return true on success; false otherwise */ - bool flush(time_t expiration= 0) - { + bool flush(time_t expiration = 0) { return memcached_success(memcached_flush(memc_, expiration)); } @@ -811,9 +619,8 @@ public: * Get the library version string. * @return std::string containing a copy of the library version string. */ - const std::string libVersion() const - { - const char *ver= memcached_lib_version(); + const std::string libVersion() const { + const char *ver = memcached_lib_version(); const std::string version(ver); return version; } @@ -826,26 +633,22 @@ public: * stats * @return true on success; false otherwise */ - bool getStats(std::map< std::string, std::map >& stats_map) - { + bool getStats(std::map> &stats_map) { memcached_return_t rc; - memcached_stat_st *stats= memcached_stat(memc_, NULL, &rc); + memcached_stat_st *stats = memcached_stat(memc_, NULL, &rc); - if (rc != MEMCACHED_SUCCESS && - rc != MEMCACHED_SOME_ERRORS) - { + if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_SOME_ERRORS) { return false; } - uint32_t server_count= memcached_server_count(memc_); + uint32_t server_count = memcached_server_count(memc_); /* * For each memcached server, construct a std::map for its stats and add * it to the std::map of overall stats. */ - for (uint32_t x= 0; x < server_count; x++) - { - const memcached_instance_st * instance= memcached_server_instance_by_position(memc_, x); + for (uint32_t x = 0; x < server_count; x++) { + const memcached_instance_st *instance = memcached_server_instance_by_position(memc_, x); std::ostringstream strstm; std::string server_name(memcached_server_name(instance)); server_name.append(":"); @@ -853,15 +656,14 @@ public: server_name.append(strstm.str()); std::map server_stats; - char **list= memcached_stat_get_keys(memc_, &stats[x], &rc); - for (char** ptr= list; *ptr; ptr++) - { - char *value= memcached_stat_get_value(memc_, &stats[x], *ptr, &rc); - server_stats[*ptr]= value; + char **list = memcached_stat_get_keys(memc_, &stats[x], &rc); + for (char **ptr = list; *ptr; ptr++) { + char *value = memcached_stat_get_value(memc_, &stats[x], *ptr, &rc); + server_stats[*ptr] = value; free(value); } - - stats_map[server_name]= server_stats; + + stats_map[server_name] = server_stats; free(list); } @@ -873,4 +675,4 @@ private: memcached_st *memc_; }; -} +} // namespace memcache diff --git a/include/libmemcached-1.0/options.h b/include/libmemcached-1.0/options.h index f5a6e06d..adba74cd 100644 --- a/include/libmemcached-1.0/options.h +++ b/include/libmemcached-1.0/options.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,7 +20,8 @@ extern "C" { #endif LIBMEMCACHED_API - memcached_return_t libmemcached_check_configuration(const char *option_string, size_t length, char *error_buffer, size_t error_buffer_size); +memcached_return_t libmemcached_check_configuration(const char *option_string, size_t length, + char *error_buffer, size_t error_buffer_size); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/parse.h b/include/libmemcached-1.0/parse.h index a91f769d..b8029ae9 100644 --- a/include/libmemcached-1.0/parse.h +++ b/include/libmemcached-1.0/parse.h @@ -1,13 +1,17 @@ -/* LibMemcached - * Copyright (C) 2010 Brian Aker - * All rights reserved. - * - * Use and distribution licensed under the BSD license. See - * the COPYING file in the parent directory for full text. - * - * Summary: Work with fetching results - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/platform.h b/include/libmemcached-1.0/platform.h index efdf53f8..55f7688e 100644 --- a/include/libmemcached-1.0/platform.h +++ b/include/libmemcached-1.0/platform.h @@ -1,61 +1,38 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once - #if defined(_WIN32) -# include -# include +# include +# include -#ifndef HAVE_IN_PORT_T +# ifndef HAVE_IN_PORT_T typedef int in_port_t; -# define HAVE_IN_PORT_T 1 -#endif +# define HAVE_IN_PORT_T 1 +# endif typedef SOCKET memcached_socket_t; #else -# include -# include -# include -# include -# include -# include +# include +# include +# include +# include +# include +# include typedef int memcached_socket_t; diff --git a/include/libmemcached-1.0/quit.h b/include/libmemcached-1.0/quit.h index 90ff3ff0..f9ad396d 100644 --- a/include/libmemcached-1.0/quit.h +++ b/include/libmemcached-1.0/quit.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/result.h b/include/libmemcached-1.0/result.h index f07e1e75..301d0c11 100644 --- a/include/libmemcached-1.0/result.h +++ b/include/libmemcached-1.0/result.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #include "libmemcached-1.0/struct/result.h" @@ -51,8 +29,7 @@ LIBMEMCACHED_API void memcached_result_reset(memcached_result_st *ptr); LIBMEMCACHED_API -memcached_result_st *memcached_result_create(const memcached_st *ptr, - memcached_result_st *result); +memcached_result_st *memcached_result_create(const memcached_st *ptr, memcached_result_st *result); LIBMEMCACHED_API const char *memcached_result_key_value(const memcached_result_st *self); @@ -76,7 +53,8 @@ LIBMEMCACHED_API uint64_t memcached_result_cas(const memcached_result_st *self); LIBMEMCACHED_API -memcached_return_t memcached_result_set_value(memcached_result_st *ptr, const char *value, size_t length); +memcached_return_t memcached_result_set_value(memcached_result_st *ptr, const char *value, + size_t length); LIBMEMCACHED_API void memcached_result_set_flags(memcached_result_st *self, uint32_t flags); diff --git a/include/libmemcached-1.0/return.h b/include/libmemcached-1.0/return.h index e2b4104c..3d3d2821 100644 --- a/include/libmemcached-1.0/return.h +++ b/include/libmemcached-1.0/return.h @@ -1,84 +1,39 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once -static inline bool memcached_success(memcached_return_t rc) -{ - return (rc == MEMCACHED_BUFFERED || - rc == MEMCACHED_DELETED || - rc == MEMCACHED_END || - rc == MEMCACHED_ITEM || - rc == MEMCACHED_STAT || - rc == MEMCACHED_STORED || - rc == MEMCACHED_SUCCESS || - rc == MEMCACHED_VALUE); +static inline bool memcached_success(memcached_return_t rc) { + return (rc == MEMCACHED_BUFFERED || rc == MEMCACHED_DELETED || rc == MEMCACHED_END + || rc == MEMCACHED_ITEM || rc == MEMCACHED_STAT || rc == MEMCACHED_STORED + || rc == MEMCACHED_SUCCESS || rc == MEMCACHED_VALUE); } -static inline bool memcached_failed(memcached_return_t rc) -{ - return (rc != MEMCACHED_AUTH_CONTINUE && - rc != MEMCACHED_BUFFERED && - rc != MEMCACHED_DELETED && - rc != MEMCACHED_END && - rc != MEMCACHED_ITEM && - rc != MEMCACHED_STAT && - rc != MEMCACHED_STORED && - rc != MEMCACHED_SUCCESS && - rc != MEMCACHED_VALUE); +static inline bool memcached_failed(memcached_return_t rc) { + return (rc != MEMCACHED_AUTH_CONTINUE && rc != MEMCACHED_BUFFERED && rc != MEMCACHED_DELETED + && rc != MEMCACHED_END && rc != MEMCACHED_ITEM && rc != MEMCACHED_STAT + && rc != MEMCACHED_STORED && rc != MEMCACHED_SUCCESS && rc != MEMCACHED_VALUE); } -static inline bool memcached_fatal(memcached_return_t rc) -{ - return (rc != MEMCACHED_AUTH_CONTINUE && - rc != MEMCACHED_BUFFERED && - rc != MEMCACHED_CLIENT_ERROR && - rc != MEMCACHED_DATA_EXISTS && - rc != MEMCACHED_DELETED && - rc != MEMCACHED_E2BIG && - rc != MEMCACHED_END && - rc != MEMCACHED_ITEM && - rc != MEMCACHED_ERROR && - rc != MEMCACHED_NOTFOUND && - rc != MEMCACHED_NOTSTORED && - rc != MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE && - rc != MEMCACHED_STAT && - rc != MEMCACHED_STORED && - rc != MEMCACHED_SUCCESS && - rc != MEMCACHED_VALUE); +static inline bool memcached_fatal(memcached_return_t rc) { + return (rc != MEMCACHED_AUTH_CONTINUE && rc != MEMCACHED_BUFFERED && rc != MEMCACHED_CLIENT_ERROR + && rc != MEMCACHED_DATA_EXISTS && rc != MEMCACHED_DELETED && rc != MEMCACHED_E2BIG + && rc != MEMCACHED_END && rc != MEMCACHED_ITEM && rc != MEMCACHED_ERROR + && rc != MEMCACHED_NOTFOUND && rc != MEMCACHED_NOTSTORED + && rc != MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE && rc != MEMCACHED_STAT + && rc != MEMCACHED_STORED && rc != MEMCACHED_SUCCESS && rc != MEMCACHED_VALUE); } #define memcached_continue(__memcached_return_t) ((__memcached_return_t) == MEMCACHED_IN_PROGRESS) diff --git a/include/libmemcached-1.0/sasl.h b/include/libmemcached-1.0/sasl.h index 7d88f7bc..832084bd 100644 --- a/include/libmemcached-1.0/sasl.h +++ b/include/libmemcached-1.0/sasl.h @@ -1,46 +1,24 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once #if defined(LIBMEMCACHED_WITH_SASL_SUPPORT) && LIBMEMCACHED_WITH_SASL_SUPPORT -#include +# include #else -#define sasl_callback_t void +# define sasl_callback_t void #endif #ifdef __cplusplus @@ -48,18 +26,15 @@ extern "C" { #endif LIBMEMCACHED_API -void memcached_set_sasl_callbacks(memcached_st *ptr, - const sasl_callback_t *callbacks); +void memcached_set_sasl_callbacks(memcached_st *ptr, const sasl_callback_t *callbacks); LIBMEMCACHED_API -memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, - const char *username, - const char *password); +memcached_return_t memcached_set_sasl_auth_data(memcached_st *ptr, const char *username, + const char *password); LIBMEMCACHED_API memcached_return_t memcached_destroy_sasl_auth_data(memcached_st *ptr); - LIBMEMCACHED_API sasl_callback_t *memcached_get_sasl_callbacks(memcached_st *ptr); diff --git a/include/libmemcached-1.0/server.h b/include/libmemcached-1.0/server.h index 8554804a..86928c3d 100644 --- a/include/libmemcached-1.0/server.h +++ b/include/libmemcached-1.0/server.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -46,15 +23,12 @@ extern "C" { LIBMEMCACHED_API memcached_return_t memcached_server_cursor(const memcached_st *ptr, - const memcached_server_fn *callback, - void *context, + const memcached_server_fn *callback, void *context, uint32_t number_of_callbacks); LIBMEMCACHED_API - const memcached_instance_st * memcached_server_by_key(memcached_st *ptr, - const char *key, - size_t key_length, - memcached_return_t *error); +const memcached_instance_st *memcached_server_by_key(memcached_st *ptr, const char *key, + size_t key_length, memcached_return_t *error); LIBMEMCACHED_API void memcached_server_error_reset(memcached_server_st *ptr); @@ -63,63 +37,56 @@ LIBMEMCACHED_API void memcached_server_free(memcached_server_st *ptr); LIBMEMCACHED_API -const memcached_instance_st * memcached_server_get_last_disconnect(const memcached_st *ptr); - +const memcached_instance_st *memcached_server_get_last_disconnect(const memcached_st *ptr); LIBMEMCACHED_API -memcached_return_t memcached_server_add_udp(memcached_st *ptr, - const char *hostname, +memcached_return_t memcached_server_add_udp(memcached_st *ptr, const char *hostname, in_port_t port); LIBMEMCACHED_API -memcached_return_t memcached_server_add_unix_socket(memcached_st *ptr, - const char *filename); +memcached_return_t memcached_server_add_unix_socket(memcached_st *ptr, const char *filename); LIBMEMCACHED_API -memcached_return_t memcached_server_add(memcached_st *ptr, - const char *hostname, in_port_t port); +memcached_return_t memcached_server_add(memcached_st *ptr, const char *hostname, in_port_t port); LIBMEMCACHED_API -memcached_return_t memcached_server_add_udp_with_weight(memcached_st *ptr, - const char *hostname, - in_port_t port, - uint32_t weight); +memcached_return_t memcached_server_add_udp_with_weight(memcached_st *ptr, const char *hostname, + in_port_t port, uint32_t weight); LIBMEMCACHED_API memcached_return_t memcached_server_add_unix_socket_with_weight(memcached_st *ptr, const char *filename, uint32_t weight); LIBMEMCACHED_API memcached_return_t memcached_server_add_with_weight(memcached_st *ptr, const char *hostname, - in_port_t port, - uint32_t weight); + in_port_t port, uint32_t weight); /** Operations on Single Servers. */ LIBMEMCACHED_API -uint32_t memcached_server_response_count(const memcached_instance_st * self); +uint32_t memcached_server_response_count(const memcached_instance_st *self); LIBMEMCACHED_API -const char *memcached_server_name(const memcached_instance_st * self); +const char *memcached_server_name(const memcached_instance_st *self); LIBMEMCACHED_API -in_port_t memcached_server_port(const memcached_instance_st * self); +in_port_t memcached_server_port(const memcached_instance_st *self); LIBMEMCACHED_API -in_port_t memcached_server_srcport(const memcached_instance_st * self); +in_port_t memcached_server_srcport(const memcached_instance_st *self); LIBMEMCACHED_API -void memcached_instance_next_retry(const memcached_instance_st * self, const time_t absolute_time); +void memcached_instance_next_retry(const memcached_instance_st *self, const time_t absolute_time); LIBMEMCACHED_API -const char *memcached_server_type(const memcached_instance_st * ptr); +const char *memcached_server_type(const memcached_instance_st *ptr); LIBMEMCACHED_API -uint8_t memcached_server_major_version(const memcached_instance_st * ptr); +uint8_t memcached_server_major_version(const memcached_instance_st *ptr); LIBMEMCACHED_API -uint8_t memcached_server_minor_version(const memcached_instance_st * ptr); +uint8_t memcached_server_minor_version(const memcached_instance_st *ptr); LIBMEMCACHED_API -uint8_t memcached_server_micro_version(const memcached_instance_st * ptr); +uint8_t memcached_server_micro_version(const memcached_instance_st *ptr); #ifdef __cplusplus } // extern "C" diff --git a/include/libmemcached-1.0/server_list.h b/include/libmemcached-1.0/server_list.h index 04bebab4..ebf2a2d8 100644 --- a/include/libmemcached-1.0/server_list.h +++ b/include/libmemcached-1.0/server_list.h @@ -1,67 +1,42 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once - #ifdef __cplusplus extern "C" { #endif /* Server List Public functions */ LIBMEMCACHED_API - void memcached_server_list_free(memcached_server_list_st ptr); +void memcached_server_list_free(memcached_server_list_st ptr); LIBMEMCACHED_API - memcached_return_t memcached_server_push(memcached_st *ptr, const memcached_server_list_st list); +memcached_return_t memcached_server_push(memcached_st *ptr, const memcached_server_list_st list); LIBMEMCACHED_API - memcached_server_list_st memcached_server_list_append(memcached_server_list_st ptr, - const char *hostname, - in_port_t port, - memcached_return_t *error); +memcached_server_list_st memcached_server_list_append(memcached_server_list_st ptr, + const char *hostname, in_port_t port, + memcached_return_t *error); LIBMEMCACHED_API - memcached_server_list_st memcached_server_list_append_with_weight(memcached_server_list_st ptr, - const char *hostname, - in_port_t port, - uint32_t weight, - memcached_return_t *error); +memcached_server_list_st memcached_server_list_append_with_weight(memcached_server_list_st ptr, + const char *hostname, + in_port_t port, uint32_t weight, + memcached_return_t *error); LIBMEMCACHED_API - uint32_t memcached_server_list_count(const memcached_server_list_st ptr); +uint32_t memcached_server_list_count(const memcached_server_list_st ptr); #ifdef __cplusplus } // extern "C" diff --git a/include/libmemcached-1.0/stats.h b/include/libmemcached-1.0/stats.h index 5c384233..5661f505 100644 --- a/include/libmemcached-1.0/stats.h +++ b/include/libmemcached-1.0/stats.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #include "libmemcached-1.0/struct/stat.h" @@ -58,11 +36,12 @@ char *memcached_stat_get_value(const memcached_st *ptr, memcached_stat_st *memc_ const char *key, memcached_return_t *error); LIBMEMCACHED_API -char ** memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *memc_stat, - memcached_return_t *error); +char **memcached_stat_get_keys(memcached_st *ptr, memcached_stat_st *memc_stat, + memcached_return_t *error); LIBMEMCACHED_API -memcached_return_t memcached_stat_execute(memcached_st *memc, const char *args, memcached_stat_fn func, void *context); +memcached_return_t memcached_stat_execute(memcached_st *memc, const char *args, + memcached_stat_fn func, void *context); #ifdef __cplusplus } // extern "C" diff --git a/include/libmemcached-1.0/storage.h b/include/libmemcached-1.0/storage.h index e634235a..f23a9d97 100644 --- a/include/libmemcached-1.0/storage.h +++ b/include/libmemcached-1.0/storage.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -44,87 +22,64 @@ extern "C" { /* All of the functions for adding data to the server */ LIBMEMCACHED_API memcached_return_t memcached_set(memcached_st *ptr, const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, - uint32_t flags); + const char *value, size_t value_length, time_t expiration, + uint32_t flags); LIBMEMCACHED_API memcached_return_t memcached_add(memcached_st *ptr, const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, - uint32_t flags); + const char *value, size_t value_length, time_t expiration, + uint32_t flags); LIBMEMCACHED_API memcached_return_t memcached_replace(memcached_st *ptr, const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, - uint32_t flags); + const char *value, size_t value_length, time_t expiration, + uint32_t flags); LIBMEMCACHED_API -memcached_return_t memcached_append(memcached_st *ptr, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, +memcached_return_t memcached_append(memcached_st *ptr, const char *key, size_t key_length, + const char *value, size_t value_length, time_t expiration, uint32_t flags); LIBMEMCACHED_API -memcached_return_t memcached_prepend(memcached_st *ptr, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, +memcached_return_t memcached_prepend(memcached_st *ptr, const char *key, size_t key_length, + const char *value, size_t value_length, time_t expiration, uint32_t flags); LIBMEMCACHED_API -memcached_return_t memcached_cas(memcached_st *ptr, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, - uint32_t flags, - uint64_t cas); +memcached_return_t memcached_cas(memcached_st *ptr, const char *key, size_t key_length, + const char *value, size_t value_length, time_t expiration, + uint32_t flags, uint64_t cas); LIBMEMCACHED_API -memcached_return_t memcached_set_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, +memcached_return_t memcached_set_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, size_t key_length, + const char *value, size_t value_length, time_t expiration, uint32_t flags); LIBMEMCACHED_API -memcached_return_t memcached_add_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, +memcached_return_t memcached_add_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, size_t key_length, + const char *value, size_t value_length, time_t expiration, uint32_t flags); LIBMEMCACHED_API -memcached_return_t memcached_replace_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, - uint32_t flags); +memcached_return_t memcached_replace_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, const char *value, + size_t value_length, time_t expiration, uint32_t flags); LIBMEMCACHED_API -memcached_return_t memcached_prepend_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, - uint32_t flags); +memcached_return_t memcached_prepend_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, const char *value, + size_t value_length, time_t expiration, uint32_t flags); LIBMEMCACHED_API -memcached_return_t memcached_append_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, - uint32_t flags); +memcached_return_t memcached_append_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, const char *value, + size_t value_length, time_t expiration, uint32_t flags); LIBMEMCACHED_API -memcached_return_t memcached_cas_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - const char *value, size_t value_length, - time_t expiration, - uint32_t flags, - uint64_t cas); +memcached_return_t memcached_cas_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, size_t key_length, + const char *value, size_t value_length, time_t expiration, + uint32_t flags, uint64_t cas); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/strerror.h b/include/libmemcached-1.0/strerror.h index 16bf424a..42b70fa8 100644 --- a/include/libmemcached-1.0/strerror.h +++ b/include/libmemcached-1.0/strerror.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/struct/allocator.h b/include/libmemcached-1.0/struct/allocator.h index 3ff6ade8..fd65721a 100644 --- a/include/libmemcached-1.0/struct/allocator.h +++ b/include/libmemcached-1.0/struct/allocator.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/struct/analysis.h b/include/libmemcached-1.0/struct/analysis.h index 09cccedc..94c62208 100644 --- a/include/libmemcached-1.0/struct/analysis.h +++ b/include/libmemcached-1.0/struct/analysis.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -48,4 +26,3 @@ struct memcached_analysis_st { uint64_t most_used_bytes; uint64_t least_remaining_bytes; }; - diff --git a/include/libmemcached-1.0/struct/callback.h b/include/libmemcached-1.0/struct/callback.h index 21b96765..2bfac146 100644 --- a/include/libmemcached-1.0/struct/callback.h +++ b/include/libmemcached-1.0/struct/callback.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/struct/memcached.h b/include/libmemcached-1.0/struct/memcached.h index a368bfe8..f59e68ea 100644 --- a/include/libmemcached-1.0/struct/memcached.h +++ b/include/libmemcached-1.0/struct/memcached.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,30 +20,30 @@ struct memcached_st { @note these are static and should not change without a call to behavior. */ struct { - bool is_purging:1; - bool is_processing_input:1; - bool is_time_for_rebuild:1; - bool is_parsing:1; + bool is_purging : 1; + bool is_processing_input : 1; + bool is_time_for_rebuild : 1; + bool is_parsing : 1; } state; struct { // Everything below here is pretty static. - bool auto_eject_hosts:1; - bool binary_protocol:1; - bool buffer_requests:1; - bool hash_with_namespace:1; - bool no_block:1; // Don't block - bool reply:1; - bool randomize_replica_read:1; - bool support_cas:1; - bool tcp_nodelay:1; - bool use_sort_hosts:1; - bool use_udp:1; - bool verify_key:1; - bool tcp_keepalive:1; - bool is_aes:1; - bool is_fetching_version:1; - bool not_used:1; + bool auto_eject_hosts : 1; + bool binary_protocol : 1; + bool buffer_requests : 1; + bool hash_with_namespace : 1; + bool no_block : 1; // Don't block + bool reply : 1; + bool randomize_replica_read : 1; + bool support_cas : 1; + bool tcp_nodelay : 1; + bool use_sort_hosts : 1; + bool use_udp : 1; + bool verify_key : 1; + bool tcp_keepalive : 1; + bool is_aes : 1; + bool is_fetching_version : 1; + bool not_used : 1; } flags; memcached_server_distribution_t distribution; @@ -97,9 +75,9 @@ struct memcached_st { struct { bool weighted_; - uint32_t continuum_count; // Ketama - uint32_t continuum_points_counter; // Ketama - time_t next_distribution_rebuild; // Ketama + uint32_t continuum_count; // Ketama + uint32_t continuum_points_counter; // Ketama + time_t next_distribution_rebuild; // Ketama struct memcached_continuum_item_st *continuum; // Ketama } ketama; @@ -118,11 +96,11 @@ struct memcached_st { struct { uint32_t initial_pool_size; uint32_t max_pool_size; - int32_t version; // This is used by pool and others to determine if the memcached_st is out of date. + int32_t + version; // This is used by pool and others to determine if the memcached_st is out of date. struct memcached_array_st *filename; } configure; struct { - bool is_allocated:1; + bool is_allocated : 1; } options; - }; diff --git a/include/libmemcached-1.0/struct/result.h b/include/libmemcached-1.0/struct/result.h index c3bfddb5..d651bdc1 100644 --- a/include/libmemcached-1.0/struct/result.h +++ b/include/libmemcached-1.0/struct/result.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -48,9 +26,8 @@ struct memcached_result_st { uint64_t count; char item_key[MEMCACHED_MAX_KEY]; struct { - bool is_allocated:1; - bool is_initialized:1; + bool is_allocated : 1; + bool is_initialized : 1; } options; /* Add result callback function */ }; - diff --git a/include/libmemcached-1.0/struct/sasl.h b/include/libmemcached-1.0/struct/sasl.h index da9eed38..98c4fec1 100644 --- a/include/libmemcached-1.0/struct/sasl.h +++ b/include/libmemcached-1.0/struct/sasl.h @@ -1,44 +1,22 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #if defined(LIBMEMCACHED_WITH_SASL_SUPPORT) && LIBMEMCACHED_WITH_SASL_SUPPORT -#include +# include #else -#define sasl_callback_t void +# define sasl_callback_t void #endif #pragma once @@ -48,7 +26,6 @@ struct memcached_sasl_st { /* ** Did we allocate data inside the callbacks, or did the user ** supply that. - */ + */ bool is_allocated; }; - diff --git a/include/libmemcached-1.0/struct/server.h b/include/libmemcached-1.0/struct/server.h index 9337938d..e3ff9e76 100644 --- a/include/libmemcached-1.0/struct/server.h +++ b/include/libmemcached-1.0/struct/server.h @@ -1,61 +1,38 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once #ifdef HAVE_NETDB_H -# include +# include #endif #ifdef NI_MAXHOST -# define MEMCACHED_NI_MAXHOST NI_MAXHOST +# define MEMCACHED_NI_MAXHOST NI_MAXHOST #else -# define MEMCACHED_NI_MAXHOST 1025 +# define MEMCACHED_NI_MAXHOST 1025 #endif #ifdef NI_MAXSERV -# define MEMCACHED_NI_MAXSERV NI_MAXSERV +# define MEMCACHED_NI_MAXSERV NI_MAXSERV #else -# define MEMCACHED_NI_MAXSERV 32 +# define MEMCACHED_NI_MAXSERV 32 #endif enum memcached_server_state_t { - MEMCACHED_SERVER_STATE_NEW, // fd == -1, no address lookup has been done + MEMCACHED_SERVER_STATE_NEW, // fd == -1, no address lookup has been done MEMCACHED_SERVER_STATE_ADDRINFO, // ADDRRESS information has been gathered MEMCACHED_SERVER_STATE_IN_PROGRESS, MEMCACHED_SERVER_STATE_CONNECTED, @@ -65,10 +42,10 @@ enum memcached_server_state_t { struct memcached_server_st { struct { - bool is_allocated:1; - bool is_initialized:1; - bool is_shutting_down:1; - bool is_dead:1; + bool is_allocated : 1; + bool is_initialized : 1; + bool is_shutting_down : 1; + bool is_dead : 1; } options; uint32_t number_of_hosts; uint32_t cursor_active; diff --git a/include/libmemcached-1.0/struct/stat.h b/include/libmemcached-1.0/struct/stat.h index acd4e21f..cc6be4e3 100644 --- a/include/libmemcached-1.0/struct/stat.h +++ b/include/libmemcached-1.0/struct/stat.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -65,4 +43,3 @@ struct memcached_stat_st { void *__future; // @todo create a new structure to place here for future usage memcached_st *root; }; - diff --git a/include/libmemcached-1.0/struct/string.h b/include/libmemcached-1.0/struct/string.h index 9edb637a..aef7b9ff 100644 --- a/include/libmemcached-1.0/struct/string.h +++ b/include/libmemcached-1.0/struct/string.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -53,7 +31,7 @@ struct memcached_string_st { size_t current_size; struct memcached_st *root; struct { - bool is_allocated:1; - bool is_initialized:1; + bool is_allocated : 1; + bool is_initialized : 1; } options; }; diff --git a/include/libmemcached-1.0/touch.h b/include/libmemcached-1.0/touch.h index e143c037..98e57c6c 100644 --- a/include/libmemcached-1.0/touch.h +++ b/include/libmemcached-1.0/touch.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,17 +19,14 @@ extern "C" { #endif - LIBMEMCACHED_API -memcached_return_t memcached_touch(memcached_st *ptr, - const char *key, size_t key_length, +memcached_return_t memcached_touch(memcached_st *ptr, const char *key, size_t key_length, time_t expiration); LIBMEMCACHED_API -memcached_return_t memcached_touch_by_key(memcached_st *ptr, - const char *group_key, size_t group_key_length, - const char *key, size_t key_length, - time_t expiration); +memcached_return_t memcached_touch_by_key(memcached_st *ptr, const char *group_key, + size_t group_key_length, const char *key, + size_t key_length, time_t expiration); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/triggers.h b/include/libmemcached-1.0/triggers.h index b331429e..406a37da 100644 --- a/include/libmemcached-1.0/triggers.h +++ b/include/libmemcached-1.0/triggers.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -42,22 +19,21 @@ extern "C" { #endif -typedef memcached_return_t (*memcached_clone_fn)(memcached_st *destination, const memcached_st *source); +typedef memcached_return_t (*memcached_clone_fn)(memcached_st *destination, + const memcached_st *source); typedef memcached_return_t (*memcached_cleanup_fn)(const memcached_st *ptr); /** Trigger functions. */ -typedef memcached_return_t (*memcached_trigger_key_fn)(const memcached_st *ptr, - const char *key, size_t key_length, +typedef memcached_return_t (*memcached_trigger_key_fn)(const memcached_st *ptr, const char *key, + size_t key_length, memcached_result_st *result); typedef memcached_return_t (*memcached_trigger_delete_key_fn)(const memcached_st *ptr, const char *key, size_t key_length); -typedef memcached_return_t (*memcached_dump_fn)(const memcached_st *ptr, - const char *key, - size_t key_length, - void *context); +typedef memcached_return_t (*memcached_dump_fn)(const memcached_st *ptr, const char *key, + size_t key_length, void *context); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/types.h b/include/libmemcached-1.0/types.h index 2c3f87af..30fe2f72 100644 --- a/include/libmemcached-1.0/types.h +++ b/include/libmemcached-1.0/types.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2006-2009 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/types/behavior.h b/include/libmemcached-1.0/types/behavior.h index a1bbfd22..1f80e24c 100644 --- a/include/libmemcached-1.0/types/behavior.h +++ b/include/libmemcached-1.0/types/behavior.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/types/callback.h b/include/libmemcached-1.0/types/callback.h index d5481f50..6e67bf7a 100644 --- a/include/libmemcached-1.0/types/callback.h +++ b/include/libmemcached-1.0/types/callback.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -46,7 +23,7 @@ enum memcached_callback_t { MEMCACHED_CALLBACK_GET_FAILURE = 7, MEMCACHED_CALLBACK_DELETE_TRIGGER = 8, MEMCACHED_CALLBACK_MAX, - MEMCACHED_CALLBACK_NAMESPACE= MEMCACHED_CALLBACK_PREFIX_KEY + MEMCACHED_CALLBACK_NAMESPACE = MEMCACHED_CALLBACK_PREFIX_KEY }; #ifndef __cplusplus diff --git a/include/libmemcached-1.0/types/connection.h b/include/libmemcached-1.0/types/connection.h index d2a072b7..6052f2ea 100644 --- a/include/libmemcached-1.0/types/connection.h +++ b/include/libmemcached-1.0/types/connection.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/types/hash.h b/include/libmemcached-1.0/types/hash.h index 8eee4df7..4714fc9c 100644 --- a/include/libmemcached-1.0/types/hash.h +++ b/include/libmemcached-1.0/types/hash.h @@ -1,45 +1,22 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once enum memcached_hash_t { - MEMCACHED_HASH_DEFAULT= 0, + MEMCACHED_HASH_DEFAULT = 0, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, diff --git a/include/libmemcached-1.0/types/return.h b/include/libmemcached-1.0/types/return.h index 93e9e975..f37548d9 100644 --- a/include/libmemcached-1.0/types/return.h +++ b/include/libmemcached-1.0/types/return.h @@ -1,38 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -41,14 +20,14 @@ enum memcached_return_t { MEMCACHED_FAILURE, MEMCACHED_HOST_LOOKUP_FAILURE, // getaddrinfo() and getnameinfo() only MEMCACHED_CONNECTION_FAILURE, - MEMCACHED_CONNECTION_BIND_FAILURE, // DEPRECATED, see MEMCACHED_HOST_LOOKUP_FAILURE + MEMCACHED_CONNECTION_BIND_FAILURE, // DEPRECATED, see MEMCACHED_HOST_LOOKUP_FAILURE MEMCACHED_WRITE_FAILURE, MEMCACHED_READ_FAILURE, MEMCACHED_UNKNOWN_READ_FAILURE, MEMCACHED_PROTOCOL_ERROR, MEMCACHED_CLIENT_ERROR, MEMCACHED_SERVER_ERROR, // Server returns "SERVER_ERROR" - MEMCACHED_ERROR, // Server returns "ERROR" + MEMCACHED_ERROR, // Server returns "ERROR" MEMCACHED_DATA_EXISTS, MEMCACHED_DATA_DOES_NOT_EXIST, MEMCACHED_NOTSTORED, @@ -87,7 +66,7 @@ enum memcached_return_t { MEMCACHED_SERVER_TEMPORARILY_DISABLED, MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE, MEMCACHED_MAXIMUM_RETURN, /* Always add new error code before */ - MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE= MEMCACHED_ERROR + MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE = MEMCACHED_ERROR }; #ifndef __cplusplus diff --git a/include/libmemcached-1.0/types/server_distribution.h b/include/libmemcached-1.0/types/server_distribution.h index 95e129f6..648c295d 100644 --- a/include/libmemcached-1.0/types/server_distribution.h +++ b/include/libmemcached-1.0/types/server_distribution.h @@ -1,40 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once diff --git a/include/libmemcached-1.0/verbosity.h b/include/libmemcached-1.0/verbosity.h index 29946486..3ab7a33d 100644 --- a/include/libmemcached-1.0/verbosity.h +++ b/include/libmemcached-1.0/verbosity.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -44,7 +22,6 @@ extern "C" { LIBMEMCACHED_API memcached_return_t memcached_verbosity(memcached_st *ptr, uint32_t verbosity); - #ifdef __cplusplus } #endif diff --git a/include/libmemcached-1.0/version.h b/include/libmemcached-1.0/version.h index c443accb..db8ccb79 100644 --- a/include/libmemcached-1.0/version.h +++ b/include/libmemcached-1.0/version.h @@ -1,39 +1,17 @@ -/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: - * - * Libmemcached library - * - * Copyright (C) 2011 Data Differential, http://datadifferential.com/ - * Copyright (C) 2010 Brian Aker All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * - * * The names of its contributors may not be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -45,7 +23,7 @@ LIBMEMCACHED_API memcached_return_t memcached_version(memcached_st *ptr); LIBMEMCACHED_API -const char * memcached_lib_version(void); +const char *memcached_lib_version(void); #ifdef __cplusplus } diff --git a/include/libmemcached-1.0/visibility.h b/include/libmemcached-1.0/visibility.h index d4e4eea0..419b3d59 100644 --- a/include/libmemcached-1.0/visibility.h +++ b/include/libmemcached-1.0/visibility.h @@ -1,20 +1,17 @@ -/* LibMemcached - * Copyright (C) 2006-2009 Brian Aker - * All rights reserved. - * - * Use and distribution licensed under the BSD license. See - * the COPYING file in the parent directory for full text. - * - * Summary: Interface for memcached server. - * - * Author: Trond Norbye - * - */ - -/** - * @file - * @brief Visibility control macros - */ +/* + +--------------------------------------------------------------------+ + | libmemcached - C/C++ Client Library for memcached | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted under the terms of the BSD license. | + | You should have received a copy of the license in a bundled file | + | named LICENSE; in case you did not receive a copy you can review | + | the terms online at: https://opensource.org/licenses/BSD-3-Clause | + +--------------------------------------------------------------------+ + | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ | + | Copyright (c) 2020 Michael Wallner | + +--------------------------------------------------------------------+ +*/ #pragma once @@ -27,41 +24,41 @@ */ #if defined(BUILDING_LIBMEMCACHEDINTERNAL) -# if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY -# define LIBMEMCACHED_API __attribute__ ((visibility("default"))) -# define LIBMEMCACHED_LOCAL __attribute__ ((visibility("default"))) -# elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550) -# define LIBMEMCACHED_API __global -# define LIBMEMCACHED_LOCAL __global -# elif defined(_MSC_VER) -# define LIBMEMCACHED_API extern __declspec(dllexport) -# define LIBMEMCACHED_LOCAL extern __declspec(dllexport) -# else -# define LIBMEMCACHED_API -# define LIBMEMCACHED_LOCAL -# endif -#else -# if defined(BUILDING_LIBMEMCACHED) # if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY -# define LIBMEMCACHED_API __attribute__ ((visibility("default"))) -# define LIBMEMCACHED_LOCAL __attribute__ ((visibility("hidden"))) -# elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550) -# define LIBMEMCACHED_API __global -# define LIBMEMCACHED_LOCAL __hidden +# define LIBMEMCACHED_API __attribute__((visibility("default"))) +# define LIBMEMCACHED_LOCAL __attribute__((visibility("default"))) +# elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +# define LIBMEMCACHED_API __global +# define LIBMEMCACHED_LOCAL __global # elif defined(_MSC_VER) -# define LIBMEMCACHED_API extern __declspec(dllexport) -# define LIBMEMCACHED_LOCAL +# define LIBMEMCACHED_API extern __declspec(dllexport) +# define LIBMEMCACHED_LOCAL extern __declspec(dllexport) # else -# define LIBMEMCACHED_API -# define LIBMEMCACHED_LOCAL -# endif /* defined(HAVE_VISIBILITY) */ -# else /* defined(BUILDING_LIBMEMCACHED) */ -# if defined(_MSC_VER) -# define LIBMEMCACHED_API extern __declspec(dllimport) -# define LIBMEMCACHED_LOCAL -# else -# define LIBMEMCACHED_API -# define LIBMEMCACHED_LOCAL -# endif /* defined(_MSC_VER) */ -# endif /* defined(BUILDING_LIBMEMCACHED) */ -#endif /* defined(BUILDING_LIBMEMCACHEDINTERNAL) */ +# define LIBMEMCACHED_API +# define LIBMEMCACHED_LOCAL +# endif +#else +# if defined(BUILDING_LIBMEMCACHED) +# if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY +# define LIBMEMCACHED_API __attribute__((visibility("default"))) +# define LIBMEMCACHED_LOCAL __attribute__((visibility("hidden"))) +# elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +# define LIBMEMCACHED_API __global +# define LIBMEMCACHED_LOCAL __hidden +# elif defined(_MSC_VER) +# define LIBMEMCACHED_API extern __declspec(dllexport) +# define LIBMEMCACHED_LOCAL +# else +# define LIBMEMCACHED_API +# define LIBMEMCACHED_LOCAL +# endif /* defined(HAVE_VISIBILITY) */ +# else /* defined(BUILDING_LIBMEMCACHED) */ +# if defined(_MSC_VER) +# define LIBMEMCACHED_API extern __declspec(dllimport) +# define LIBMEMCACHED_LOCAL +# else +# define LIBMEMCACHED_API +# define LIBMEMCACHED_LOCAL +# endif /* defined(_MSC_VER) */ +# endif /* defined(BUILDING_LIBMEMCACHED) */ +#endif /* defined(BUILDING_LIBMEMCACHEDINTERNAL) */ -- 2.30.2