aboutsummaryrefslogtreecommitdiff
path: root/vcal.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-26 10:56:49 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-26 10:56:49 +0100
commit985ee1776348b2068fb6470e2a2fd3442c2a0811 (patch)
tree53537a365103edf9213a592a7637ee7cee7fd16a /vcal.h
parentMove load-extension to (vcalendar primitive). (diff)
downloadcalp-985ee1776348b2068fb6470e2a2fd3442c2a0811.tar.gz
calp-985ee1776348b2068fb6470e2a2fd3442c2a0811.tar.xz
Start update of types.
Diffstat (limited to 'vcal.h')
-rw-r--r--vcal.h45
1 files changed, 22 insertions, 23 deletions
diff --git a/vcal.h b/vcal.h
index bedf22ee..c688bcf5 100644
--- a/vcal.h
+++ b/vcal.h
@@ -22,23 +22,17 @@
* A parameter key, along with a list of all its values.
*/
-#define T strbuf
- #define V LLIST(strbuf)
- #include "pair.h"
- /* left := param_name | right := param_values */
- #define param_set PAIR(strbuf, LLIST(strbuf))
- #undef V
-#undef T
+#define param_set LLIST(strbuf)
#define TYPE param_set
-#include "linked_list.h"
+#include "trie.h"
#undef TYPE
#define T strbuf
- #define V LLIST(param_set)
+ #define V TRIE(param_set)
#include "pair.h"
/* left := content | right := params */
- #define content_set PAIR(strbuf, LLIST(param_set))
+ #define content_set PAIR(strbuf, TRIE(param_set))
#undef V
#undef T
@@ -46,13 +40,15 @@
#include "linked_list.h"
#undef TYPE
-#define T strbuf
- #define V LLIST(content_set)
- #include "pair.h"
- /* left := content | right := params */
- #define content_line PAIR(strbuf, LLIST(content_set))
- #undef V
-#undef T
+// #define T strbuf
+// #define V LLIST(content_set)
+// #include "pair.h"
+// /* left := content | right := params */
+// #define content_line PAIR(strbuf, LLIST(content_set))
+// #undef V
+// #undef T
+
+#define content_line LLIST(content_set)
/*
* Helper macros for accessing fields in
@@ -62,21 +58,22 @@
*/
/* ptr -> ptr */
-#define CLINE_KEY(c) (&(c)->key)
-#define CLINE_CUR_CSET(c) (&((c)->val.cur->value))
+// #define CLINE_KEY(c) (&(c)->key)
+// #define CLINE_CUR_CSET(c) (&((c)->val.cur->value))
/* content_set */
-#define CLINE_CUR(c) ((c)->val.cur->value)
+#define CLINE_CUR(c) ((c)->cur->value)
+
/* strbuf */
#define CLINE_CUR_VAL(c) (& CLINE_CUR(c)->key)
-/* LLIST(param_set) */
+/* TRIE(param_set) */
#define CLINE_CUR_PARAMS(c) (& CLINE_CUR(c)->val)
/* strbuf */
-#define CLINE_CUR_PARAM_KEY(c) (CLINE_CUR_PARAMS(c)->cur->value->key)
+// #define CLINE_CUR_PARAM_KEY(c) (CLINE_CUR_PARAMS(c)->cur->value->key)
/* strbuf */
-#define CLINE_CUR_PARAM_VAL(c) (CLINE_CUR_PARAMS(c)->cur->value->val.cur->value)
+// #define CLINE_CUR_PARAM_VAL(c) (CLINE_CUR_PARAMS(c)->cur->value->val.cur->value)
/*
* Resolves a collision in some form of structure (probably a hash-map
@@ -84,8 +81,10 @@
* to have the correct form, and returns it. Destroying new_ in the
* process.
*/
+#if 0
content_line* RESOLVE(content_line)
(content_line* dest, content_line* new_);
+#endif
#define TYPE content_line
#include "trie.h"