rlib
Convenience library for useful things
Loading...
Searching...
No Matches
rhashfuncs.h File Reference

Pre-built hash / equality function pairs for the common key types (pointer-identity, NUL-terminated string). More...

#include <rlib/rtypes.h>

Go to the source code of this file.

Macros

#define R_HASH_EMPTY   RSIZE_MAX
 Sentinel returned by hash functions for "no value".
 

Functions

rsize r_direct_hash (rconstpointer data)
 Pointer-identity hash: treats data as an opaque machine-word and returns it directly.
 
rboolean r_direct_equal (rconstpointer a, rconstpointer b)
 Pointer-identity equality: returns TRUE iff a == b.
 
rsize r_str_hash (rconstpointer data)
 Hash a NUL-terminated C string.
 
rsize r_str_hash_sized (const rchar *data, rssize size)
 Hash a byte string of caller-supplied length.
 
rboolean r_str_equal (rconstpointer a, rconstpointer b)
 Equality for NUL-terminated C strings (via strcmp).
 

Detailed Description

Pre-built hash / equality function pairs for the common key types (pointer-identity, NUL-terminated string).