summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorPeter Mikkelsen <peter@pmikkelsen.com>2021-07-05 16:27:38 +0000
committerPeter Mikkelsen <peter@pmikkelsen.com>2021-07-05 16:27:38 +0000
commit44ab8a339c78bcc3460d44b2f435116f21faa60a (patch)
treefa512c143c5df81c0c333a187b9083cbac9636f6 /misc.c
parent3f26a0f2a1f699e628136ec5be6178b5ab40fc44 (diff)
First step on modules. Still very very rough.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index 3bbadbb..be32367 100644
--- a/misc.c
+++ b/misc.c
@@ -132,3 +132,21 @@ mklist(Term *elems)
return mkcompound(L".", 2, t);
}
}
+
+Clause *
+copyclause(Clause *orig, uvlong *clausenr)
+{
+ Clause *new = malloc(sizeof(Clause));
+ new->head = copyterm(orig->head, clausenr);
+ if(orig->body)
+ new->body = copyterm(orig->body, clausenr);
+ else
+ new->body = nil;
+ if(clausenr)
+ new->clausenr = *clausenr;
+ else
+ new->clausenr = orig->clausenr;
+ new->public = orig->public;
+ new->next = nil;
+ return new;
+} \ No newline at end of file