summaryrefslogtreecommitdiffstats
path: root/src/lib/hash-decl.h
blob: 60fb4e1b73f65f1f4a9871731a060396d4f78807 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef HASH_DECL_H
#define HASH_DECL_H

#define HASH_TABLE_UNION(key_type, value_type) { \
		struct hash_table *_table; \
		key_type _key; \
		key_type *_keyp; \
		const key_type _const_key; \
		value_type _value; \
		value_type *_valuep; \
	}

#define HASH_TABLE_DEFINE_TYPE(name, key_type, value_type) \
	union hash ## __ ## name HASH_TABLE_UNION(key_type, value_type)
#define HASH_TABLE(key_type, value_type) \
	union HASH_TABLE_UNION(key_type, value_type)
#define HASH_TABLE_TYPE(name) \
	union hash ## __ ## name

#endif