diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-26 00:55:31 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-02-26 00:57:39 +0100 |
commit | 147b75ceff2a4968be2b0244974972482d512c46 (patch) | |
tree | c8969267a92820c99d61e17c4d0e4288ed9e3f9a | |
parent | Rename some functions. (diff) | |
download | calp-147b75ceff2a4968be2b0244974972482d512c46.tar.gz calp-147b75ceff2a4968be2b0244974972482d512c46.tar.xz |
Add vcompponent_push_child_x.
Diffstat (limited to '')
-rw-r--r-- | guile_interface.scm.c | 15 | ||||
-rw-r--r-- | parse.c | 1 | ||||
-rw-r--r-- | vcal.c | 1 |
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") @@ -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); @@ -110,6 +110,7 @@ FREE_F(vcomponent) { } int PUSH(vcomponent)(vcomponent* parent, vcomponent* child) { + child->parent = parent; return PUSH(VECT(vcomponent))(&parent->components, child); } |