rlib
Convenience library for useful things
Loading...
Searching...
No Matches
rhashfuncs.h
Go to the documentation of this file.
1/* RLIB - Convenience library for useful things
2 * Copyright (C) 2017 Haakon Sporsheim <haakon.sporsheim@gmail.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3.0 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library.
16 * See the COPYING file at the root of the source repository.
17 */
18#ifndef __R_HASH_FUNCS_H__
19#define __R_HASH_FUNCS_H__
20
21#if !defined(__RLIB_H_INCLUDE_GUARD__) && !defined(RLIB_COMPILATION)
22#error "#include <rlib.h> only please."
23#endif
24
42#include <rlib/rtypes.h>
43
45#define R_HASH_EMPTY RSIZE_MAX
46
48
75
76R_END_DECLS
77
80#endif /* __R_HASH_FUNCS_H__ */
81
rboolean r_direct_equal(rconstpointer a, rconstpointer b)
Pointer-identity equality: returns TRUE iff a == b.
rsize r_direct_hash(rconstpointer data)
Pointer-identity hash: treats data as an opaque machine-word and returns it directly.
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).
#define R_API
Public-API decoration: resolves to R_API_EXPORT while building rlib and R_API_IMPORT for consumers.
Definition rmacros.h:115
#define R_BEGIN_DECLS
Open an extern "C" block under C++ (no-op in C).
Definition rmacros.h:196
char rchar
Default character type (char).
Definition rtypes.h:137
int rboolean
Boolean type (typedef'd to int).
Definition rtypes.h:59
const void * rconstpointer
Generic const pointer (alias for const void *).
Definition rtypes.h:329
unsigned long rsize
Unsigned pointer-sized size type (like size_t).
Definition rtypes.h:290
signed long rssize
Signed pointer-sized size type (like ssize_t).
Definition rtypes.h:291
Foundational type aliases used by every rlib header.