summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
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