b68c475aa2d6bc5114e21d3f0d6879c8d40ee0c9
[m6w6/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 1.0.99 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
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 1.0
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 <p class="caption"><span class="caption-text">libmemcached</span></p>
89 <ul>
90 <li class="toctree-l1"><a class="reference internal" href="../libmemcached.html">Introduction</a></li>
91 <li class="toctree-l1"><a class="reference internal" href="../libmemcached/index.html">libmemcached API</a></li>
92 <li class="toctree-l1"><a class="reference internal" href="../libmemcached/index_misc.html">Misc</a></li>
93 </ul>
94 <p class="caption"><span class="caption-text">libmemcachedutil</span></p>
95 <ul>
96 <li class="toctree-l1"><a class="reference internal" href="../libmemcachedutil.html">Introduction</a></li>
97 <li class="toctree-l1"><a class="reference internal" href="../libmemcachedutil/index.html">libmemcachedutil API</a></li>
98 </ul>
99 <p class="caption"><span class="caption-text">libhashkit</span></p>
100 <ul class="current">
101 <li class="toctree-l1"><a class="reference internal" href="../libhashkit.html">Introduction</a></li>
102 <li class="toctree-l1 current"><a class="reference internal" href="index.html">libhashkit API</a><ul class="current">
103 <li class="toctree-l2"><a class="reference internal" href="hashkit_create.html">Creating a hashkit structure</a></li>
104 <li class="toctree-l2 current"><a class="current reference internal" href="#">Set Hash Function</a></li>
105 <li class="toctree-l2"><a class="reference internal" href="hashkit_functions.html">Available Hashes</a></li>
106 <li class="toctree-l2"><a class="reference internal" href="hashkit_value.html">Generate hash value</a></li>
107 </ul>
108 </li>
109 </ul>
110 <p class="caption"><span class="caption-text">Client Applications</span></p>
111 <ul>
112 <li class="toctree-l1"><a class="reference internal" href="../bin/index.html">Client Applications</a></li>
113 </ul>
114 <p class="caption"><span class="caption-text">Copyright</span></p>
115 <ul>
116 <li class="toctree-l1"><a class="reference internal" href="../copyright.html">Copyright</a></li>
117 </ul>
118
119
120
121 </div>
122 </div>
123 </nav>
124
125 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
126
127
128 <nav class="wy-nav-top" aria-label="top navigation">
129
130 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
131 <a href="../index.html">libmemcached</a>
132
133 </nav>
134
135
136 <div class="wy-nav-content">
137
138 <div class="rst-content">
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156 <div role="navigation" aria-label="breadcrumbs navigation">
157
158 <ul class="wy-breadcrumbs">
159
160 <li><a href="../index.html">Docs</a> &raquo;</li>
161
162 <li><a href="index.html">libhashkit API</a> &raquo;</li>
163
164 <li>Set Hash Function</li>
165
166
167 <li class="wy-breadcrumbs-aside">
168
169
170
171 </li>
172
173 </ul>
174
175
176 <hr/>
177 </div>
178 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
179 <div itemprop="articleBody">
180
181 <div class="section" id="set-hash-function">
182 <h1>Set Hash Function<a class="headerlink" href="#set-hash-function" title="Permalink to this headline"></a></h1>
183 <div class="section" id="synopsis">
184 <h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline"></a></h2>
185 <dl class="docutils">
186 <dt>#include &lt;libhashkit-1.0/hashkit.h&gt;</dt>
187 <dd>Compile and link with -lhashkit</dd>
188 </dl>
189 <dl class="type">
190 <dt id="_CPPv415hashkit_hash_fn">
191 <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>
192 <dd><table class="docutils field-list" frame="void" rules="none">
193 <col class="field-name" />
194 <col class="field-body" />
195 <tbody valign="top">
196 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
197 <li><strong>key</strong> -- the key to generate a hash of</li>
198 <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>
199 <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>
200 </ul>
201 </td>
202 </tr>
203 <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>
204 </td>
205 </tr>
206 </tbody>
207 </table>
208 </dd></dl>
209
210 <dl class="type">
211 <dt id="c.hashkit_return_t">
212 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>
213 <dd></dd></dl>
214
215 <dl class="enum">
216 <dt id="_CPPv416hashkit_return_t">
217 <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>
218 <dd><dl class="enumerator">
219 <dt id="_CPPv4N16hashkit_return_t15HASHKIT_SUCCESSE">
220 <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>
221 <dd><p>Operation succeeded.</p>
222 </dd></dl>
223
224 <dl class="enumerator">
225 <dt id="_CPPv4N16hashkit_return_t15HASHKIT_FAILUREE">
226 <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>
227 <dd><p>Operation failed.</p>
228 </dd></dl>
229
230 <dl class="enumerator">
231 <dt id="_CPPv4N16hashkit_return_t33HASHKIT_MEMORY_ALLOCATION_FAILUREE">
232 <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>
233 <dd><p>Memory allocation failed.</p>
234 </dd></dl>
235
236 <dl class="enumerator">
237 <dt id="_CPPv4N16hashkit_return_t20HASHKIT_INVALID_HASHE">
238 <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>
239 <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>
240 </dd></dl>
241
242 <dl class="enumerator">
243 <dt id="_CPPv4N16hashkit_return_t24HASHKIT_INVALID_ARGUMENTE">
244 <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>
245 <dd><p>Invalid argument passed.</p>
246 </dd></dl>
247
248 </dd></dl>
249
250 <dl class="type">
251 <dt id="c.hashkit_hash_algorithm_t">
252 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>
253 <dd></dd></dl>
254
255 <dl class="enum">
256 <dt id="_CPPv424hashkit_hash_algorithm_t">
257 <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>
258 <dd><dl class="enumerator">
259 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_DEFAULTE">
260 <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>
261 <dd><p>Default hash algorithm (one_at_a_time).</p>
262 </dd></dl>
263
264 <dl class="enumerator">
265 <dt id="_CPPv4N24hashkit_hash_algorithm_t16HASHKIT_HASH_MD5E">
266 <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>
267 <dd></dd></dl>
268
269 <dl class="enumerator">
270 <dt id="_CPPv4N24hashkit_hash_algorithm_t16HASHKIT_HASH_CRCE">
271 <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>
272 <dd></dd></dl>
273
274 <dl class="enumerator">
275 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_64E">
276 <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>
277 <dd></dd></dl>
278
279 <dl class="enumerator">
280 <dt id="_CPPv4N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_64E">
281 <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>
282 <dd></dd></dl>
283
284 <dl class="enumerator">
285 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_FNV1_32E">
286 <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>
287 <dd></dd></dl>
288
289 <dl class="enumerator">
290 <dt id="_CPPv4N24hashkit_hash_algorithm_t21HASHKIT_HASH_FNV1A_32E">
291 <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>
292 <dd></dd></dl>
293
294 <dl class="enumerator">
295 <dt id="_CPPv4N24hashkit_hash_algorithm_t18HASHKIT_HASH_HSIEHE">
296 <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>
297 <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>
298 </dd></dl>
299
300 <dl class="enumerator">
301 <dt id="_CPPv4N24hashkit_hash_algorithm_t19HASHKIT_HASH_MURMURE">
302 <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>
303 <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>
304 </dd></dl>
305
306 <dl class="enumerator">
307 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_MURMUR3E">
308 <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>
309 <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>
310 </dd></dl>
311
312 <dl class="enumerator">
313 <dt id="_CPPv4N24hashkit_hash_algorithm_t20HASHKIT_HASH_JENKINSE">
314 <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>
315 <dd></dd></dl>
316
317 <dl class="enumerator">
318 <dt id="_CPPv4N24hashkit_hash_algorithm_t19HASHKIT_HASH_CUSTOME">
319 <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>
320 <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>
321 </dd></dl>
322
323 </dd></dl>
324
325 <dl class="function">
326 <dt id="_CPPv420hashkit_set_functionP10hashkit_st24hashkit_hash_algorithm_t">
327 <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>
328 <dd><table class="docutils field-list" frame="void" rules="none">
329 <col class="field-name" />
330 <col class="field-body" />
331 <tbody valign="top">
332 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
333 <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>
334 <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>
335 </ul>
336 </td>
337 </tr>
338 <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>
339 </td>
340 </tr>
341 </tbody>
342 </table>
343 </dd></dl>
344
345 <dl class="function">
346 <dt id="_CPPv427hashkit_set_custom_functionP10hashkit_st15hashkit_hash_fnPv">
347 <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>
348 <dd><table class="docutils field-list" frame="void" rules="none">
349 <col class="field-name" />
350 <col class="field-body" />
351 <tbody valign="top">
352 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
353 <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>
354 <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>
355 <li><strong>context</strong> -- pointer to an opaque user managed context for the custom hash function</li>
356 </ul>
357 </td>
358 </tr>
359 <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>
360 </td>
361 </tr>
362 </tbody>
363 </table>
364 </dd></dl>
365
366 <dl class="function">
367 <dt id="_CPPv420hashkit_get_functionPK10hashkit_st">
368 <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>
369 <dd><table class="docutils field-list" frame="void" rules="none">
370 <col class="field-name" />
371 <col class="field-body" />
372 <tbody valign="top">
373 <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>
374 </tr>
375 <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>
376 </tr>
377 </tbody>
378 </table>
379 </dd></dl>
380
381 <dl class="function">
382 <dt id="_CPPv433hashkit_set_distribution_functionP10hashkit_st24hashkit_hash_algorithm_t">
383 <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>
384 <dd><table class="docutils field-list" frame="void" rules="none">
385 <col class="field-name" />
386 <col class="field-body" />
387 <tbody valign="top">
388 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
389 <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>
390 <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>
391 </ul>
392 </td>
393 </tr>
394 <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>
395 </td>
396 </tr>
397 </tbody>
398 </table>
399 </dd></dl>
400
401 <dl class="function">
402 <dt id="_CPPv440hashkit_set_custom_distribution_functionP10hashkit_st15hashkit_hash_fnPv">
403 <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>
404 <dd><table class="docutils field-list" frame="void" rules="none">
405 <col class="field-name" />
406 <col class="field-body" />
407 <tbody valign="top">
408 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
409 <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>
410 <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>
411 <li><strong>context</strong> -- pointer to an opaque user managed context for the custom distribution hash function</li>
412 </ul>
413 </td>
414 </tr>
415 </tbody>
416 </table>
417 </dd></dl>
418
419 <dl class="function">
420 <dt id="_CPPv433hashkit_get_distribution_functionPK10hashkit_st">
421 <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>
422 <dd><table class="docutils field-list" frame="void" rules="none">
423 <col class="field-name" />
424 <col class="field-body" />
425 <tbody valign="top">
426 <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>
427 </tr>
428 <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>
429 </tr>
430 </tbody>
431 </table>
432 </dd></dl>
433
434 </div>
435 <div class="section" id="description">
436 <h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
437 <p>These functions are used to set and retrieve the key and distribution hash functions.</p>
438 </div>
439 <div class="section" id="return-value">
440 <h2>RETURN VALUE<a class="headerlink" href="#return-value" title="Permalink to this headline"></a></h2>
441 <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
442 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>
443 <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
444 <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>
445 </div>
446 <div class="section" id="see-also">
447 <h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline"></a></h2>
448 <ul class="simple">
449 <li><a class="reference internal" href="../libhashkit.html"><span class="doc">libhashkit - C/C++ hashing library</span></a></li>
450 <li><a class="reference internal" href="hashkit_create.html"><span class="doc">Creating a hashkit structure</span></a></li>
451 <li><a class="reference internal" href="hashkit_functions.html"><span class="doc">Available Hashes</span></a></li>
452 </ul>
453 </div>
454 </div>
455
456
457 </div>
458
459 </div>
460 <footer>
461
462 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
463
464 <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>
465
466
467 <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>
468
469 </div>
470
471
472 <hr/>
473
474 <div role="contentinfo">
475 <p>
476 &copy; <a href="../copyright.html">Copyright</a>
477
478 </p>
479 </div>
480 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>.
481
482 </footer>
483
484 </div>
485 </div>
486
487 </section>
488
489 </div>
490
491
492
493 <script type="text/javascript">
494 jQuery(function () {
495 SphinxRtdTheme.Navigation.enable(true);
496 });
497 </script>
498
499
500
501
502
503
504 </body>
505 </html>