aboutsummaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-05 15:38:03 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-05 18:16:19 +0100
commit447e42b4fbf5567b3cf96ddee0186f76f0c7ebe9 (patch)
tree349566b092f4d6f566cad3411f4e926534c5b304 /hash.h
parentAdd single file mode. (diff)
downloadcalp-447e42b4fbf5567b3cf96ddee0186f76f0c7ebe9.tar.gz
calp-447e42b4fbf5567b3cf96ddee0186f76f0c7ebe9.tar.xz
Improve templating macros.
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/hash.h b/hash.h
index 02741642..e1ff7385 100644
--- a/hash.h
+++ b/hash.h
@@ -7,9 +7,7 @@
unsigned long hash(char*);
-#define TABLE(T) TP(table__, T)
-#define HASH_PUT(T) TP(hash_put_, T)
-#define HASH_GET(T) TP(hash_get_, T)
+#define HASHT(T) TEMPL(hash_t, T)
#endif /* HASH_H */
#ifdef TYPE
@@ -24,16 +22,16 @@ typedef struct {
TYPE** values;
} TABLE(TYPE);
-int HASH_PUT(TYPE) ( TABLE(TYPE)* table, TYPE* value );
+int PUSH(HASHT(TYPE)) ( HASHT(TYPE)* table, TYPE* value );
-INIT_F(HASH(TYPE), int init_size );
+INIT_F(HASHT(TYPE), int init_size );
-TYPE* HASH_GET(TYPE) ( TABLE(TYPE)* table, char* key );
+TYPE* GET(HASHT(TYPE)) ( HASHT(TYPE)* table, char* key );
/*
* Free's all item's stored in table.
* And finally frees table.
*/
-FREE_F(HASH(TYPE));
+FREE_F(HASHT(TYPE));
#endif /* HASH_H */