1 .\" $OpenBSD: ohash_interval.3,v 1.11 2007/05/31 19:19:30 jmc Exp $
2 .\" Copyright (c) 2001 Marc Espie <espie@openbsd.org>
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .Dd $Mdocdate: May 31 2007 $
19 .Dt OPEN_HASH_HELPER 3
23 .Nm ohash_create_entry ,
26 .Nd helper functions for open hashing
32 .Fn ohash_interval "const char *start" "const char **pend"
34 .Fn ohash_create_entry "struct ohash_info *info" "const char *start" "const char **pend"
36 .Fn ohash_qlookupi "struct ohash *h" "const char *start" "const char **pend"
38 .Fn ohash_qlookup "struct ohash *h" "const char *start"
40 These functions are commonly used to simplify open hashing usage, and use
42 They operate indifferently on NUL-terminated strings
56 For NUL-terminated strings, as a side effect, those functions
59 to the terminating NUL byte.
62 is a simple hashing function that yields good results on common data sets.
64 .Fn ohash_create_entry
65 can be used to create a new record with a given key.
71 function to allocate the storage.
74 is a wrapper function that simply calls
77 .Fn ohash_lookup_interval .
82 designed for NUL-terminated strings.
86 Those functions are completely non-standard and should be avoided in
89 Those functions were designed and written for
92 by Marc Espie in 1999.