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