operator support.

This commit is contained in:
Vítor Santos Costa 2016-03-03 23:16:40 +00:00
parent 5c4cedd4fc
commit 0db27196aa

View File

@ -29,19 +29,19 @@ static ModEntry *LookupSystemModule(Term a);
static ModEntry *GetModuleEntry(Atom at USES_REGS); static ModEntry *GetModuleEntry(Atom at USES_REGS);
static ModEntry *FetchModuleEntry(Atom at); static ModEntry *FetchModuleEntry(Atom at);
/** /**
* initialize module data-structure * initialize module data-structure
* *
* @param to parent module (CurrentModule) * @param to parent module (CurrentModule)
* @param ae module name. * @param ae module name.
* *
* @return a new module structure * @return a new module structure
*//** */ *//** */
static ModEntry * static ModEntry *
initMod( AtomEntry *toname, AtomEntry *ae) { initMod( AtomEntry *toname, AtomEntry *ae) {
CACHE_REGS CACHE_REGS
ModEntry *n, *parent; ModEntry *n, *parent;
if (toname == NULL) if (toname == NULL)
parent = NULL; parent = NULL;
else { else {
@ -60,18 +60,18 @@ initMod( AtomEntry *toname, AtomEntry *ae) {
return n; return n;
} }
/** /**
* get predicate entry for ap/arity; create it if neccessary * get predicate entry for ap/arity; create it if neccessary
* *
* @param[in] at * @param[in] at
* *
* @return module descriptorxs * @return module descriptorxs
*/ */
static ModEntry *GetModuleEntry(Atom at USES_REGS) static ModEntry *GetModuleEntry(Atom at USES_REGS)
{ {
Prop p0; Prop p0;
AtomEntry *ae = RepAtom(at); AtomEntry *ae = RepAtom(axclat);
READ_LOCK(ae->ARWLock); READ_LOCK(ae->ARWLock);
p0 = ae->PropsOfAE; p0 = ae->PropsOfAE;
while (p0) { while (p0) {
@ -83,7 +83,7 @@ initMod( AtomEntry *toname, AtomEntry *ae) {
p0 = me->NextOfPE; p0 = me->NextOfPE;
} }
READ_UNLOCK(ae->ARWLock); READ_UNLOCK(ae->ARWLock);
return initMod( ( CurrentModule == PROLOG_MODULE ? NULL : AtomOfTerm( CurrentModule ) ), at ); return initMod( ( CurrentModule == PROLOG_MODULE ? NULL : AtomOfTerm( CurrentModule ) ), at );
} }
@ -131,7 +131,7 @@ bool Yap_getUnknown ( Term mod) {
return GetModuleEntry(AtomOfTerm(mt) PASS_REGS)->flags & M_CHARESCAPE; return GetModuleEntry(AtomOfTerm(mt) PASS_REGS)->flags & M_CHARESCAPE;
} }
#define ByteAdr(X) ((char *)&(X)) #define ByteAdr(X) ((char *)&(X))
Term Yap_Module_Name(PredEntry *ap) { Term Yap_Module_Name(PredEntry *ap) {
CACHE_REGS CACHE_REGS
@ -157,7 +157,7 @@ static ModEntry *LookupSystemModule(Term a) {
CACHE_REGS CACHE_REGS
Atom at; Atom at;
ModEntry *me; ModEntry *me;
/* prolog module */ /* prolog module */
if (a == 0) { if (a == 0) {
@ -345,12 +345,12 @@ static Int init_ground_module(USES_REGS1) {
return cont_ground_module(PASS_REGS1); return cont_ground_module(PASS_REGS1);
} }
/** /**
* @pred system_module( + _Mod_) * @pred system_module( + _Mod_)
* *
* @param module * @param module
* *
* @return * @return
*/ */
static Int is_system_module( USES_REGS1 ) static Int is_system_module( USES_REGS1 )
{ {
@ -461,11 +461,11 @@ static Int context_module(USES_REGS1) {
return Yap_unify(ARG1, CurrentModule); return Yap_unify(ARG1, CurrentModule);
} }
/** /**
* @pred source_module(-Mod) * @pred source_module(-Mod)
* *
* @param Mod is the current text source module. * @param Mod is the current text source module.
* *
* : _Mod_ is the current read-in or source module. * : _Mod_ is the current read-in or source module.
*/ */
static Int source_module(USES_REGS1) { static Int source_module(USES_REGS1) {