Deploy to GitHub pages
[awesomized/libmemcached] / libhashkit / hashkit_function.html
1
2
3 <!DOCTYPE html>
4 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
6 <head>
7 <meta charset="utf-8">
8
9 <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
11 <title>Set Hash Function &mdash; libmemcached-awesome 1.1.4 documentation</title>
12
13
14
15
16
17
18
19
20 <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
21
22
23 <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
24 <script type="text/javascript" src="../_static/jquery.js"></script>
25 <script type="text/javascript" src="../_static/underscore.js"></script>
26 <script type="text/javascript" src="../_static/doctools.js"></script>
27 <script type="text/javascript" src="../_static/language_data.js"></script>
28
29 <script type="text/javascript" src="../_static/js/theme.js"></script>
30
31
32
33
34 <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
35 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
36 <link rel="index" title="Index" href="../genindex.html" />
37 <link rel="search" title="Search" href="../search.html" />
38 <link rel="copyright" title="Copyright" href="../copyright.html" />
39 <link rel="next" title="Available Hashes" href="hashkit_functions.html" />
40 <link rel="prev" title="Creating a hashkit structure" href="hashkit_create.html" />
41 </head>
42
43 <body class="wy-body-for-nav">
44
45
46 <div class="wy-grid-for-nav">
47
48 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49 <div class="wy-side-scroll">
50 <div class="wy-side-nav-search" >
51
52
53
54 <a href="../index.html" class="icon icon-home"> libmemcached-awesome
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 1.1
65 </div>
66
67
68
69
70 <div role="search">
71 <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
72 <input type="text" name="q" placeholder="Search docs" />
73 <input type="hidden" name="check_keywords" value="yes" />
74 <input type="hidden" name="area" value="default" />
75 </form>
76 </div>
77
78
79 </div>
80
81 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
82
83
84
85
86
87
88 <ul class="current">
89 <li class="toctree-l1"><a class="reference internal" href="../libmemcached.html">Introduction</a></li>
90 <li class="toctree-l1"><a class="reference internal" href="../libmemcached/index.html">libmemcached API</a></li>
91 <li class="toctree-l1"><a class="reference internal" href="../libmemcachedutil/index.html">libmemcachedutil API</a></li>
92 <li class="toctree-l1 current"><a class="reference internal" href="index.html">libhashkit API</a><ul class="current">
93 <li class="toctree-l2"><a class="reference internal" href="hashkit_create.html">Creating a hashkit structure</a></li>
94 <li class="toctree-l2 current"><a class="current reference internal" href="#">Set Hash Function</a></li>
95 <li class="toctree-l2"><a class="reference internal" href="hashkit_functions.html">Available Hashes</a></li>
96 <li class="toctree-l2"><a class="reference internal" href="hashkit_value.html">Generate hash value</a></li>
97 </ul>
98 </li>
99 <li class="toctree-l1"><a class="reference internal" href="../bin/index.html">Client Applications</a></li>
100 <li class="toctree-l1"><a class="reference internal" href="../libmemcached/index_misc.html">Miscellaneous</a></li>
101 </ul>
102 <ul>
103 <li class="toctree-l1"><a class="reference internal" href="../changelogs.html">Change Logs</a></li>
104 <li class="toctree-l1"><a class="reference internal" href="../issues.html">Known issues</a></li>
105 <li class="toctree-l1"><a class="reference internal" href="../copyright.html">Copyright</a></li>
106 </ul>
107
108
109
110 </div>
111 </div>
112 </nav>
113
114 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
115
116
117 <nav class="wy-nav-top" aria-label="top navigation">
118
119 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
120 <a href="../index.html">libmemcached-awesome</a>
121
122 </nav>
123
124
125 <div class="wy-nav-content">
126
127 <div class="rst-content">
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145 <div role="navigation" aria-label="breadcrumbs navigation">
146
147 <ul class="wy-breadcrumbs">
148
149 <li><a href="../index.html">Docs</a> &raquo;</li>
150
151 <li><a href="index.html">libhashkit - C/C++ hashing library</a> &raquo;</li>
152
153 <li>Set Hash Function</li>
154
155
156 <li class="wy-breadcrumbs-aside">
157
158
159
160 <a href="https://github.com/awesomized/libmemcached/blob/v1.x/docs/source/libhashkit/hashkit_function.rst" class="fa fa-github"> Edit on GitHub</a>
161
162
163
164 </li>
165
166 </ul>
167
168
169 <hr/>
170 </div>
171 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
172 <div itemprop="articleBody">
173
174 <div class="section" id="set-hash-function">
175 <h1>Set Hash Function<a class="headerlink" href="#set-hash-function" title="Permalink to this headline"></a></h1>
176 <div class="section" id="synopsis">
177 <h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline"></a></h2>
178 <dl class="docutils">
179 <dt>#include &lt;libhashkit-1.0/hashkit.h&gt;</dt>
180 <dd>Compile and link with -lhashkit</dd>
181 </dl>
182 <dl class="type">
183 <dt id="_CPPv415hashkit_hash_fn">
184 <span id="_CPPv315hashkit_hash_fn"></span><span id="_CPPv215hashkit_hash_fn"></span><span id="hashkit_hash_fn"></span><em class="property">typedef </em>uint32_t (*<code class="descname">hashkit_hash_fn</code>)<span class="sig-paren">(</span><em class="property">const</em> char *key, size_t key_length, void *context<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv415hashkit_hash_fn" title="Permalink to this definition"></a><br /></dt>
185 <dd><table class="docutils field-list" frame="void" rules="none">
186 <col class="field-name" />
187 <col class="field-body" />
188 <tbody valign="top">
189 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
190 <li><strong>key</strong> -- the key to generate a hash of</li>
191 <li><strong>key_length</strong> -- the length of the <code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">key</span></code> without any terminating zero byte</li>
192 <li><strong>context</strong> -- the custom hash function context set through <a class="reference internal" href="#_CPPv427hashkit_set_custom_functionP10hashkit_st15hashkit_hash_fnPv" title="hashkit_set_custom_function"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_set_custom_function()</span></code></a> or <a class="reference internal" href="#_CPPv440hashkit_set_custom_distribution_functionP10hashkit_st15hashkit_hash_fnPv" title="hashkit_set_custom_distribution_function"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_set_custom_distribution_function()</span></code></a></li>
193 </ul>
194 </td>
195 </tr>
196 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the custom hash function should return a hash value for <code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">key</span></code> as an unsigned 32bit integer</p>
197 </td>
198 </tr>
199 </tbody>
200 </table>
201 </dd></dl>
202
203 <dl class="type">
204 <dt id="c.hashkit_return_t">
205 enum <a class="reference internal" href="#c.hashkit_return_t" title="hashkit_return_t">hashkit_return_t</a> <code class="descname">hashkit_return_t</code><a class="headerlink" href="#c.hashkit_return_t" title="Permalink to this definition"></a></dt>
206 <dd></dd></dl>
207
208 <dl class="enum">
209 <dt id="_CPPv416hashkit_return_t">
210 <span id="_CPPv316hashkit_return_t"></span><span id="_CPPv216hashkit_return_t"></span><em class="property">enum </em><code class="descname">hashkit_return_t</code><a class="headerlink" href="#_CPPv416hashkit_return_t" title="Permalink to this definition"></a><br /></dt>
211 <dd><dl class="enumerator">
212 <dt id="_CPPv4N16hashkit_return_t15HASHKIT_SUCCESSE">
213 <span id="_CPPv3N16hashkit_return_t15HASHKIT_SUCCESSE"></span><span id="_CPPv2N16hashkit_return_t15HASHKIT_SUCCESSE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_SUCCESS</code><a class="headerlink" href="#_CPPv4N16hashkit_return_t15HASHKIT_SUCCESSE" title="Permalink to this definition"></a><br /></dt>
214 <dd><p>Operation succeeded.</p>
215 </dd></dl>
216
217 <dl class="enumerator">
218 <dt id="_CPPv4N16hashkit_return_t15HASHKIT_FAILUREE">
219 <span id="_CPPv3N16hashkit_return_t15HASHKIT_FAILUREE"></span><span id="_CPPv2N16hashkit_return_t15HASHKIT_FAILUREE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_FAILURE</code><a class="headerlink" href="#_CPPv4N16hashkit_return_t15HASHKIT_FAILUREE" title="Permalink to this definition"></a><br /></dt>
220 <dd><p>Operation failed.</p>
221 </dd></dl>
222
223 <dl class="enumerator">
224 <dt id="_CPPv4N16hashkit_return_t33HASHKIT_MEMORY_ALLOCATION_FAILUREE">
225 <span id="_CPPv3N16hashkit_return_t33HASHKIT_MEMORY_ALLOCATION_FAILUREE"></span><span id="_CPPv2N16hashkit_return_t33HASHKIT_MEMORY_ALLOCATION_FAILUREE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_MEMORY_ALLOCATION_FAILURE</code><a class="headerlink" href="#_CPPv4N16hashkit_return_t33HASHKIT_MEMORY_ALLOCATION_FAILUREE" title="Permalink to this definition"></a><br /></dt>
226 <dd><p>Memory allocation failed.</p>
227 </dd></dl>
228
229 <dl class="enumerator">
230 <dt id="_CPPv4N16hashkit_return_t20HASHKIT_INVALID_HASHE">
231 <span id="_CPPv3N16hashkit_return_t20HASHKIT_INVALID_HASHE"></span><span id="_CPPv2N16hashkit_return_t20HASHKIT_INVALID_HASHE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_INVALID_HASH</code><a class="headerlink" href="#_CPPv4N16hashkit_return_t20HASHKIT_INVALID_HASHE" title="Permalink to this definition"></a><br /></dt>
232 <dd><p>Invalid <a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_algorithm_t</span></code></a> passed.</p>
233 </dd></dl>
234
235 <dl class="enumerator">
236 <dt id="_CPPv4N16hashkit_return_t24HASHKIT_INVALID_ARGUMENTE">
237 <span id="_CPPv3N16hashkit_return_t24HASHKIT_INVALID_ARGUMENTE"></span><span id="_CPPv2N16hashkit_return_t24HASHKIT_INVALID_ARGUMENTE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_INVALID_ARGUMENT</code><a class="headerlink" href="#_CPPv4N16hashkit_return_t24HASHKIT_INVALID_ARGUMENTE" title="Permalink to this definition"></a><br /></dt>
238 <dd><p>Invalid argument passed.</p>
239 </dd></dl>
240
241 </dd></dl>
242
243 <dl class="type">
244 <dt id="c.hashkit_hash_algorithm_t">
245 enum <a class="reference internal" href="#c.hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t">hashkit_hash_algorithm_t</a> <code class="descname">hashkit_hash_algorithm_t</code><a class="headerlink" href="#c.hashkit_hash_algorithm_t" title="Permalink to this definition"></a></dt>
246 <dd></dd></dl>
247
248 <dl class="enum">
249 <dt id="_CPPv424hashkit_hash_algorithm_t">
250 <span id="_CPPv324hashkit_hash_algorithm_t"></span><span id="_CPPv224hashkit_hash_algorithm_t"></span><em class="property">enum </em><code class="descname">hashkit_hash_algorithm_t</code><a class="headerlink" href="#_CPPv424hashkit_hash_algorithm_t" title="Permalink to this definition"></a><br /></dt>
251 <dd><dl class="enumerator">
252 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_DEFAULTE">
253 <span id="_CPPv3N24hashkit_hash_algorithm_t20HASHKIT_HASH_DEFAULTE"></span><span id="_CPPv2N24hashkit_hash_algorithm_t20HASHKIT_HASH_DEFAULTE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_DEFAULT</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_DEFAULTE" title="Permalink to this definition"></a><br /></dt>
254 <dd><p>Default hash algorithm (one_at_a_time).</p>
255 </dd></dl>
256
257 <dl class="enumerator">
258 <dt id="_CPPv4N24hashkit_hash_algorithm_t16HASHKIT_HASH_MD5E">
259 <span id="_CPPv3N24hashkit_hash_algorithm_t16HASHKIT_HASH_MD5E"></span><span id="_CPPv2N24hashkit_hash_algorithm_t16HASHKIT_HASH_MD5E"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_MD5</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t16HASHKIT_HASH_MD5E" title="Permalink to this definition"></a><br /></dt>
260 <dd></dd></dl>
261
262 <dl class="enumerator">
263 <dt id="_CPPv4N24hashkit_hash_algorithm_t16HASHKIT_HASH_CRCE">
264 <span id="_CPPv3N24hashkit_hash_algorithm_t16HASHKIT_HASH_CRCE"></span><span id="_CPPv2N24hashkit_hash_algorithm_t16HASHKIT_HASH_CRCE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_CRC</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t16HASHKIT_HASH_CRCE" title="Permalink to this definition"></a><br /></dt>
265 <dd></dd></dl>
266
267 <dl class="enumerator">
268 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_64E">
269 <span id="_CPPv3N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_64E"></span><span id="_CPPv2N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_64E"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_FNV1_64</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_64E" title="Permalink to this definition"></a><br /></dt>
270 <dd></dd></dl>
271
272 <dl class="enumerator">
273 <dt id="_CPPv4N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_64E">
274 <span id="_CPPv3N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_64E"></span><span id="_CPPv2N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_64E"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_FNV1A_64</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_64E" title="Permalink to this definition"></a><br /></dt>
275 <dd></dd></dl>
276
277 <dl class="enumerator">
278 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_32E">
279 <span id="_CPPv3N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_32E"></span><span id="_CPPv2N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_32E"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_FNV1_32</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_32E" title="Permalink to this definition"></a><br /></dt>
280 <dd></dd></dl>
281
282 <dl class="enumerator">
283 <dt id="_CPPv4N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_32E">
284 <span id="_CPPv3N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_32E"></span><span id="_CPPv2N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_32E"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_FNV1A_32</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_32E" title="Permalink to this definition"></a><br /></dt>
285 <dd></dd></dl>
286
287 <dl class="enumerator">
288 <dt id="_CPPv4N24hashkit_hash_algorithm_t18HASHKIT_HASH_HSIEHE">
289 <span id="_CPPv3N24hashkit_hash_algorithm_t18HASHKIT_HASH_HSIEHE"></span><span id="_CPPv2N24hashkit_hash_algorithm_t18HASHKIT_HASH_HSIEHE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_HSIEH</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t18HASHKIT_HASH_HSIEHE" title="Permalink to this definition"></a><br /></dt>
290 <dd><p>Only available if <code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">libhashkit</span></code> hash been built with HSIEH support.</p>
291 </dd></dl>
292
293 <dl class="enumerator">
294 <dt id="_CPPv4N24hashkit_hash_algorithm_t19HASHKIT_HASH_MURMURE">
295 <span id="_CPPv3N24hashkit_hash_algorithm_t19HASHKIT_HASH_MURMURE"></span><span id="_CPPv2N24hashkit_hash_algorithm_t19HASHKIT_HASH_MURMURE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_MURMUR</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t19HASHKIT_HASH_MURMURE" title="Permalink to this definition"></a><br /></dt>
296 <dd><p>Only available if <code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">libhashkit</span></code> has been built with MURMUR support.</p>
297 </dd></dl>
298
299 <dl class="enumerator">
300 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_MURMUR3E">
301 <span id="_CPPv3N24hashkit_hash_algorithm_t20HASHKIT_HASH_MURMUR3E"></span><span id="_CPPv2N24hashkit_hash_algorithm_t20HASHKIT_HASH_MURMUR3E"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_MURMUR3</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_MURMUR3E" title="Permalink to this definition"></a><br /></dt>
302 <dd><p>Only available if <code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">libhashkit</span></code> has been built with MURMUR support.</p>
303 </dd></dl>
304
305 <dl class="enumerator">
306 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_JENKINSE">
307 <span id="_CPPv3N24hashkit_hash_algorithm_t20HASHKIT_HASH_JENKINSE"></span><span id="_CPPv2N24hashkit_hash_algorithm_t20HASHKIT_HASH_JENKINSE"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_JENKINS</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_JENKINSE" title="Permalink to this definition"></a><br /></dt>
308 <dd></dd></dl>
309
310 <dl class="enumerator">
311 <dt id="_CPPv4N24hashkit_hash_algorithm_t19HASHKIT_HASH_CUSTOME">
312 <span id="_CPPv3N24hashkit_hash_algorithm_t19HASHKIT_HASH_CUSTOME"></span><span id="_CPPv2N24hashkit_hash_algorithm_t19HASHKIT_HASH_CUSTOME"></span><em class="property">enumerator </em><code class="descname">HASHKIT_HASH_CUSTOM</code><a class="headerlink" href="#_CPPv4N24hashkit_hash_algorithm_t19HASHKIT_HASH_CUSTOME" title="Permalink to this definition"></a><br /></dt>
313 <dd><p>Use custom <a class="reference internal" href="#_CPPv415hashkit_hash_fn" title="hashkit_hash_fn"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_fn</span></code></a> function set through <a class="reference internal" href="#_CPPv427hashkit_set_custom_functionP10hashkit_st15hashkit_hash_fnPv" title="hashkit_set_custom_function"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_set_custom_function()</span></code></a> or <a class="reference internal" href="#_CPPv440hashkit_set_custom_distribution_functionP10hashkit_st15hashkit_hash_fnPv" title="hashkit_set_custom_distribution_function"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_set_custom_distribution_function()</span></code></a>.</p>
314 </dd></dl>
315
316 </dd></dl>
317
318 <dl class="function">
319 <dt id="_CPPv420hashkit_set_functionP10hashkit_st24hashkit_hash_algorithm_t">
320 <span id="_CPPv320hashkit_set_functionP10hashkit_st24hashkit_hash_algorithm_t"></span><span id="_CPPv220hashkit_set_functionP10hashkit_st24hashkit_hash_algorithm_t"></span><span id="hashkit_set_function__hashkit_stP.hashkit_hash_algorithm_t"></span><a class="reference internal" href="#_CPPv416hashkit_return_t" title="hashkit_return_t">hashkit_return_t</a> <code class="descname">hashkit_set_function</code><span class="sig-paren">(</span><a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st">hashkit_st</a> *<em>hash</em>, <a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t">hashkit_hash_algorithm_t</a> <em>hash_algorithm</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv420hashkit_set_functionP10hashkit_st24hashkit_hash_algorithm_t" title="Permalink to this definition"></a><br /></dt>
321 <dd><table class="docutils field-list" frame="void" rules="none">
322 <col class="field-name" />
323 <col class="field-body" />
324 <tbody valign="top">
325 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
326 <li><strong>hash</strong> -- pointer to an initialized <a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_st</span></code></a> struct</li>
327 <li><strong>hash_algorithm</strong> -- valid <a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_algorithm_t</span></code></a> constant</li>
328 </ul>
329 </td>
330 </tr>
331 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#_CPPv416hashkit_return_t" title="hashkit_return_t"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_return_t</span></code></a> indicating success or failure</p>
332 </td>
333 </tr>
334 </tbody>
335 </table>
336 </dd></dl>
337
338 <dl class="function">
339 <dt id="_CPPv427hashkit_set_custom_functionP10hashkit_st15hashkit_hash_fnPv">
340 <span id="_CPPv327hashkit_set_custom_functionP10hashkit_st15hashkit_hash_fnPv"></span><span id="_CPPv227hashkit_set_custom_functionP10hashkit_st15hashkit_hash_fnPv"></span><span id="hashkit_set_custom_function__hashkit_stP.hashkit_hash_fn.voidP"></span><a class="reference internal" href="#_CPPv416hashkit_return_t" title="hashkit_return_t">hashkit_return_t</a> <code class="descname">hashkit_set_custom_function</code><span class="sig-paren">(</span><a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st">hashkit_st</a> *<em>hash</em>, <a class="reference internal" href="#_CPPv415hashkit_hash_fn" title="hashkit_hash_fn">hashkit_hash_fn</a> <em>function</em>, void *<em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv427hashkit_set_custom_functionP10hashkit_st15hashkit_hash_fnPv" title="Permalink to this definition"></a><br /></dt>
341 <dd><table class="docutils field-list" frame="void" rules="none">
342 <col class="field-name" />
343 <col class="field-body" />
344 <tbody valign="top">
345 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
346 <li><strong>hash</strong> -- pointer to initialized <a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_st</span></code></a> struct</li>
347 <li><strong>function</strong> -- <a class="reference internal" href="#_CPPv415hashkit_hash_fn" title="hashkit_hash_fn"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_fn</span></code></a> function pointer to use as hash function for <a class="reference internal" href="#_CPPv4N24hashkit_hash_algorithm_t19HASHKIT_HASH_CUSTOME" title="HASHKIT_HASH_CUSTOM"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">HASHKIT_HASH_CUSTOM</span></code></a></li>
348 <li><strong>context</strong> -- pointer to an opaque user managed context for the custom hash function</li>
349 </ul>
350 </td>
351 </tr>
352 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#_CPPv416hashkit_return_t" title="hashkit_return_t"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_return_t</span></code></a> indicating success or failure</p>
353 </td>
354 </tr>
355 </tbody>
356 </table>
357 </dd></dl>
358
359 <dl class="function">
360 <dt id="_CPPv420hashkit_get_functionPK10hashkit_st">
361 <span id="_CPPv320hashkit_get_functionPK10hashkit_st"></span><span id="_CPPv220hashkit_get_functionPK10hashkit_st"></span><span id="hashkit_get_function__hashkit_stCP"></span><a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t">hashkit_hash_algorithm_t</a> <code class="descname">hashkit_get_function</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st">hashkit_st</a> *<em>hash</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv420hashkit_get_functionPK10hashkit_st" title="Permalink to this definition"></a><br /></dt>
362 <dd><table class="docutils field-list" frame="void" rules="none">
363 <col class="field-name" />
364 <col class="field-body" />
365 <tbody valign="top">
366 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>hash</strong> -- pointer to an initialized <a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_st</span></code></a> struct</td>
367 </tr>
368 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_algorithm_t</span></code></a> indicating the currently set hash algorithm to use</td>
369 </tr>
370 </tbody>
371 </table>
372 </dd></dl>
373
374 <dl class="function">
375 <dt id="_CPPv433hashkit_set_distribution_functionP10hashkit_st24hashkit_hash_algorithm_t">
376 <span id="_CPPv333hashkit_set_distribution_functionP10hashkit_st24hashkit_hash_algorithm_t"></span><span id="_CPPv233hashkit_set_distribution_functionP10hashkit_st24hashkit_hash_algorithm_t"></span><span id="hashkit_set_distribution_function__hashkit_stP.hashkit_hash_algorithm_t"></span><a class="reference internal" href="#_CPPv416hashkit_return_t" title="hashkit_return_t">hashkit_return_t</a> <code class="descname">hashkit_set_distribution_function</code><span class="sig-paren">(</span><a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st">hashkit_st</a> *<em>hash</em>, <a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t">hashkit_hash_algorithm_t</a> <em>hash_algorithm</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv433hashkit_set_distribution_functionP10hashkit_st24hashkit_hash_algorithm_t" title="Permalink to this definition"></a><br /></dt>
377 <dd><table class="docutils field-list" frame="void" rules="none">
378 <col class="field-name" />
379 <col class="field-body" />
380 <tbody valign="top">
381 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
382 <li><strong>hash</strong> -- pointer to an initialized <a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_st</span></code></a> struct</li>
383 <li><strong>hash_algorithm</strong> -- valid <code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_algrothm_t</span></code> constant</li>
384 </ul>
385 </td>
386 </tr>
387 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#_CPPv416hashkit_return_t" title="hashkit_return_t"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_return_t</span></code></a> indicating success or failure</p>
388 </td>
389 </tr>
390 </tbody>
391 </table>
392 </dd></dl>
393
394 <dl class="function">
395 <dt id="_CPPv440hashkit_set_custom_distribution_functionP10hashkit_st15hashkit_hash_fnPv">
396 <span id="_CPPv340hashkit_set_custom_distribution_functionP10hashkit_st15hashkit_hash_fnPv"></span><span id="_CPPv240hashkit_set_custom_distribution_functionP10hashkit_st15hashkit_hash_fnPv"></span><span id="hashkit_set_custom_distribution_function__hashkit_stP.hashkit_hash_fn.voidP"></span><a class="reference internal" href="#_CPPv416hashkit_return_t" title="hashkit_return_t">hashkit_return_t</a> <code class="descname">hashkit_set_custom_distribution_function</code><span class="sig-paren">(</span><a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st">hashkit_st</a> *<em>hash</em>, <a class="reference internal" href="#_CPPv415hashkit_hash_fn" title="hashkit_hash_fn">hashkit_hash_fn</a> <em>function</em>, void *<em>context</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv440hashkit_set_custom_distribution_functionP10hashkit_st15hashkit_hash_fnPv" title="Permalink to this definition"></a><br /></dt>
397 <dd><table class="docutils field-list" frame="void" rules="none">
398 <col class="field-name" />
399 <col class="field-body" />
400 <tbody valign="top">
401 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
402 <li><strong>hash</strong> -- pointer to initialized <a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_st</span></code></a> struct</li>
403 <li><strong>function</strong> -- <a class="reference internal" href="#_CPPv415hashkit_hash_fn" title="hashkit_hash_fn"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_fn</span></code></a> function pointer to use as distribution hash function for <a class="reference internal" href="#_CPPv4N24hashkit_hash_algorithm_t19HASHKIT_HASH_CUSTOME" title="HASHKIT_HASH_CUSTOM"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">HASHKIT_HASH_CUSTOM</span></code></a></li>
404 <li><strong>context</strong> -- pointer to an opaque user managed context for the custom distribution hash function</li>
405 </ul>
406 </td>
407 </tr>
408 </tbody>
409 </table>
410 </dd></dl>
411
412 <dl class="function">
413 <dt id="_CPPv433hashkit_get_distribution_functionPK10hashkit_st">
414 <span id="_CPPv333hashkit_get_distribution_functionPK10hashkit_st"></span><span id="_CPPv233hashkit_get_distribution_functionPK10hashkit_st"></span><span id="hashkit_get_distribution_function__hashkit_stCP"></span><a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t">hashkit_hash_algorithm_t</a> <code class="descname">hashkit_get_distribution_function</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st">hashkit_st</a> *<em>hash</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv433hashkit_get_distribution_functionPK10hashkit_st" title="Permalink to this definition"></a><br /></dt>
415 <dd><table class="docutils field-list" frame="void" rules="none">
416 <col class="field-name" />
417 <col class="field-body" />
418 <tbody valign="top">
419 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>hash</strong> -- pointer to an initialized <a class="reference internal" href="hashkit_create.html#_CPPv410hashkit_st" title="hashkit_st"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_st</span></code></a> struct</td>
420 </tr>
421 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_algorithm_t</span></code></a> indicating the currently set distribution hash algorithm to use</td>
422 </tr>
423 </tbody>
424 </table>
425 </dd></dl>
426
427 </div>
428 <div class="section" id="description">
429 <h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
430 <p>These functions are used to set and retrieve the key and distribution hash functions.</p>
431 </div>
432 <div class="section" id="return-value">
433 <h2>RETURN VALUE<a class="headerlink" href="#return-value" title="Permalink to this headline"></a></h2>
434 <p><a class="reference internal" href="#_CPPv420hashkit_set_functionP10hashkit_st24hashkit_hash_algorithm_t" title="hashkit_set_function"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_set_function()</span></code></a>, <a class="reference internal" href="#_CPPv427hashkit_set_custom_functionP10hashkit_st15hashkit_hash_fnPv" title="hashkit_set_custom_function"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_set_custom_function()</span></code></a> and the distribution
435 equivalents return <a class="reference internal" href="#_CPPv4N16hashkit_return_t15HASHKIT_SUCCESSE" title="hashkit_return_t::HASHKIT_SUCCESS"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_return_t::HASHKIT_SUCCESS</span></code></a> on success.</p>
436 <p><a class="reference internal" href="#_CPPv420hashkit_get_functionPK10hashkit_st" title="hashkit_get_function"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_get_function()</span></code></a> and <a class="reference internal" href="#_CPPv433hashkit_get_distribution_functionPK10hashkit_st" title="hashkit_get_distribution_function"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_get_distribution_function()</span></code></a> return
437 <a class="reference internal" href="#_CPPv424hashkit_hash_algorithm_t" title="hashkit_hash_algorithm_t"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">hashkit_hash_algorithm_t</span></code></a> indicating the hash function used.</p>
438 </div>
439 <div class="section" id="see-also">
440 <h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline"></a></h2>
441 <ul class="simple">
442 <li><a class="reference internal" href="index.html"><span class="doc">libhashkit - C/C++ hashing library</span></a></li>
443 <li><a class="reference internal" href="hashkit_create.html"><span class="doc">Creating a hashkit structure</span></a></li>
444 <li><a class="reference internal" href="hashkit_functions.html"><span class="doc">Available Hashes</span></a></li>
445 </ul>
446 </div>
447 </div>
448
449
450 </div>
451
452 </div>
453 <footer>
454
455 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
456
457 <a href="hashkit_functions.html" class="btn btn-neutral float-right" title="Available Hashes" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
458
459
460 <a href="hashkit_create.html" class="btn btn-neutral float-left" title="Creating a hashkit structure" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
461
462 </div>
463
464
465 <hr/>
466
467 <div role="contentinfo">
468 <p>
469 &copy; <a href="../copyright.html">Copyright</a>
470
471 </p>
472 </div>
473 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
474
475 </footer>
476
477 </div>
478 </div>
479
480 </section>
481
482 </div>
483
484
485
486 <script type="text/javascript">
487 jQuery(function () {
488 SphinxRtdTheme.Navigation.enable(true);
489 });
490 </script>
491
492
493
494
495
496
497 </body>
498 </html>