aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-02-26 00:55:31 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-02-26 00:57:39 +0100
commit147b75ceff2a4968be2b0244974972482d512c46 (patch)
treec8969267a92820c99d61e17c4d0e4288ed9e3f9a
parentRename some functions. (diff)
downloadcalp-147b75ceff2a4968be2b0244974972482d512c46.tar.gz
calp-147b75ceff2a4968be2b0244974972482d512c46.tar.xz
Add vcompponent_push_child_x.
-rw-r--r--guile_interface.scm.c15
-rw-r--r--parse.c1
-rw-r--r--vcal.c1
3 files changed, 16 insertions, 1 deletions
diff --git a/guile_interface.scm.c b/guile_interface.scm.c
index 537224f6..78045fca 100644
--- a/guile_interface.scm.c
+++ b/guile_interface.scm.c
@@ -96,6 +96,21 @@ SCM_DEFINE(vcomponent_children, "%vcomponent-children", 1, 0, 0,
return scm_from_vector(&cal->components, vcomponent_type);
}
+SCM_DEFINE(vcomponent_push_child_x, "%vcomponent-push-child!", 2, 0, 0,
+ (SCM component, SCM child),
+ "")
+{
+ scm_assert_foreign_object_type (vcomponent_type, component);
+ scm_assert_foreign_object_type (vcomponent_type, child);
+ vcomponent* comp = scm_foreign_object_ref (component, 0);
+ vcomponent* chil = scm_foreign_object_ref (child, 0);
+
+ PUSH(vcomponent)(comp, chil);
+
+ return SCM_UNSPECIFIED;
+}
+
+
SCM_DEFINE(vcomponent_typeof, "%vcomponent-type", 1, 0, 0,
(SCM component),
"Returns type of vcomponent")
diff --git a/parse.c b/parse.c
index 227fd6cc..30412e1a 100644
--- a/parse.c
+++ b/parse.c
@@ -175,7 +175,6 @@ int handle_kv (
s->mem,
ctx->filename);
vcomponent* parent = PEEK(LLIST(vcomponent))(&ctx->comp_stack);
- e->parent = parent;
PUSH(vcomponent)(parent, e);
PUSH(LLIST(vcomponent))(&ctx->comp_stack, e);
diff --git a/vcal.c b/vcal.c
index 9aa08c7c..a17f1fcc 100644
--- a/vcal.c
+++ b/vcal.c
@@ -110,6 +110,7 @@ FREE_F(vcomponent) {
}
int PUSH(vcomponent)(vcomponent* parent, vcomponent* child) {
+ child->parent = parent;
return PUSH(VECT(vcomponent))(&parent->components, child);
}