ci: bsds: rebuild packages after reconfiguration
[m6w6/libmemcached] / include / libhashkit-1.0 / hashkit.h
1 /*
2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
14 */
15
16 #pragma once
17
18 #if !defined(__cplusplus)
19 # include <stdbool.h>
20 # include <inttypes.h>
21 #else
22 # include <cinttypes>
23 #endif
24 #include <sys/types.h>
25
26 #include <libhashkit-1.0/visibility.h>
27 #include <libhashkit-1.0/configure.h>
28 #include <libhashkit-1.0/types.h>
29 #include <libhashkit-1.0/has.h>
30 #include <libhashkit-1.0/algorithm.h>
31 #include <libhashkit-1.0/behavior.h>
32 #include <libhashkit-1.0/digest.h>
33 #include <libhashkit-1.0/function.h>
34 #include <libhashkit-1.0/str_algorithm.h>
35 #include <libhashkit-1.0/strerror.h>
36 #include <libhashkit-1.0/string.h>
37
38 struct hashkit_st {
39 struct hashkit_function_st {
40 hashkit_hash_fn function;
41 void *context;
42 } base_hash, distribution_hash;
43
44 struct {
45 bool is_base_same_distributed : 1;
46 } flags;
47
48 struct {
49 bool is_allocated : 1;
50 } options;
51
52 void *_key;
53 };
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 HASHKIT_API
60 hashkit_st *hashkit_create(hashkit_st *hash);
61
62 HASHKIT_API
63 hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr);
64
65 HASHKIT_API
66 bool hashkit_compare(const hashkit_st *first, const hashkit_st *second);
67
68 HASHKIT_API
69 void hashkit_free(hashkit_st *hash);
70
71 HASHKIT_API
72 hashkit_string_st *hashkit_encrypt(hashkit_st *, const char *source, size_t source_length);
73
74 HASHKIT_API
75 hashkit_string_st *hashkit_decrypt(hashkit_st *, const char *source, size_t source_length);
76
77 HASHKIT_API
78 bool hashkit_key(hashkit_st *, const char *key, const size_t key_length);
79
80 #ifdef __cplusplus
81 } // extern "C"
82 #endif