Merge from vendor branch NTPD:
[dragonfly.git] / secure / lib / libcrypto / man / lhash.3
1 .rn '' }`
2 ''' $RCSfile$$Revision$$Date$
3 '''
4 ''' $Log$
5 '''
6 .de Sh
7 .br
8 .if t .Sp
9 .ne 5
10 .PP
11 \fB\\$1\fR
12 .PP
13 ..
14 .de Sp
15 .if t .sp .5v
16 .if n .sp
17 ..
18 .de Ip
19 .br
20 .ie \\n(.$>=3 .ne \\$3
21 .el .ne 3
22 .IP "\\$1" \\$2
23 ..
24 .de Vb
25 .ft CW
26 .nf
27 .ne \\$1
28 ..
29 .de Ve
30 .ft R
31
32 .fi
33 ..
34 '''
35 '''
36 '''     Set up \*(-- to give an unbreakable dash;
37 '''     string Tr holds user defined translation string.
38 '''     Bell System Logo is used as a dummy character.
39 '''
40 .tr \(*W-|\(bv\*(Tr
41 .ie n \{\
42 .ds -- \(*W-
43 .ds PI pi
44 .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
45 .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
46 .ds L" ""
47 .ds R" ""
48 '''   \*(M", \*(S", \*(N" and \*(T" are the equivalent of
49 '''   \*(L" and \*(R", except that they are used on ".xx" lines,
50 '''   such as .IP and .SH, which do another additional levels of
51 '''   double-quote interpretation
52 .ds M" """
53 .ds S" """
54 .ds N" """""
55 .ds T" """""
56 .ds L' '
57 .ds R' '
58 .ds M' '
59 .ds S' '
60 .ds N' '
61 .ds T' '
62 'br\}
63 .el\{\
64 .ds -- \(em\|
65 .tr \*(Tr
66 .ds L" ``
67 .ds R" ''
68 .ds M" ``
69 .ds S" ''
70 .ds N" ``
71 .ds T" ''
72 .ds L' `
73 .ds R' '
74 .ds M' `
75 .ds S' '
76 .ds N' `
77 .ds T' '
78 .ds PI \(*p
79 'br\}
80 .\"     If the F register is turned on, we'll generate
81 .\"     index entries out stderr for the following things:
82 .\"             TH      Title 
83 .\"             SH      Header
84 .\"             Sh      Subsection 
85 .\"             Ip      Item
86 .\"             X<>     Xref  (embedded
87 .\"     Of course, you have to process the output yourself
88 .\"     in some meaninful fashion.
89 .if \nF \{
90 .de IX
91 .tm Index:\\$1\t\\n%\t"\\$2"
92 ..
93 .nr % 0
94 .rr F
95 .\}
96 .TH lhash 3 "0.9.7d" "2/Sep/2004" "OpenSSL"
97 .UC
98 .if n .hy 0
99 .if n .na
100 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
101 .de CQ          \" put $1 in typewriter font
102 .ft CW
103 'if n "\c
104 'if t \\&\\$1\c
105 'if n \\&\\$1\c
106 'if n \&"
107 \\&\\$2 \\$3 \\$4 \\$5 \\$6 \\$7
108 '.ft R
109 ..
110 .\" @(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2
111 .       \" AM - accent mark definitions
112 .bd B 3
113 .       \" fudge factors for nroff and troff
114 .if n \{\
115 .       ds #H 0
116 .       ds #V .8m
117 .       ds #F .3m
118 .       ds #[ \f1
119 .       ds #] \fP
120 .\}
121 .if t \{\
122 .       ds #H ((1u-(\\\\n(.fu%2u))*.13m)
123 .       ds #V .6m
124 .       ds #F 0
125 .       ds #[ \&
126 .       ds #] \&
127 .\}
128 .       \" simple accents for nroff and troff
129 .if n \{\
130 .       ds ' \&
131 .       ds ` \&
132 .       ds ^ \&
133 .       ds , \&
134 .       ds ~ ~
135 .       ds ? ?
136 .       ds ! !
137 .       ds /
138 .       ds q
139 .\}
140 .if t \{\
141 .       ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
142 .       ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
143 .       ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
144 .       ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
145 .       ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
146 .       ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10'
147 .       ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m'
148 .       ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
149 .       ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10'
150 .\}
151 .       \" troff and (daisy-wheel) nroff accents
152 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
153 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
154 .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#]
155 .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u'
156 .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u'
157 .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#]
158 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
159 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
160 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
161 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
162 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
163 .ds ae a\h'-(\w'a'u*4/10)'e
164 .ds Ae A\h'-(\w'A'u*4/10)'E
165 .ds oe o\h'-(\w'o'u*4/10)'e
166 .ds Oe O\h'-(\w'O'u*4/10)'E
167 .       \" corrections for vroff
168 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
169 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
170 .       \" for low resolution devices (crt and lpr)
171 .if \n(.H>23 .if \n(.V>19 \
172 \{\
173 .       ds : e
174 .       ds 8 ss
175 .       ds v \h'-1'\o'\(aa\(ga'
176 .       ds _ \h'-1'^
177 .       ds . \h'-1'.
178 .       ds 3 3
179 .       ds o a
180 .       ds d- d\h'-1'\(ga
181 .       ds D- D\h'-1'\(hy
182 .       ds th \o'bp'
183 .       ds Th \o'LP'
184 .       ds ae ae
185 .       ds Ae AE
186 .       ds oe oe
187 .       ds Oe OE
188 .\}
189 .rm #[ #] #H #V #F C
190 .SH "NAME"
191 lh_new, lh_free, lh_insert, lh_delete, lh_retrieve, lh_doall, lh_doall_arg, lh_error \- dynamic hash table
192 .SH "SYNOPSIS"
193 .PP
194 .Vb 1
195 \& #include <openssl/lhash.h>
196 .Ve
197 .Vb 2
198 \& LHASH *lh_new(LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE compare);
199 \& void lh_free(LHASH *table);
200 .Ve
201 .Vb 3
202 \& void *lh_insert(LHASH *table, void *data);
203 \& void *lh_delete(LHASH *table, void *data);
204 \& void *lh_retrieve(LHASH *table, void *data);
205 .Ve
206 .Vb 3
207 \& void lh_doall(LHASH *table, LHASH_DOALL_FN_TYPE func);
208 \& void lh_doall_arg(LHASH *table, LHASH_DOALL_ARG_FN_TYPE func,
209 \&          void *arg);
210 .Ve
211 .Vb 1
212 \& int lh_error(LHASH *table);
213 .Ve
214 .Vb 4
215 \& typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *);
216 \& typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *);
217 \& typedef void (*LHASH_DOALL_FN_TYPE)(const void *);
218 \& typedef void (*LHASH_DOALL_ARG_FN_TYPE)(const void *, const void *);
219 .Ve
220 .SH "DESCRIPTION"
221 This library implements dynamic hash tables. The hash table entries
222 can be arbitrary structures. Usually they consist of key and value
223 fields.
224 .PP
225 \fIlh_new()\fR creates a new \fBLHASH\fR structure to store arbitrary data
226 entries, and provides the \*(L'hash\*(R' and \*(L'compare\*(R' callbacks to be used in
227 organising the table's entries.  The \fBhash\fR callback takes a pointer
228 to a table entry as its argument and returns an unsigned long hash
229 value for its key field.  The hash value is normally truncated to a
230 power of 2, so make sure that your hash function returns well mixed
231 low order bits.  The \fBcompare\fR callback takes two arguments (pointers
232 to two hash table entries), and returns 0 if their keys are equal,
233 non-zero otherwise.  If your hash table will contain items of some
234 particular type and the \fBhash\fR and \fBcompare\fR callbacks hash/compare
235 these types, then the \fBDECLARE_LHASH_HASH_FN\fR and
236 \fBIMPLEMENT_LHASH_COMP_FN\fR macros can be used to create callback
237 wrappers of the prototypes required by \fIlh_new()\fR.  These provide
238 per-variable casts before calling the type-specific callbacks written
239 by the application author.  These macros, as well as those used for
240 the \*(L"doall\*(R" callbacks, are defined as;
241 .PP
242 .Vb 7
243 \& #define DECLARE_LHASH_HASH_FN(f_name,o_type) \e
244 \&         unsigned long f_name##_LHASH_HASH(const void *);
245 \& #define IMPLEMENT_LHASH_HASH_FN(f_name,o_type) \e
246 \&         unsigned long f_name##_LHASH_HASH(const void *arg) { \e
247 \&                 o_type a = (o_type)arg; \e
248 \&                 return f_name(a); }
249 \& #define LHASH_HASH_FN(f_name) f_name##_LHASH_HASH
250 .Ve
251 .Vb 8
252 \& #define DECLARE_LHASH_COMP_FN(f_name,o_type) \e
253 \&         int f_name##_LHASH_COMP(const void *, const void *);
254 \& #define IMPLEMENT_LHASH_COMP_FN(f_name,o_type) \e
255 \&         int f_name##_LHASH_COMP(const void *arg1, const void *arg2) { \e
256 \&                 o_type a = (o_type)arg1; \e
257 \&                 o_type b = (o_type)arg2; \e
258 \&                 return f_name(a,b); }
259 \& #define LHASH_COMP_FN(f_name) f_name##_LHASH_COMP
260 .Ve
261 .Vb 7
262 \& #define DECLARE_LHASH_DOALL_FN(f_name,o_type) \e
263 \&         void f_name##_LHASH_DOALL(const void *);
264 \& #define IMPLEMENT_LHASH_DOALL_FN(f_name,o_type) \e
265 \&         void f_name##_LHASH_DOALL(const void *arg) { \e
266 \&                 o_type a = (o_type)arg; \e
267 \&                 f_name(a); }
268 \& #define LHASH_DOALL_FN(f_name) f_name##_LHASH_DOALL
269 .Ve
270 .Vb 8
271 \& #define DECLARE_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \e
272 \&         void f_name##_LHASH_DOALL_ARG(const void *, const void *);
273 \& #define IMPLEMENT_LHASH_DOALL_ARG_FN(f_name,o_type,a_type) \e
274 \&         void f_name##_LHASH_DOALL_ARG(const void *arg1, const void *arg2) { \e
275 \&                 o_type a = (o_type)arg1; \e
276 \&                 a_type b = (a_type)arg2; \e
277 \&                 f_name(a,b); }
278 \& #define LHASH_DOALL_ARG_FN(f_name) f_name##_LHASH_DOALL_ARG
279 .Ve
280 An example of a hash table storing (pointers to) structures of type \*(L'STUFF\*(R'
281 could be defined as follows;
282 .PP
283 .Vb 14
284 \& /* Calculates the hash value of 'tohash' (implemented elsewhere) */
285 \& unsigned long STUFF_hash(const STUFF *tohash);
286 \& /* Orders 'arg1' and 'arg2' (implemented elsewhere) */
287 \& int STUFF_cmp(const STUFF *arg1, const STUFF *arg2);
288 \& /* Create the type-safe wrapper functions for use in the LHASH internals */
289 \& static IMPLEMENT_LHASH_HASH_FN(STUFF_hash, const STUFF *)
290 \& static IMPLEMENT_LHASH_COMP_FN(STUFF_cmp, const STUFF *);
291 \& /* ... */
292 \& int main(int argc, char *argv[]) {
293 \&         /* Create the new hash table using the hash/compare wrappers */
294 \&         LHASH *hashtable = lh_new(LHASH_HASH_FN(STUFF_hash),
295 \&                                   LHASH_COMP_FN(STUFF_cmp));
296 \&         /* ... */
297 \& }
298 .Ve
299 \fIlh_free()\fR frees the \fBLHASH\fR structure \fBtable\fR. Allocated hash table
300 entries will not be freed; consider using \fIlh_doall()\fR to deallocate any
301 remaining entries in the hash table (see below).
302 .PP
303 \fIlh_insert()\fR inserts the structure pointed to by \fBdata\fR into \fBtable\fR.
304 If there already is an entry with the same key, the old value is
305 replaced. Note that \fIlh_insert()\fR stores pointers, the data are not
306 copied.
307 .PP
308 \fIlh_delete()\fR deletes an entry from \fBtable\fR.
309 .PP
310 \fIlh_retrieve()\fR looks up an entry in \fBtable\fR. Normally, \fBdata\fR is
311 a structure with the key \fIfield\fR\|(s) set; the function will return a
312 pointer to a fully populated structure.
313 .PP
314 \fIlh_doall()\fR will, for every entry in the hash table, call \fBfunc\fR with
315 the data item as its parameter.  For \fIlh_doall()\fR and \fIlh_doall_arg()\fR,
316 function pointer casting should be avoided in the callbacks (see
317 \fBNOTE\fR) \- instead, either declare the callbacks to match the
318 prototype required in \fIlh_new()\fR or use the declare/implement macros to
319 create type-safe wrappers that cast variables prior to calling your
320 type-specific callbacks.  An example of this is illustrated here where
321 the callback is used to cleanup resources for items in the hash table
322 prior to the hashtable itself being deallocated:
323 .PP
324 .Vb 9
325 \& /* Cleans up resources belonging to 'a' (this is implemented elsewhere) */
326 \& void STUFF_cleanup(STUFF *a);
327 \& /* Implement a prototype-compatible wrapper for "STUFF_cleanup" */
328 \& IMPLEMENT_LHASH_DOALL_FN(STUFF_cleanup, STUFF *)
329 \&         /* ... then later in the code ... */
330 \& /* So to run "STUFF_cleanup" against all items in a hash table ... */
331 \& lh_doall(hashtable, LHASH_DOALL_FN(STUFF_cleanup));
332 \& /* Then the hash table itself can be deallocated */
333 \& lh_free(hashtable);
334 .Ve
335 When doing this, be careful if you delete entries from the hash table
336 in your callbacks: the table may decrease in size, moving the item
337 that you are currently on down lower in the hash table \- this could
338 cause some entries to be skipped during the iteration.  The second
339 best solution to this problem is to set hash->down_load=0 before
340 you start (which will stop the hash table ever decreasing in size).
341 The best solution is probably to avoid deleting items from the hash
342 table inside a \*(L"doall\*(R" callback!
343 .PP
344 \fIlh_doall_arg()\fR is the same as \fIlh_doall()\fR except that \fBfunc\fR will be
345 called with \fBarg\fR as the second argument and \fBfunc\fR should be of
346 type \fBLHASH_DOALL_ARG_FN_TYPE\fR (a callback prototype that is passed
347 both the table entry and an extra argument).  As with \fIlh_doall()\fR, you
348 can instead choose to declare your callback with a prototype matching
349 the types you are dealing with and use the declare/implement macros to
350 create compatible wrappers that cast variables before calling your
351 type-specific callbacks.  An example of this is demonstrated here
352 (printing all hash table entries to a BIO that is provided by the
353 caller):
354 .PP
355 .Vb 10
356 \& /* Prints item 'a' to 'output_bio' (this is implemented elsewhere) */
357 \& void STUFF_print(const STUFF *a, BIO *output_bio);
358 \& /* Implement a prototype-compatible wrapper for "STUFF_print" */
359 \& static IMPLEMENT_LHASH_DOALL_ARG_FN(STUFF_print, const STUFF *, BIO *)
360 \&         /* ... then later in the code ... */
361 \& /* Print out the entire hashtable to a particular BIO */
362 \& lh_doall_arg(hashtable, LHASH_DOALL_ARG_FN(STUFF_print), logging_bio);
363 \& 
364 \&lh_error() can be used to determine if an error occurred in the last
365 \&operation. lh_error() is a macro.
366 .Ve
367 .SH "RETURN VALUES"
368 \fIlh_new()\fR returns \fBNULL\fR on error, otherwise a pointer to the new
369 \fBLHASH\fR structure.
370 .PP
371 When a hash table entry is replaced, \fIlh_insert()\fR returns the value
372 being replaced. \fBNULL\fR is returned on normal operation and on error.
373 .PP
374 \fIlh_delete()\fR returns the entry being deleted.  \fBNULL\fR is returned if
375 there is no such value in the hash table.
376 .PP
377 \fIlh_retrieve()\fR returns the hash table entry if it has been found,
378 \fBNULL\fR otherwise.
379 .PP
380 \fIlh_error()\fR returns 1 if an error occurred in the last operation, 0
381 otherwise.
382 .PP
383 \fIlh_free()\fR, \fIlh_doall()\fR and \fIlh_doall_arg()\fR return no values.
384 .SH "NOTE"
385 The various LHASH macros and callback types exist to make it possible
386 to write type-safe code without resorting to function-prototype
387 casting \- an evil that makes application code much harder to
388 audit/verify and also opens the window of opportunity for stack
389 corruption and other hard-to-find bugs.  It also, apparently, violates
390 ANSI\-C.
391 .PP
392 The LHASH code regards table entries as constant data.  As such, it
393 internally represents \fIlh_insert()\fR'd items with a \*(L"const void *\*(R"
394 pointer type.  This is why callbacks such as those used by \fIlh_doall()\fR
395 and \fIlh_doall_arg()\fR declare their prototypes with \*(L"const\*(R", even for the
396 parameters that pass back the table items\*(R' data pointers \- for
397 consistency, user-provided data is \*(L"const\*(R" at all times as far as the
398 LHASH code is concerned.  However, as callers are themselves providing
399 these pointers, they can choose whether they too should be treating
400 all such parameters as constant.
401 .PP
402 As an example, a hash table may be maintained by code that, for
403 reasons of encapsulation, has only \*(L"const\*(R" access to the data being
404 indexed in the hash table (ie. it is returned as \*(L"const\*(R" from
405 elsewhere in their code) \- in this case the LHASH prototypes are
406 appropriate as-is.  Conversely, if the caller is responsible for the
407 life-time of the data in question, then they may well wish to make
408 modifications to table item passed back in the \fIlh_doall()\fR or
409 \fIlh_doall_arg()\fR callbacks (see the \*(L"STUFF_cleanup\*(R" example above).  If
410 so, the caller can either cast the \*(L"const\*(R" away (if they're providing
411 the raw callbacks themselves) or use the macros to declare/implement
412 the wrapper functions without \*(L"const\*(R" types.
413 .PP
414 Callers that only have \*(L"const\*(R" access to data they're indexing in a
415 table, yet declare callbacks without constant types (or cast the
416 \*(L"const\*(R" away themselves), are therefore creating their own risks/bugs
417 without being encouraged to do so by the API.  On a related note,
418 those auditing code should pay special attention to any instances of
419 DECLARE/IMPLEMENT_LHASH_DOALL_[ARG_]_FN macros that provide types
420 without any \*(L"const\*(R" qualifiers.
421 .SH "BUGS"
422 \fIlh_insert()\fR returns \fBNULL\fR both for success and error.
423 .SH "INTERNALS"
424 The following description is based on the SSLeay documentation:
425 .PP
426 The \fBlhash\fR library implements a hash table described in the
427 \fICommunications of the ACM\fR in 1991.  What makes this hash table
428 different is that as the table fills, the hash table is increased (or
429 decreased) in size via \fIOPENSSL_realloc()\fR.  When a \*(L'resize\*(R' is done, instead of
430 all hashes being redistributed over twice as many \*(L'buckets\*(R', one
431 bucket is split.  So when an \*(L'expand\*(R' is done, there is only a minimal
432 cost to redistribute some values.  Subsequent inserts will cause more
433 single \*(L'bucket\*(R' redistributions but there will never be a sudden large
434 cost due to redistributing all the \*(L'buckets\*(R'.
435 .PP
436 The state for a particular hash table is kept in the \fBLHASH\fR structure.
437 The decision to increase or decrease the hash table size is made
438 depending on the \*(L'load\*(R' of the hash table.  The load is the number of
439 items in the hash table divided by the size of the hash table.  The
440 default values are as follows.  If (hash->up_load < load) =>
441 expand.  if (hash->down_load > load) => contract.  The
442 \fBup_load\fR has a default value of 1 and \fBdown_load\fR has a default value
443 of 2.  These numbers can be modified by the application by just
444 playing with the \fBup_load\fR and \fBdown_load\fR variables.  The \*(L'load\*(R' is
445 kept in a form which is multiplied by 256.  So
446 hash->up_load=8*256; will cause a load of 8 to be set.
447 .PP
448 If you are interested in performance the field to watch is
449 num_comp_calls.  The hash library keeps track of the \*(L'hash\*(R' value for
450 each item so when a lookup is done, the \*(L'hashes\*(R' are compared, if
451 there is a match, then a full compare is done, and
452 hash->num_comp_calls is incremented.  If num_comp_calls is not equal
453 to num_delete plus num_retrieve it means that your hash function is
454 generating hashes that are the same for different values.  It is
455 probably worth changing your hash function if this is the case because
456 even if your hash table has 10 items in a \*(L'bucket\*(R', it can be searched
457 with 10 \fBunsigned long\fR compares and 10 linked list traverses.  This
458 will be much less expensive that 10 calls to your compare function.
459 .PP
460 \fIlh_strhash()\fR is a demo string hashing function:
461 .PP
462 .Vb 1
463 \& unsigned long lh_strhash(const char *c);
464 .Ve
465 Since the \fBLHASH\fR routines would normally be passed structures, this
466 routine would not normally be passed to \fIlh_new()\fR, rather it would be
467 used in the function passed to \fIlh_new()\fR.
468 .SH "SEE ALSO"
469 lh_stats(3)
470 .SH "HISTORY"
471 The \fBlhash\fR library is available in all versions of SSLeay and OpenSSL.
472 \fIlh_error()\fR was added in SSLeay 0.9.1b.
473 .PP
474 This manpage is derived from the SSLeay documentation.
475 .PP
476 In OpenSSL 0.9.7, all lhash functions that were passed function pointers
477 were changed for better type safety, and the function types LHASH_COMP_FN_TYPE,
478 LHASH_HASH_FN_TYPE, LHASH_DOALL_FN_TYPE and LHASH_DOALL_ARG_FN_TYPE 
479 became available.
480
481 .rn }` ''
482 .IX Title "lhash 3"
483 .IX Name "lh_new, lh_free, lh_insert, lh_delete, lh_retrieve, lh_doall, lh_doall_arg, lh_error - dynamic hash table"
484
485 .IX Header "NAME"
486
487 .IX Header "SYNOPSIS"
488
489 .IX Header "DESCRIPTION"
490
491 .IX Header "RETURN VALUES"
492
493 .IX Header "NOTE"
494
495 .IX Header "BUGS"
496
497 .IX Header "INTERNALS"
498
499 .IX Header "SEE ALSO"
500
501 .IX Header "HISTORY"
502