export current predicate for SWI built-ins.
This commit is contained in:
@@ -379,6 +379,10 @@ X_API int PL_error(const char *pred, int arity, const char *msg, int id, ...)
|
||||
goto err_instantiation;
|
||||
}
|
||||
va_end(args);
|
||||
if (!pred) {
|
||||
pred = Yap_GetCurrentPredName();
|
||||
arity = Yap_GetCurrentPredArity();
|
||||
}
|
||||
if ( pred )
|
||||
{ PL_unify_term(predterm,
|
||||
PL_FUNCTOR, FUNCTOR_divide2,
|
||||
|
@@ -29,6 +29,10 @@ typedef YAP_Term *Word; /* Anonymous 4 byte object */
|
||||
typedef YAP_Atom Atom;
|
||||
typedef YAP_Term (*Func)(); /* foreign functions */
|
||||
|
||||
const char *Yap_GetCurrentPredName(void);
|
||||
YAP_Int Yap_GetCurrentPredArity(void);
|
||||
|
||||
|
||||
extern atom_t codeToAtom(int chrcode);
|
||||
|
||||
#define valTermRef(t) ((Word)YAP_AddressFromSlot(t))
|
||||
|
Reference in New Issue
Block a user