From 53eab85617c656b88a48968971e3b79d1310cb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 3 May 2019 13:18:33 +0200 Subject: more --- src/vcal.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/vcal.c') diff --git a/src/vcal.c b/src/vcal.c index 208a47a9..1df528f4 100644 --- a/src/vcal.c +++ b/src/vcal.c @@ -142,9 +142,6 @@ int DEEP_COPY(vcomponent)(vcomponent* a, vcomponent* b) { // TODO int vcomponent_copy(vcomponent* dest, vcomponent* src) { - ERR("Deep copy not implemented for vcomponent"); - (void) dest; - (void) src; #if 0 DEEP_COPY(TRIE(content_line))(&dest->clines, &src->clines); @@ -156,6 +153,16 @@ int vcomponent_copy(vcomponent* dest, vcomponent* src) { PUSH(vcomponent)(src->parent, dest); #endif + SCM proc = scm_c_eval_string("(lambda (dest) (lambda (k v) (hashq-set! dest k v)))"); + SCM iproc = scm_call_1 (proc, dest->clines); + scm_hash_for_each (iproc, src->clines); + + SCM lst = src->components; + while (! scm_is_null (lst)) { + PUSH(vcomponent)(dest, scm_to_vcomponent(SCM_CAR(lst))); + } + + PUSH(vcomponent)(src->parent, dest); return 0; } -- cgit v1.2.3