bzr branch
http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
1 |
/*
|
2 |
*/
|
|
3 |
||
126.1.1
by Gustav Hartvigsson
* Using |
4 |
#pragma once
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
5 |
|
6 |
#include "defs.h" |
|
22
by Gustav Hartvigsson
* Made code compile |
7 |
#include "utils.h" |
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
8 |
|
110
by Gustav Hartvigsson
* added S_ prifix to my macros. I should not be a scrub. |
9 |
S_BEGIN_DECLS
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
10 |
|
11 |
/** @file
|
|
12 |
* A collection of hash functions.
|
|
13 |
*/
|
|
14 |
||
53
by Gustav Hartvigsson
* Finnished up s_map_add () ??? |
15 |
/**
|
16 |
* A HashFunc is the type of function to use when you need to hash some
|
|
17 |
* type of object.
|
|
18 |
*/
|
|
19 |
typedef hash_t (* HashFunc)(const spointer); |
|
20 |
||
21 |
/**
|
|
22 |
* Convinience macro to cast function.
|
|
23 |
*/
|
|
24 |
#define HASH_FUNC(f) (HashFunc)(f)
|
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
25 |
|
26 |
/**
|
|
27 |
* this is the SDBM hash function from:
|
|
28 |
* http://en.literateprograms.org/Hash_function_comparison_%28C,_sh%29
|
|
29 |
*/
|
|
119
by Gustav Hartvigsson
* added S_EXPERTED to public functions. |
30 |
S_EXPORTED
|
61
by Gustav Hartvigsson
* Made the code more easy to read. |
31 |
hash_t
|
32 |
sdbm_hash (const char * key); |
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
33 |
|
119
by Gustav Hartvigsson
* added S_EXPERTED to public functions. |
34 |
S_EXPORTED
|
61
by Gustav Hartvigsson
* Made the code more easy to read. |
35 |
hash_t
|
36 |
s_hash_object (const spointer obj); |
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
37 |
|
29
by Gustav Hartvigsson
* Switched to CMake to future proof the project a lil' bit. |
38 |
/* TODO: Make this settable via CMake. */
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
39 |
/**
|
40 |
* what hash function s_hash is defined to.
|
|
41 |
*/
|
|
109.1.7
by Gustav Hartvigsson
* Fixed SMap, for the time being... |
42 |
#define s_hash sdbm_hash
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
43 |
|
110
by Gustav Hartvigsson
* added S_ prifix to my macros. I should not be a scrub. |
44 |
S_END_DECLS
|