From 44ab8a339c78bcc3460d44b2f435116f21faa60a Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Mon, 5 Jul 2021 16:27:38 +0000 Subject: First step on modules. Still very very rough. --- misc.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'misc.c') 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 -- cgit v1.2.3