aboutsummaryrefslogtreecommitdiff
path: root/vcal.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-02-10 18:58:35 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-15 20:03:43 +0100
commitf865f1554dec3d6fb71eab9c02ecbb6f0bfcb821 (patch)
treececc4eda62b8892828d67253b411ae5c1c79803f /vcal.h
parentMerge strbuf copy functions. (diff)
downloadcalp-f865f1554dec3d6fb71eab9c02ecbb6f0bfcb821.tar.gz
calp-f865f1554dec3d6fb71eab9c02ecbb6f0bfcb821.tar.xz
Replace key_val type with templatized PAIR(T, V).
Diffstat (limited to 'vcal.h')
-rw-r--r--vcal.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/vcal.h b/vcal.h
index c86144f6..0451a037 100644
--- a/vcal.h
+++ b/vcal.h
@@ -10,17 +10,13 @@
// #include "trie.h"
#undef TYPE
-typedef struct {
- strbuf key;
- strbuf val;
-} key_val;
-
-INIT_F(key_val);
-FREE_F(key_val);
-FMT_F(key_val);
-int DEEP_COPY(key_val) (key_val* dest, key_val* src);
+#define T strbuf
+#define V strbuf
+#include "pair.h"
+#undef T
+#undef V
-#define TYPE key_val
+#define TYPE PAIR(strbuf, strbuf)
#include "linked_list.h"
#undef TYPE
@@ -29,7 +25,7 @@ typedef struct {
LLIST(strbuf) vals;
- LLIST(key_val) params;
+ LLIST(PAIR(strbuf, strbuf)) params;
} content_line;
INIT_F(content_line);