aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-26 15:12:26 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-26 15:12:26 +0100
commita884e31a8e9464759ac234b3c28f552c05682128 (patch)
treeef0ca30e62e85578b21f04bcf6799c52a7029c83
parentFix memmory errors. (diff)
downloadcalp-a884e31a8e9464759ac234b3c28f552c05682128.tar.gz
calp-a884e31a8e9464759ac234b3c28f552c05682128.tar.xz
Cleanup.
-rw-r--r--vcal.c24
-rw-r--r--vcal.h30
2 files changed, 0 insertions, 54 deletions
diff --git a/vcal.c b/vcal.c
index 94be9399..42342d93 100644
--- a/vcal.c
+++ b/vcal.c
@@ -59,30 +59,6 @@ INIT_F(vcomponent, const char* type, const char* filename) {
return 0;
}
-#if 0
-content_line* RESOLVE(content_line)
- (content_line* dest, content_line* new_)
-{
- if (dest == NULL) return new_;
-
- /*
- if (strbuf_cmp(&dest->key, &new_->key) != 0) {
- ERR("Can't resolve between these two types");
- return NULL;
- }
- */
-
- /* This destroys new_->val. */
- //APPEND(LLIST(content_set)) (&dest->val, &new_->val);
- APPEND(LLIST(content_set)) (dest, new_);
-
- // FREE(strbuf)(&new_->key);
- free(new_);
-
- return dest;
-}
-#endif
-
content_line* get_property (vcomponent* ev, const char* key) {
size_t len = strlen(key) + 1;
char* cpy = (char*) (calloc(sizeof(*cpy), len));
diff --git a/vcal.h b/vcal.h
index c688bcf5..1d643a40 100644
--- a/vcal.h
+++ b/vcal.h
@@ -40,27 +40,13 @@
#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 content_line LLIST(content_set)
/*
* Helper macros for accessing fields in
* content_line, content_set, and param_set
- *
- * TODO find a better way to do self.
*/
-/* ptr -> ptr */
-// #define CLINE_KEY(c) (&(c)->key)
-// #define CLINE_CUR_CSET(c) (&((c)->val.cur->value))
-
/* content_set */
#define CLINE_CUR(c) ((c)->cur->value)
@@ -70,22 +56,6 @@
/* 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)
-/* strbuf */
-// #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
- * or a trie). If dest is NULL just return new_. Otherwise mutates dest
- * 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"
#undef TYPE