*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> ohash_qlookup (3)              



NAME    [Toc]    [Back]

     ohash_interval,      ohash_create_entry,      ohash_qlookup,
ohash_qlookupi -
     helper functions for open hashing

SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <stddef.h>
     #include <ohash.h>

     ohash_interval(const char *start, const char **pend);

     void *
     ohash_create_entry(struct   ohash_info   *info,  const  char
             const char **pend);

     unsigned int
     ohash_qlookupi(struct ohash *h,  const  char  *start,  const
char **pend);

     unsigned int
     ohash_qlookup(struct ohash *h, const char *start);

DESCRIPTION    [Toc]    [Back]

     These  functions  are commonly used to simplify open hashing
usage, and use
     similar conventions.  They operate  indifferently  on  nullterminated
     strings (by setting *pend = NULL) or memory ranges (delimited by start
     and *pend).  For null-terminated strings, as a side  effect,
those functions
 set *pend to the terminating null byte.

     ohash_interval()  is  a  simple hashing function that yields
good results on
     common data sets.

     ohash_create_entry() can be used to create a new record with
a given key.
     In that case, the alloc field of info should point to a malloc(3)-like
     function to allocate the storage.

     ohash_qlookupi() is a wrapper  function  that  simply  calls
     and ohash_lookup_interval().

     ohash_qlookup()  is a variation on ohash_qlookupi() designed
for null-terminated

SEE ALSO    [Toc]    [Back]


STANDARDS    [Toc]    [Back]

     Those functions are completely non-standard  and  should  be
avoided in
     portable programs.

HISTORY    [Toc]    [Back]

     Those  functions  were designed and written for OpenBSD make
by Marc Espie
     in 1999.

OpenBSD     3.6                        February     23,      2001
[ Back ]
 Similar pages
Name OS Title
ohash_lookup_interval OpenBSD light-weight open hashing
ohash_init OpenBSD light-weight open hashing
ohash_next OpenBSD light-weight open hashing
ohash_find OpenBSD light-weight open hashing
ohash_insert OpenBSD light-weight open hashing
ohash_first OpenBSD light-weight open hashing
ohash_lookup_memory OpenBSD light-weight open hashing
ohash_delete OpenBSD light-weight open hashing
ohash_entries OpenBSD light-weight open hashing
ohash_remove OpenBSD light-weight open hashing
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service