add module aware versions of pred interface.
This commit is contained in:
parent
ec0437664c
commit
1fc641b7d1
@ -435,6 +435,8 @@ X_API Int STD_PROTO(YAP_Init,(YAP_init_args *));
|
||||
X_API Int STD_PROTO(YAP_FastInit,(char *));
|
||||
X_API PredEntry *STD_PROTO(YAP_FunctorToPred,(Functor));
|
||||
X_API PredEntry *STD_PROTO(YAP_AtomToPred,(Atom));
|
||||
X_API PredEntry *STD_PROTO(YAP_FunctorToPredInModule,(Functor, Term));
|
||||
X_API PredEntry *STD_PROTO(YAP_AtomToPredInModule,(Atom, Term));
|
||||
X_API Int STD_PROTO(YAP_CallProlog,(Term));
|
||||
X_API void *STD_PROTO(YAP_AllocSpaceFromYap,(unsigned int));
|
||||
X_API void *STD_PROTO(YAP_ReallocSpaceFromYap,(void*,unsigned int));
|
||||
@ -2249,6 +2251,20 @@ YAP_AtomToPred(Atom at)
|
||||
return RepPredProp(PredPropByAtom(at, CurrentModule));
|
||||
}
|
||||
|
||||
X_API PredEntry *
|
||||
YAP_FunctorToPredInModule(Functor func, Term mod)
|
||||
{
|
||||
CACHE_REGS
|
||||
return RepPredProp(PredPropByFunc(func, mod));
|
||||
}
|
||||
|
||||
X_API PredEntry *
|
||||
YAP_AtomToPredInModule(Atom at, Term mod)
|
||||
{
|
||||
CACHE_REGS
|
||||
return RepPredProp(PredPropByAtom(at, mod));
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
run_emulator(YAP_dogoalinfo *dgi)
|
||||
|
13
docs/yap.tex
13
docs/yap.tex
@ -16923,6 +16923,19 @@ Return the predicate whose main functor is @var{f}.
|
||||
@findex YAP_AtomToPred (C-Interface function)
|
||||
Return the arity 0 predicate whose name is @var{at}.
|
||||
|
||||
@item @code{YAP_PredEntryPtr}
|
||||
YAP_FunctorToPredInModule(@code{YAP_Functor} @var{f}, @code{YAP_Module} @var{m}),
|
||||
@findex YAP_FunctorToPredInModule (C-Interface function)
|
||||
Return the predicate in module @var{m} whose main functor is @var{f}.
|
||||
|
||||
@item @code{YAP_PredEntryPtr} YAP_AtomToPred(@code{YAP_Atom} @var{at},
|
||||
@findex YAP_AtomToPred (C-Interface function)
|
||||
Return the arity 0 predicate whose name is @var{at}.
|
||||
|
||||
@item @code{YAP_PredEntryPtr} YAP_AtomToPred(@code{YAP_Atom} @var{at}, @code{YAP_Module} @var{m}),
|
||||
@findex YAP_AtomToPredInModule (C-Interface function)
|
||||
Return the arity 0 predicate in module @var{m} whose name is @var{at}.
|
||||
|
||||
@item @code{YAP_Bool} YAP_EnterGoal(@code{YAP_PredEntryPtr} @var{pe},
|
||||
@code{YAP_Term *} @var{array}, @code{YAP_dogoalinfo *} @var{infop})
|
||||
@findex YAP_EnterGoal (C-Interface function)
|
||||
|
@ -296,6 +296,11 @@ extern X_API YAP_PredEntryPtr PROTO(YAP_FunctorToPred,(YAP_Functor));
|
||||
/* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */
|
||||
extern X_API YAP_PredEntryPtr PROTO(YAP_AtomToPred,(YAP_Atom));
|
||||
|
||||
extern X_API YAP_PredEntryPtr PROTO(YAP_FunctorToPredInModule,(YAP_Functor, YAP_Module));
|
||||
|
||||
/* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */
|
||||
extern X_API YAP_PredEntryPtr PROTO(YAP_AtomToPredInModule,(YAP_Atom, YAP_Module));
|
||||
|
||||
/* int YAP_EnterGoal(void) */
|
||||
extern X_API YAP_Bool PROTO(YAP_EnterGoal,(YAP_PredEntryPtr, YAP_Term *, YAP_dogoalinfo *));
|
||||
|
||||
|
Reference in New Issue
Block a user