more threadin fixes

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2300 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2008-08-07 20:51:23 +00:00
parent 6d23a23a81
commit 2581c3a3bf
15 changed files with 221 additions and 153 deletions

View File

@@ -264,6 +264,39 @@ p_context_module(void)
return Yap_unify(ARG1, CurrentModule);
}
Term
Yap_StripModule(Term t, Term *modp)
{
Term tmod;
tmod = CurrentModule;
restart:
if (IsVarTerm(t)) {
return 0L;
} else if (IsAtomTerm(t)) {
*modp = tmod;
return t;
} else if (IsApplTerm(t)) {
Functor fun = FunctorOfTerm(t);
if (fun == FunctorModule) {
tmod = ArgOfTerm(1, t);
if (IsVarTerm(tmod) ) {
return 0L;
}
if (!IsAtomTerm(tmod) ) {
return 0L;
}
t = ArgOfTerm(2, t);
goto restart;
}
*modp = tmod;
return t;
}
return 0L;
}
void
Yap_InitModulesC(void)
{