debugging
This commit is contained in:
parent
4052f9b910
commit
62a2c14c12
42
H/Yatom.h
42
H/Yatom.h
@ -1869,32 +1869,52 @@ PredPropByAtomAndMod (Atom at, Term cur_mod)
|
|||||||
// report arity, name, and module for a predicate.
|
// report arity, name, and module for a predicate.
|
||||||
//
|
//
|
||||||
INLINE_ONLY inline EXTERN
|
INLINE_ONLY inline EXTERN
|
||||||
UInt IndicatorOfPred(PredEntry * ap, const char *name, const char *module);
|
UInt IndicatorOfPred(PredEntry * ap, const char **name, const char **module);
|
||||||
|
|
||||||
INLINE_ONLY inline EXTERN
|
INLINE_ONLY inline EXTERN
|
||||||
UInt IndicatorOfPred(PredEntry * ap, const char *name, const char *module)
|
UInt IndicatorOfPred(PredEntry * ap, const char **name, const char **module)
|
||||||
{
|
{
|
||||||
|
if (module) {
|
||||||
Term tmod = ap->ModuleOfPred;
|
Term tmod = ap->ModuleOfPred;
|
||||||
if (!tmod) module = "prolog";
|
if (!tmod) *module = "prolog";
|
||||||
else module = RepAtom(AtomOfTerm( tmod ))->StrOfAE;
|
else *module = RepAtom(AtomOfTerm( tmod ))->StrOfAE;
|
||||||
if (ap->ModuleOfPred == IDB_MODULE &&
|
}
|
||||||
ap->PredFlags & NumberDBPredFlag) {
|
if (ap->ModuleOfPred == IDB_MODULE) {
|
||||||
|
if (ap->PredFlags & NumberDBPredFlag ) {
|
||||||
|
if (name) {
|
||||||
Int id = ap->src.IndxId;
|
Int id = ap->src.IndxId;
|
||||||
char *s = (char *)malloc(16);
|
char *s = (char *)malloc(16);
|
||||||
snprintf(s, 15, Int_FORMAT, id);
|
snprintf(s, 15, Int_FORMAT, id);
|
||||||
name = s;
|
*name = s;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
if (ap->ArityOfPE == 0) {
|
return 0;
|
||||||
|
} else if (ap->PredFlags & AtomDBPredFlag) {
|
||||||
|
if (name) {
|
||||||
Atom At = (Atom)ap->FunctorOfPred;
|
Atom At = (Atom)ap->FunctorOfPred;
|
||||||
name = RepAtom(At)->StrOfAE;
|
*name = RepAtom(At)->StrOfAE;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
Functor f = ap->FunctorOfPred;
|
Functor f = ap->FunctorOfPred;
|
||||||
|
if (name) {
|
||||||
Atom At = NameOfFunctor(f);
|
Atom At = NameOfFunctor(f);
|
||||||
name = RepAtom(At)->StrOfAE;
|
*name = RepAtom(At)->StrOfAE;
|
||||||
|
}
|
||||||
return ArityOfFunctor(f);
|
return ArityOfFunctor(f);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (name) {
|
||||||
|
if (ap->ArityOfPE == 0) {
|
||||||
|
Atom At = (Atom)ap->FunctorOfPred;
|
||||||
|
*name = RepAtom(At)->StrOfAE;
|
||||||
|
} else {
|
||||||
|
Functor f = ap->FunctorOfPred;
|
||||||
|
Atom At = NameOfFunctor(f);
|
||||||
|
*name = RepAtom(At)->StrOfAE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ap->ArityOfPE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG_PELOCKING
|
#if DEBUG_PELOCKING
|
||||||
|
Reference in New Issue
Block a user