diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-01-22 14:31:13 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-01-22 14:31:13 +0100 |
commit | 2135813ebc7cbedb581d6c68865b7177fe4727a2 (patch) | |
tree | 0cb56f100247f705d76016e16028ee6645b461a6 /vcal.h | |
parent | Fix crash. (diff) | |
download | calp-2135813ebc7cbedb581d6c68865b7177fe4727a2.tar.gz calp-2135813ebc7cbedb581d6c68865b7177fe4727a2.tar.xz |
Fixed all leaks.
Diffstat (limited to 'vcal.h')
-rw-r--r-- | vcal.h | 30 |
1 files changed, 6 insertions, 24 deletions
@@ -23,26 +23,19 @@ typedef struct { int param_count; } content_line; +int CONSTRUCTOR_DECL(content_line); +int CONSTRUCTOR_DECL(content_line, int keylen, int vallen); + #define TYPE content_line // #include "hash.h" #include "trie.h" #undef TYPE typedef struct s_vevent { - /* - strbuf dtstart; - strbuf dtend; - strbuf summary; - strbuf description; - */ - // TABLE(content_line) clines; TRIE(content_line) clines; } vevent; -int CONSTRUCTOR_DECL(vevent, int init_size); - -int CONSTRUCTOR_DECL(content_line); -int CONSTRUCTOR_DECL(content_line, int keylen, int vallen); +int CONSTRUCTOR_DECL(vevent); int FREE_DECL(content_line); int content_line_copy (content_line* dest, content_line* src); @@ -51,18 +44,6 @@ content_line* get_property (vevent* ev, char* key); int add_content_line (vevent* ev, content_line* c); -/* - * Deep copy from src -> dest - * Requires dest to be initialized beforehand - * TODO possibly remove this. - */ -int copy_vevent(vevent* dest, vevent* src); - -/* - * Copies src -> dest, initializing all the strbufs along the way. - * Requires dest to be initialized. - */ -int vevent_init_copy(vevent* dest, vevent* src); int free_vevent(vevent* ev); typedef struct { @@ -75,7 +56,8 @@ int CONSTRUCTOR_DECL(vcalendar); int free_vcalendar (vcalendar* cal); /* - * Appends ev to cal. Doesn't copy ev + * Appends ev to cal. Doesn't copy ev. So make sure that it wont go + * out of scope. */ int push_event(vcalendar* cal, vevent* ev); |