MirBSD manpage: ohash_create_entry(3), ohash_interval(3), ohash_qlookup(3), ohash_qlookupi(3)

OPEN_HASH_HELPER(3)        BSD Programmer's Manual         OPEN_HASH_HELPER(3)


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


     #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 *start,
             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);


     These functions are commonly used to simplify open hashing usage, and use
     similar conventions. They operate indifferently on NUL-terminated strings
     (by setting *pend = NULL) or memory ranges
     (delimited by start and *pend). For NUL-terminated strings, as a side ef-
     fect, those functions set *pend to the terminating NUL 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 ohash_interval()
     and ohash_lookup_interval().

     ohash_qlookup() is a variation on ohash_qlookupi() designed for NUL-
     terminated strings.




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


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

MirBSD #10-current            February 23, 2001                              1

Generated on 2022-12-24 01:00:14 by $MirOS: src/scripts/roff2htm,v 1.113 2022/12/21 23:14:31 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2022 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.

Kontakt / Impressum & Datenschutzerklärung