diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-05-03 13:18:33 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-05-03 15:19:34 +0200 |
commit | 53eab85617c656b88a48968971e3b79d1310cb71 (patch) | |
tree | a59247798b5d1ff49cab4e515c91be6ecd524555 /src/vcal.c | |
parent | Think it's only reintroducing of set! left. (diff) | |
download | calp-SCM.tar.gz calp-SCM.tar.xz |
moreSCM
Diffstat (limited to 'src/vcal.c')
-rw-r--r-- | src/vcal.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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; } |