C-interface improvements

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@463 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2002-05-06 15:33:05 +00:00
parent 81c503970a
commit b8b8dd6a45
5 changed files with 203 additions and 4 deletions

View File

@@ -50,3 +50,26 @@ MkApplTerm(Functor f, unsigned int n, register Term *a)
*H++ = (CELL) * a++;
return (AbsAppl(t));
}
Term
MkNewApplTerm(Functor f, unsigned int n)
/* build compound term with functor f and n
* args a */
{
CELL *t = H;
if (n == 0)
return (MkAtomTerm(NameOfFunctor(f)));
if (f == FunctorList) {
RESET_VARIABLE(H);
RESET_VARIABLE(H+1);
H+=2;
return (AbsPair(t));
}
*H++ = (CELL) f;
while (n--) {
RESET_VARIABLE(H);
H++;
}
return (AbsAppl(t));
}