some fixes in info

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@507 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-06-01 04:29:01 +00:00
parent c80ac669de
commit c5e66af5d1
12 changed files with 2287 additions and 2452 deletions

View File

@ -46,8 +46,7 @@ typedef struct PropEntryStruct *Prop;
/* I can only define the structure after I define the actual atoms */
/* atom structure */
typedef struct AtomEntryStruct
{
typedef struct AtomEntryStruct {
Atom NextOfAE; /* used to build hash chains */
Prop PropsOfAE; /* property list for this atom */
#if defined(YAPOR) || defined(THREADS)
@ -79,12 +78,10 @@ AtomEntry;
typedef SFLAGS PropFlags;
/* basic property entry structure */
typedef struct PropEntryStruct
{
typedef struct PropEntryStruct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
}
PropEntry;
} PropEntry;
/* ************************* Functors **********************************/
@ -100,8 +97,7 @@ PropEntry;
#define FunctorProperty ((PropFlags)(0xbb00))
/* functor property */
typedef struct FunctorEntryStruct
{
typedef struct FunctorEntryStruct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
unsigned int ArityOfFE; /* arity of functor */
@ -110,7 +106,7 @@ typedef struct FunctorEntryStruct
#if defined(YAPOR) || defined(THREADS)
rwlock_t FRWLock;
#endif
}
FunctorEntry;
} FunctorEntry;
typedef FunctorEntry *Functor;

View File

@ -18,7 +18,7 @@
* Last rev: December 90 *
* mods: *
* comments: Tag Scheme for machines with 24 bits adresses (m68000) *
* version: $Id: Tags_24bits.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ *
* version: $Id: Tags_24bits.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/
/* Version for 24 bit addresses (68000)

View File

@ -18,7 +18,7 @@
* Last rev: December 90 *
* mods: *
* comments: Original Tag Scheme for machines with 32 bits adresses *
* version: $Id: Tags_32LowTag.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ *
* version: $Id: Tags_32LowTag.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/
#define TAG_LOW_BITS_32 1
@ -72,10 +72,10 @@ property list
#define NumberBits /* 0x0000000aL */ MKTAG(0x2,2)
#define NumberMask /* 0x0000000bL */ MKTAG(0x2,3)
#define NonTagPart(V) (Unsigned(V)>>(SHIFT_LOW_TAG+SHIFT_HIGH_TAG))
#define NonTagPart(V) ((Unsigned(V)>>1) & ~LowTagBits)
#define TAGGED(TAG,V) (((Unsigned(V)<<(SHIFT_HIGH_TAG+SHIFT_LOW_TAG+1))>>1)|(TAG))
#define NONTAGGED(TAG,V) ((Unsigned(V)<<(SHIFT_HIGH_TAG+SHIFT_LOW_TAG+1))>>1)
#define TAGGEDA(TAG,V) ((Unsigned(V) << (SHIFT_HIGH_TAG+SHIFT_LOW_TAG))|(TAG))
#define TAGGEDA(TAG,V) ((Unsigned(V) << 1)|(TAG))
#define CHKTAG(t,Tag) ((Unsigned(t)&TagBits)==Tag)
/* bits that should not be used by anyone but us */

View File

@ -18,7 +18,7 @@
* Last rev: December 90 *
* mods: *
* comments: Original Tag Scheme for machines with 32 bits adresses *
* version: $Id: Tags_32Ops.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ *
* version: $Id: Tags_32Ops.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/
/*

View File

@ -18,7 +18,7 @@
* Last rev: December 90 *
* mods: *
* comments: Original Tag Scheme for machines with 32 bits adresses *
* version: $Id: Tags_32bits.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ *
* version: $Id: Tags_32bits.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/
/* Original version for 32 bit addresses machines,

View File

@ -18,7 +18,7 @@
* Last rev: December 90 *
* mods: *
* comments: Original Tag Scheme for machines with 32 bits adresses *
* version: $Id: Tags_64bits.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ *
* version: $Id: Tags_64bits.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/
#define TAG_64BITS 1

View File

@ -17,7 +17,7 @@
* File: TermExt.h *
* mods: *
* comments: Extensions to standard terms for YAP *
* version: $Id: TermExt.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ *
* version: $Id: TermExt.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/
#if USE_OFFSETS

View File

@ -17,7 +17,7 @@
* File: Yap.h.m4 *
* mods: *
* comments: main header file for YAP *
* version: $Id: Yap.h,v 1.8 2002-02-04 16:12:54 vsc Exp $ *
* version: $Id: Yap.h,v 1.9 2002-06-01 04:29:01 vsc Exp $ *
*************************************************************************/
#include "config.h"
@ -239,7 +239,6 @@ extern char Option[20];
#endif
#if !IN_SECOND_QUADRANT
#define USE_OFFSETS 1
#if __linux__ || __FreeBSD__ || __NetBSD__ || mips || __APPLE__
#if defined(YAPOR) && defined(__alpha)
#define MMAP_ADDR 0x40000000
@ -250,18 +249,18 @@ extern char Option[20];
#else
#define MMAP_ADDR 0x09000000
#endif
#elif __svr4__
#elif __svr4__ || defined(__SVR4)
#define MMAP_ADDR 0x02000000
#elif _WIN32
#elif defined(_WIN32) || defined(__CYGWIN__)
#define MMAP_ADDR 0x30000000L
#endif
#endif /* !IN_SECOND_QUADRANT */
#if defined(MMAP_ADDR) && (HAVE_MMAP || HAVE_SHMAT || _WIN32) && !__simplescalar__
#if defined(MMAP_ADDR) && (USE_MMAP || USE_SHMAT || _WIN32) && !__simplescalar__
#define HEAP_INIT_BASE (MMAP_ADDR)
#define AtomBase ((char *)MMAP_ADDR)
#else
#define HEAP_INIT_BASE (HeapBase)
#define HEAP_INIT_BASE ((CELL)HeapBase)
#define AtomBase (HeapBase)
#endif
@ -393,9 +392,8 @@ extern sigjmp_buf RestartEnv; /* used to restart after an abort */
/************ variables concerned with Error Handling *************/
/* Types of Errors */
typedef enum
{
NO_ERROR,
typedef enum {
YAP_NO_ERROR,
FATAL_ERROR,
INTERNAL_ERROR,
PURE_ABORT,
@ -469,15 +467,13 @@ typedef enum
TYPE_ERROR_UBYTE,
TYPE_ERROR_VARIABLE,
UNKNOWN_ERROR
}
yap_error_number;
} yap_error_number;
extern char *ErrorMessage; /* used to pass error messages */
extern Term Error_Term; /* used to pass error terms */
extern yap_error_number Error_TYPE; /* used to pass the error */
typedef enum
{
typedef enum {
YAP_INT_BOUNDED_FLAG = 0,
MAX_ARITY_FLAG = 1,
INTEGER_ROUNDING_FLAG = 2,
@ -495,8 +491,7 @@ typedef enum
ALLOW_ASSERTING_STATIC_FLAG = 14,
HALT_AFTER_CONSULT_FLAG = 15,
FAST_BOOT_FLAG = 16
}
yap_flags;
} yap_flags;
#define STRING_AS_CHARS 0
#define STRING_AS_ATOM 2
@ -628,12 +623,20 @@ yap_flags;
#define TermSize sizeof(Term)
/************* variables related to memory allocation *******************/
/* must be before TermExt.h */
extern ADDR HeapBase,
LocalBase,
GlobalBase,
TrailBase, TrailTop,
ForeignCodeBase, ForeignCodeTop, ForeignCodeMax;
/* applies to unbound variables */
inline EXTERN Term * VarOfTerm(Term t);
inline EXTERN Term *
VarOfTerm (Term t)
inline EXTERN Term * VarOfTerm(Term t)
{
return (Term *) (t);
}
@ -643,8 +646,7 @@ VarOfTerm (Term t)
inline EXTERN Term MkVarTerm(void);
inline EXTERN Term
MkVarTerm ()
inline EXTERN Term MkVarTerm()
{
return (Term) ((*H = 0, H++));
}
@ -653,8 +655,7 @@ MkVarTerm ()
inline EXTERN int IsUnboundVar(Term);
inline EXTERN int
IsUnboundVar (Term t)
inline EXTERN int IsUnboundVar(Term t)
{
return (int) (t == 0);
}
@ -664,8 +665,7 @@ IsUnboundVar (Term t)
inline EXTERN Term MkVarTerm(void);
inline EXTERN Term
MkVarTerm ()
inline EXTERN Term MkVarTerm()
{
return (Term) ((*H = (CELL) H, H++));
}
@ -674,8 +674,7 @@ MkVarTerm ()
inline EXTERN int IsUnboundVar(Term);
inline EXTERN int
IsUnboundVar (Term t)
inline EXTERN int IsUnboundVar(Term t)
{
return (int) (*VarOfTerm(t) == (t));
}
@ -685,8 +684,7 @@ IsUnboundVar (Term t)
inline EXTERN CELL * PtrOfTerm(Term);
inline EXTERN CELL *
PtrOfTerm (Term t)
inline EXTERN CELL * PtrOfTerm(Term t)
{
return (CELL *) (*(CELL *)(t));
}
@ -696,61 +694,34 @@ PtrOfTerm (Term t)
inline EXTERN Functor FunctorOfTerm(Term);
inline EXTERN Functor
FunctorOfTerm (Term t)
inline EXTERN Functor FunctorOfTerm(Term t)
{
return (Functor) (*RepAppl(t));
}
#if IN_SECOND_QUADRANT
inline EXTERN Term MkAtomTerm(Atom);
inline EXTERN Term
MkAtomTerm (Atom a)
inline EXTERN Term MkAtomTerm(Atom a)
{
return (Term) (TAGGEDA (AtomTag, (CELL *) (a) - (CELL *) HEAP_INIT_BASE));
return (Term) (TAGGEDA(AtomTag, (CELL)(a)-HEAP_INIT_BASE));
}
inline EXTERN Atom AtomOfTerm(Term t);
inline EXTERN Atom
AtomOfTerm (Term t)
inline EXTERN Atom AtomOfTerm(Term t)
{
return (Atom) ((CELL *) HEAP_INIT_BASE + NonTagPart (t));
return (Atom) (HEAP_INIT_BASE+NonTagPart(t));
}
#else
inline EXTERN Term MkAtomTerm (Atom);
inline EXTERN Term
MkAtomTerm (Atom a)
{
return (Term) (TAGGEDA (AtomTag, (a)));
}
inline EXTERN Atom AtomOfTerm (Term t);
inline EXTERN Atom
AtomOfTerm (Term t)
{
return (Atom) (NonTagPart (t));
}
#endif
inline EXTERN int IsAtomTerm(Term);
inline EXTERN int
IsAtomTerm (Term t)
inline EXTERN int IsAtomTerm(Term t)
{
return (int) (CHKTAG((t), AtomTag));
}
@ -760,8 +731,7 @@ IsAtomTerm (Term t)
inline EXTERN Term MkIntTerm(Int);
inline EXTERN Term
MkIntTerm (Int n)
inline EXTERN Term MkIntTerm(Int n)
{
return (Term) (TAGGED(NumberTag, (n)));
}
@ -774,8 +744,7 @@ MkIntTerm (Int n)
inline EXTERN Term MkIntConstant(Int);
inline EXTERN Term
MkIntConstant (Int n)
inline EXTERN Term MkIntConstant(Int n)
{
return (Term) (NONTAGGED(NumberTag, (n)));
}
@ -784,8 +753,7 @@ MkIntConstant (Int n)
inline EXTERN int IsIntTerm(Term);
inline EXTERN int
IsIntTerm (Term t)
inline EXTERN int IsIntTerm(Term t)
{
return (int) (CHKTAG((t), NumberTag));
}
@ -812,14 +780,6 @@ IsIntTerm (Term t)
#endif
/************* variables related to memory allocation *******************/
/* must be before TermExt.h */
extern ADDR HeapBase,
LocalBase,
GlobalBase,
TrailBase, TrailTop, ForeignCodeBase, ForeignCodeTop, ForeignCodeMax;
/*
There are two types of functors:
@ -837,8 +797,7 @@ extern ADDR HeapBase,
inline EXTERN Term MkIntegerTerm(Int);
inline EXTERN Term
MkIntegerTerm (Int n)
inline EXTERN Term MkIntegerTerm(Int n)
{
return (Term) (IntInBnd(n) ? MkIntTerm(n) : MkLongIntTerm(n));
}
@ -847,8 +806,7 @@ MkIntegerTerm (Int n)
inline EXTERN int IsIntegerTerm(Term);
inline EXTERN int
IsIntegerTerm (Term t)
inline EXTERN int IsIntegerTerm(Term t)
{
return (int) (IsIntTerm(t) || IsLongIntTerm(t));
}
@ -857,8 +815,7 @@ IsIntegerTerm (Term t)
inline EXTERN Int IntegerOfTerm(Term);
inline EXTERN Int
IntegerOfTerm (Term t)
inline EXTERN Int IntegerOfTerm(Term t)
{
return (Int) (IsIntTerm(t) ? IntOfTerm(t) : LongIntOfTerm(t));
}
@ -879,8 +836,7 @@ IntegerOfTerm (Term t)
inline EXTERN Term ArgOfTerm(int i, Term t);
inline EXTERN Term
ArgOfTerm (int i, Term t)
inline EXTERN Term ArgOfTerm(int i, Term t)
{
return (Term) (Derefa(RepAppl(t) + (i)));
}
@ -889,8 +845,7 @@ ArgOfTerm (int i, Term t)
inline EXTERN Term HeadOfTerm(Term);
inline EXTERN Term
HeadOfTerm (Term t)
inline EXTERN Term HeadOfTerm(Term t)
{
return (Term) (Derefa(RepPair(t)));
}
@ -899,8 +854,7 @@ HeadOfTerm (Term t)
inline EXTERN Term TailOfTerm(Term);
inline EXTERN Term
TailOfTerm (Term t)
inline EXTERN Term TailOfTerm(Term t)
{
return (Term) (Derefa(RepPair(t) + 1));
}
@ -910,8 +864,7 @@ TailOfTerm (Term t)
inline EXTERN Term ArgOfTermCell(int i, Term t);
inline EXTERN Term
ArgOfTermCell (int i, Term t)
inline EXTERN Term ArgOfTermCell(int i, Term t)
{
return (Term) ((CELL)(RepAppl(t) + (i)));
}
@ -920,8 +873,7 @@ ArgOfTermCell (int i, Term t)
inline EXTERN Term HeadOfTermCell(Term);
inline EXTERN Term
HeadOfTermCell (Term t)
inline EXTERN Term HeadOfTermCell(Term t)
{
return (Term) ((CELL)(RepPair(t)));
}
@ -930,8 +882,7 @@ HeadOfTermCell (Term t)
inline EXTERN Term TailOfTermCell(Term);
inline EXTERN Term
TailOfTermCell (Term t)
inline EXTERN Term TailOfTermCell(Term t)
{
return (Term) ((CELL)(RepPair(t) + 1));
}
@ -968,12 +919,10 @@ extern char version_number[];
#if USE_THREADED_CODE
/************ reverse lookup of instructions *****************/
typedef struct opcode_tab_entry
{
typedef struct opcode_tab_entry {
OPCODE opc;
op_numbers opnum;
}
opentry;
} opentry;
#endif
@ -989,16 +938,15 @@ extern int CurFileNo;
/********* Prolog may be in several modes *******************************/
typedef enum
{
typedef enum {
BootMode = 1, /* if booting or restoring */
UserMode = 2, /* Normal mode */
CritMode = 4, /* If we are meddling with the heap */
AbortMode = 8, /* expecting to abort */
InterruptMode = 16, /* under an interrupt */
InErrorMode = 32 /* under an interrupt */
}
prolog_exec_mode;
InErrorMode = 32, /* under an interrupt */
ConsoleGetcMode = 64 /* blocked reading from console */
} prolog_exec_mode;
extern prolog_exec_mode PrologMode;
extern int CritLocks;
@ -1008,6 +956,9 @@ extern int CritLocks;
extern char **yap_args;
extern int yap_argc;
/******************* controlling debugging ****************************/
extern int creep_on;
#ifdef YAPOR
#define YAPEnterCriticalSection() \
{ \
@ -1070,12 +1021,10 @@ extern int compile_arrays;
/* I assume that the size of this structure is a multiple of the size
of CELL!!! */
typedef struct TIMED_MAVAR
{
typedef struct TIMED_MAVAR{
CELL value;
CELL clock;
}
timed_var;
} timed_var;
/********* while debugging you may need some info ***********************/
@ -1100,3 +1049,4 @@ extern int snoozing;
#if SBA
#include "sbaunify.h"
#endif

View File

@ -28,8 +28,7 @@
inline EXTERN Atom AbsAtom(AtomEntry * p);
inline EXTERN Atom
AbsAtom (AtomEntry * p)
inline EXTERN Atom AbsAtom(AtomEntry * p)
{
return (Atom) (Addr(p) - AtomBase);
}
@ -38,8 +37,7 @@ AbsAtom (AtomEntry * p)
inline EXTERN AtomEntry * RepAtom(Atom a);
inline EXTERN AtomEntry *
RepAtom (Atom a)
inline EXTERN AtomEntry * RepAtom(Atom a)
{
return (AtomEntry *) (AtomBase + Unsigned(a));
}
@ -49,8 +47,7 @@ RepAtom (Atom a)
inline EXTERN Atom AbsAtom(AtomEntry * p);
inline EXTERN Atom
AbsAtom (AtomEntry * p)
inline EXTERN Atom AbsAtom(AtomEntry * p)
{
return (Atom) (p);
}
@ -59,8 +56,7 @@ AbsAtom (AtomEntry * p)
inline EXTERN AtomEntry * RepAtom(Atom a);
inline EXTERN AtomEntry *
RepAtom (Atom a)
inline EXTERN AtomEntry * RepAtom(Atom a)
{
return (AtomEntry *) (a);
}
@ -72,8 +68,7 @@ RepAtom (Atom a)
inline EXTERN Prop AbsProp(PropEntry * p);
inline EXTERN Prop
AbsProp (PropEntry * p)
inline EXTERN Prop AbsProp(PropEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -82,8 +77,7 @@ AbsProp (PropEntry * p)
inline EXTERN PropEntry * RepProp(Prop p);
inline EXTERN PropEntry *
RepProp (Prop p)
inline EXTERN PropEntry * RepProp(Prop p)
{
return (PropEntry *) (AtomBase+Unsigned(p));
}
@ -93,8 +87,7 @@ RepProp (Prop p)
inline EXTERN Prop AbsProp(PropEntry * p);
inline EXTERN Prop
AbsProp (PropEntry * p)
inline EXTERN Prop AbsProp(PropEntry * p)
{
return (Prop) (p);
}
@ -103,8 +96,7 @@ AbsProp (PropEntry * p)
inline EXTERN PropEntry * RepProp(Prop p);
inline EXTERN PropEntry *
RepProp (Prop p)
inline EXTERN PropEntry * RepProp(Prop p)
{
return (PropEntry *) (p);
}
@ -116,8 +108,7 @@ RepProp (Prop p)
inline EXTERN FunctorEntry * RepFunctorProp(Prop p);
inline EXTERN FunctorEntry *
RepFunctorProp (Prop p)
inline EXTERN FunctorEntry * RepFunctorProp(Prop p)
{
return (FunctorEntry *) (AtomBase + Unsigned(p));
}
@ -126,8 +117,7 @@ RepFunctorProp (Prop p)
inline EXTERN Prop AbsFunctorProp(FunctorEntry * p);
inline EXTERN Prop
AbsFunctorProp (FunctorEntry * p)
inline EXTERN Prop AbsFunctorProp(FunctorEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -137,8 +127,7 @@ AbsFunctorProp (FunctorEntry * p)
inline EXTERN FunctorEntry * RepFunctorProp(Prop p);
inline EXTERN FunctorEntry *
RepFunctorProp (Prop p)
inline EXTERN FunctorEntry * RepFunctorProp(Prop p)
{
return (FunctorEntry *) (p);
}
@ -147,8 +136,7 @@ RepFunctorProp (Prop p)
inline EXTERN Prop AbsFunctorProp(FunctorEntry * p);
inline EXTERN Prop
AbsFunctorProp (FunctorEntry * p)
inline EXTERN Prop AbsFunctorProp(FunctorEntry * p)
{
return (Prop) (p);
}
@ -159,8 +147,7 @@ AbsFunctorProp (FunctorEntry * p)
inline EXTERN Int ArityOfFunctor(Functor);
inline EXTERN Int
ArityOfFunctor (Functor Fun)
inline EXTERN Int ArityOfFunctor(Functor Fun)
{
return (Int) (((FunctorEntry *)Fun)->ArityOfFE);
}
@ -169,8 +156,7 @@ ArityOfFunctor (Functor Fun)
inline EXTERN Atom NameOfFunctor(Functor);
inline EXTERN Atom
NameOfFunctor (Functor Fun)
inline EXTERN Atom NameOfFunctor(Functor Fun)
{
return (Atom) (((FunctorEntry *)Fun)->NameOfFE);
}
@ -180,8 +166,7 @@ NameOfFunctor (Functor Fun)
inline EXTERN PropFlags IsFunctorProperty(int);
inline EXTERN PropFlags
IsFunctorProperty (int flags)
inline EXTERN PropFlags IsFunctorProperty(int flags)
{
return (PropFlags) ((flags == FunctorProperty) );
}
@ -203,20 +188,17 @@ IsFunctorProperty (int flags)
*/
/* Module property */
typedef struct
{
typedef struct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
SMALLUNSGN IndexOfMod; /* indec in module table */
}
ModEntry;
} ModEntry;
#if USE_OFFSETS_IN_PROPS
inline EXTERN ModEntry * RepModProp(Prop p);
inline EXTERN ModEntry *
RepModProp (Prop p)
inline EXTERN ModEntry * RepModProp(Prop p)
{
return (ModEntry *) (AtomBase + Unsigned(p));
}
@ -225,8 +207,7 @@ RepModProp (Prop p)
inline EXTERN Prop AbsModProp(ModEntry * p);
inline EXTERN Prop
AbsModProp (ModEntry * p)
inline EXTERN Prop AbsModProp(ModEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -236,8 +217,7 @@ AbsModProp (ModEntry * p)
inline EXTERN ModEntry * RepModProp(Prop p);
inline EXTERN ModEntry *
RepModProp (Prop p)
inline EXTERN ModEntry * RepModProp(Prop p)
{
return (ModEntry *) (p);
}
@ -246,8 +226,7 @@ RepModProp (Prop p)
inline EXTERN Prop AbsModProp(ModEntry * p);
inline EXTERN Prop
AbsModProp (ModEntry * p)
inline EXTERN Prop AbsModProp(ModEntry * p)
{
return (Prop) (p);
}
@ -260,8 +239,7 @@ AbsModProp (ModEntry * p)
inline EXTERN PropFlags IsModProperty(int);
inline EXTERN PropFlags
IsModProperty (int flags)
inline EXTERN PropFlags IsModProperty(int flags)
{
return (PropFlags) ((flags == ModProperty));
}
@ -269,22 +247,19 @@ IsModProperty (int flags)
/* operator property entry structure */
typedef struct
{
typedef struct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
#if defined(YAPOR) || defined(THREADS)
rwlock_t OpRWLock; /* a read-write lock to protect the entry */
#endif
BITS16 Prefix, Infix, Posfix; /* precedences */
}
OpEntry;
} OpEntry;
#if USE_OFFSETS_IN_PROPS
inline EXTERN OpEntry * RepOpProp(Prop p);
inline EXTERN OpEntry *
RepOpProp (Prop p)
inline EXTERN OpEntry * RepOpProp(Prop p)
{
return (OpEntry *) (AtomBase + Unsigned(p));
}
@ -293,8 +268,7 @@ RepOpProp (Prop p)
inline EXTERN Prop AbsOpProp(OpEntry * p);
inline EXTERN Prop
AbsOpProp (OpEntry * p)
inline EXTERN Prop AbsOpProp(OpEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -304,8 +278,7 @@ AbsOpProp (OpEntry * p)
inline EXTERN OpEntry * RepOpProp(Prop p);
inline EXTERN OpEntry *
RepOpProp (Prop p)
inline EXTERN OpEntry * RepOpProp(Prop p)
{
return (OpEntry *) (p);
}
@ -314,8 +287,7 @@ RepOpProp (Prop p)
inline EXTERN Prop AbsOpProp(OpEntry * p);
inline EXTERN Prop
AbsOpProp (OpEntry * p)
inline EXTERN Prop AbsOpProp(OpEntry * p)
{
return (Prop) (p);
}
@ -327,8 +299,7 @@ AbsOpProp (OpEntry * p)
inline EXTERN PropFlags IsOpProperty(int);
inline EXTERN PropFlags
IsOpProperty (int flags)
inline EXTERN PropFlags IsOpProperty(int flags)
{
return (PropFlags) ((flags == OpProperty) );
}
@ -343,29 +314,24 @@ IsOpProperty (int flags)
typedef union arith_ret *eval_ret;
/* expression property entry structure */
typedef struct
{
typedef struct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
unsigned int ArityOfEE;
BITS16 ENoOfEE;
BITS16 FlagsOfEE;
/* operations that implement the expression */
union
{
union {
blob_type (*constant)(eval_ret);
blob_type (*unary)(Term, eval_ret);
blob_type (*binary)(Term, Term, eval_ret);
}
FOfEE;
}
ExpEntry;
} FOfEE;
} ExpEntry;
#if USE_OFFSETS_IN_PROPS
inline EXTERN ExpEntry * RepExpProp(Prop p);
inline EXTERN ExpEntry *
RepExpProp (Prop p)
inline EXTERN ExpEntry * RepExpProp(Prop p)
{
return (ExpEntry *) (AtomBase + Unsigned(p));
}
@ -374,8 +340,7 @@ RepExpProp (Prop p)
inline EXTERN Prop AbsExpProp(ExpEntry * p);
inline EXTERN Prop
AbsExpProp (ExpEntry * p)
inline EXTERN Prop AbsExpProp(ExpEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -385,8 +350,7 @@ AbsExpProp (ExpEntry * p)
inline EXTERN ExpEntry * RepExpProp(Prop p);
inline EXTERN ExpEntry *
RepExpProp (Prop p)
inline EXTERN ExpEntry * RepExpProp(Prop p)
{
return (ExpEntry *) (p);
}
@ -395,8 +359,7 @@ RepExpProp (Prop p)
inline EXTERN Prop AbsExpProp(ExpEntry * p);
inline EXTERN Prop
AbsExpProp (ExpEntry * p)
inline EXTERN Prop AbsExpProp(ExpEntry * p)
{
return (Prop) (p);
}
@ -409,8 +372,7 @@ AbsExpProp (ExpEntry * p)
inline EXTERN PropFlags IsExpProperty(int);
inline EXTERN PropFlags
IsExpProperty (int flags)
inline EXTERN PropFlags IsExpProperty(int flags)
{
return (PropFlags) ((flags == ExpProperty) );
}
@ -419,22 +381,19 @@ IsExpProperty (int flags)
/* value property entry structure */
typedef struct
{
typedef struct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
#if defined(YAPOR) || defined(THREADS)
rwlock_t VRWLock; /* a read-write lock to protect the entry */
#endif
Term ValueOfVE; /* (atomic) value associated with the atom */
}
ValEntry;
} ValEntry;
#if USE_OFFSETS_IN_PROPS
inline EXTERN ValEntry * RepValProp(Prop p);
inline EXTERN ValEntry *
RepValProp (Prop p)
inline EXTERN ValEntry * RepValProp(Prop p)
{
return (ValEntry *) (AtomBase + Unsigned(p));
}
@ -443,8 +402,7 @@ RepValProp (Prop p)
inline EXTERN Prop AbsValProp(ValEntry * p);
inline EXTERN Prop
AbsValProp (ValEntry * p)
inline EXTERN Prop AbsValProp(ValEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -454,8 +412,7 @@ AbsValProp (ValEntry * p)
inline EXTERN ValEntry * RepValProp(Prop p);
inline EXTERN ValEntry *
RepValProp (Prop p)
inline EXTERN ValEntry * RepValProp(Prop p)
{
return (ValEntry *) (p);
}
@ -464,8 +421,7 @@ RepValProp (Prop p)
inline EXTERN Prop AbsValProp(ValEntry * p);
inline EXTERN Prop
AbsValProp (ValEntry * p)
inline EXTERN Prop AbsValProp(ValEntry * p)
{
return (Prop) (p);
}
@ -477,8 +433,7 @@ AbsValProp (ValEntry * p)
inline EXTERN PropFlags IsValProperty(int);
inline EXTERN PropFlags
IsValProperty (int flags)
inline EXTERN PropFlags IsValProperty(int flags)
{
return (PropFlags) ((flags == ValProperty) );
}
@ -486,15 +441,15 @@ IsValProperty (int flags)
/* predicate property entry structure */
/* BasicPreds are things like var, nonvar, atom ...which are implemented
/* AsmPreds are things like var, nonvar, atom ...which are implemented
through dedicated machine instructions. In this case the 8 lower
bits of PredFlags are used to hold the machine instruction code
for the pred.
C_Preds are things write, read, ... implemented in C. In this case
CodeOfPred holds the address of the correspondent C-function.
*/
typedef enum
{
typedef enum {
CArgsPredFlag = 0x1000000L, /* ! should ! across */
CutTransparentPredFlag = 0x800000L, /* ! should ! across */
SourcePredFlag = 0x400000L, /* static predicate with source declaration */
MetaPredFlag = 0x200000L, /* predicate subject to a meta declaration */
@ -503,7 +458,7 @@ typedef enum
MultiFileFlag = 0x040000L, /* is multi-file */
FastPredFlag = 0x020000L, /* is "compiled" */
TestPredFlag = 0x010000L, /* is a test (optim. comit) */
BasicPredFlag = 0x008000L, /* inline */
AsmPredFlag = 0x008000L, /* inline */
StandardPredFlag= 0x004000L, /* system predicate */
DynamicPredFlag= 0x002000L, /* dynamic predicate */
CPredFlag = 0x001000L, /* written in C */
@ -520,12 +475,10 @@ typedef enum
#endif /* YAPOR */
ProfiledPredFlag = 0x000010L, /* pred is being profiled */
LogUpdatePredFlag= 0x000008L /* dynamic predicate with log. upd. sem.*/
}
pred_flag;
} pred_flag;
/* profile data */
typedef struct
{
typedef struct {
#if defined(YAPOR) || defined(THREADS)
lockvar lock; /* a simple lock to protect this entry */
#endif
@ -533,11 +486,9 @@ typedef struct
Int NOfHeadSuccesses; /* nbr of times head unification succeeded*/
Int NOfRetries; /* nbr of times a clause for the pred
was retried */
}
profile_data;
} profile_data;
typedef struct pred_entry
{
typedef struct pred_entry {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
unsigned int ArityOfPE; /* arity of property */
@ -558,16 +509,14 @@ typedef struct pred_entry
OPCODE OpcodeOfPred; /* undefcode, indexcode, spycode, .... */
profile_data StatisticsForPred; /* enable profiling for predicate */
SMALLUNSGN StateOfPred; /* actual state of predicate */
}
PredEntry;
} PredEntry;
#define PEProp ((PropFlags)(0x0000))
#if USE_OFFSETS_IN_PROPS
inline EXTERN PredEntry * RepPredProp(Prop p);
inline EXTERN PredEntry *
RepPredProp (Prop p)
inline EXTERN PredEntry * RepPredProp(Prop p)
{
return (PredEntry *) (AtomBase + Unsigned(p));
}
@ -576,8 +525,7 @@ RepPredProp (Prop p)
inline EXTERN Prop AbsPredProp(PredEntry * p);
inline EXTERN Prop
AbsPredProp (PredEntry * p)
inline EXTERN Prop AbsPredProp(PredEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -587,8 +535,7 @@ AbsPredProp (PredEntry * p)
inline EXTERN PredEntry * RepPredProp(Prop p);
inline EXTERN PredEntry *
RepPredProp (Prop p)
inline EXTERN PredEntry * RepPredProp(Prop p)
{
return (PredEntry *) (p);
}
@ -597,8 +544,7 @@ RepPredProp (Prop p)
inline EXTERN Prop AbsPredProp(PredEntry * p);
inline EXTERN Prop
AbsPredProp (PredEntry * p)
inline EXTERN Prop AbsPredProp(PredEntry * p)
{
return (Prop) (p);
}
@ -609,8 +555,7 @@ AbsPredProp (PredEntry * p)
inline EXTERN PropFlags IsPredProperty(int);
inline EXTERN PropFlags
IsPredProperty (int flags)
inline EXTERN PropFlags IsPredProperty(int flags)
{
return (PropFlags) ((flags == PEProp) );
}
@ -622,12 +567,10 @@ IsPredProperty (int flags)
#define MAX_C_PREDS 360
#define MAX_CMP_FUNCS 20
typedef struct
{
typedef struct {
PredEntry *p;
CmpPredicate f;
}
cmp_entry;
} cmp_entry;
extern CPredicate c_predicates[MAX_C_PREDS];
extern cmp_entry cmp_funcs[MAX_CMP_FUNCS];
@ -635,8 +578,7 @@ extern cmp_entry cmp_funcs[MAX_CMP_FUNCS];
/* Flags for code or dbase entry */
/* There are several flags for code and data base entries */
typedef enum
{
typedef enum {
GcFoundMask = 0x10000, /* informs this is a dynamic predicate */
DynamicMask = 0x8000, /* informs this is a dynamic predicate */
InUseMask = 0x4000, /* informs this block is being used */
@ -648,15 +590,13 @@ typedef enum
StaticMask = 0x0100, /* dealing with static predicates */
SpiedMask = 0x0080 /* this predicate is being spied */
/* other flags belong to DB */
}
dbentry_flags;
} dbentry_flags;
/* *********************** DBrefs **************************************/
#define KEEP_ENTRY_AGE 1
typedef struct DB_STRUCT
{
typedef struct DB_STRUCT {
Functor id; /* allow pointers to this struct to id */
/* as dbref */
Term EntryTerm; /* cell bound to itself */
@ -684,8 +624,7 @@ typedef struct DB_STRUCT
CELL NOfCells; /* Size of Term */
CELL Entry; /* entry point */
Term Contents[MIN_ARRAY]; /* stored term */
}
DBStruct;
} DBStruct;
#define DBStructFlagsToDBStruct(X) ((DBRef)((X) - (CELL) &(((DBRef) NIL)->Flags)))
@ -707,8 +646,7 @@ typedef DBStruct *DBRef;
inline EXTERN int IsDBRefTerm(Term);
inline EXTERN int
IsDBRefTerm (Term t)
inline EXTERN int IsDBRefTerm(Term t)
{
return (int) (IsApplTerm(t) && FunctorOfTerm(t) == FunctorDBRef);
}
@ -717,8 +655,7 @@ IsDBRefTerm (Term t)
inline EXTERN Term MkDBRefTerm(DBRef);
inline EXTERN Term
MkDBRefTerm (DBRef p)
inline EXTERN Term MkDBRefTerm(DBRef p)
{
return (Term) ((AbsAppl(((CELL *)(p)))));
}
@ -727,8 +664,7 @@ MkDBRefTerm (DBRef p)
inline EXTERN DBRef DBRefOfTerm(Term t);
inline EXTERN DBRef
DBRefOfTerm (Term t)
inline EXTERN DBRef DBRefOfTerm(Term t)
{
return (DBRef) (((DBRef)(RepAppl(t))));
}
@ -738,8 +674,7 @@ DBRefOfTerm (Term t)
inline EXTERN int IsRefTerm(Term);
inline EXTERN int
IsRefTerm (Term t)
inline EXTERN int IsRefTerm(Term t)
{
return (int) (IsApplTerm(t) && FunctorOfTerm(t) == FunctorDBRef);
}
@ -748,16 +683,14 @@ IsRefTerm (Term t)
inline EXTERN CODEADDR RefOfTerm(Term t);
inline EXTERN CODEADDR
RefOfTerm (Term t)
inline EXTERN CODEADDR RefOfTerm(Term t)
{
return (CODEADDR) (DBRefOfTerm(t));
}
typedef struct struct_dbentry
{
typedef struct struct_dbentry {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
unsigned int ArityOfDB; /* kind of property */
@ -773,13 +706,11 @@ typedef struct struct_dbentry
#else
DBRef FirstNEr; /* first non-erased DBase entry */
#endif /* KEEP_ENTRY_AGE */
}
DBEntry;
} DBEntry;
typedef DBEntry *DBProp;
#define DBProperty ((PropFlags)0x8000)
typedef struct
{
typedef struct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
unsigned int ArityOfDB; /* kind of property */
@ -792,8 +723,7 @@ typedef struct
SMALLUNSGN ModuleOfDB; /* module for this definition */
Int NOfEntries; /* age counter */
DBRef Index; /* age counter */
}
LogUpdDBEntry;
} LogUpdDBEntry;
typedef LogUpdDBEntry *LogUpdDBProp;
#define LogUpdDBBit 0x1
#define CodeDBBit 0x2
@ -805,8 +735,7 @@ typedef LogUpdDBEntry *LogUpdDBProp;
inline EXTERN PropFlags IsDBProperty(int);
inline EXTERN PropFlags
IsDBProperty (int flags)
inline EXTERN PropFlags IsDBProperty(int flags)
{
return (PropFlags) (((flags & ~(LogUpdDBBit|CodeDBBit)) == DBProperty) );
}
@ -817,8 +746,7 @@ IsDBProperty (int flags)
inline EXTERN DBProp RepDBProp(Prop p);
inline EXTERN DBProp
RepDBProp (Prop p)
inline EXTERN DBProp RepDBProp(Prop p)
{
return (DBProp) (AtomBase + Unsigned(p));
}
@ -827,8 +755,7 @@ RepDBProp (Prop p)
inline EXTERN Prop AbsDBProp(DBProp p);
inline EXTERN Prop
AbsDBProp (DBProp p)
inline EXTERN Prop AbsDBProp(DBProp p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -838,8 +765,7 @@ AbsDBProp (DBProp p)
inline EXTERN DBProp RepDBProp(Prop p);
inline EXTERN DBProp
RepDBProp (Prop p)
inline EXTERN DBProp RepDBProp(Prop p)
{
return (DBProp) (p);
}
@ -848,8 +774,7 @@ RepDBProp (Prop p)
inline EXTERN Prop AbsDBProp(DBProp p);
inline EXTERN Prop
AbsDBProp (DBProp p)
inline EXTERN Prop AbsDBProp(DBProp p)
{
return (Prop) (p);
}
@ -859,8 +784,7 @@ AbsDBProp (DBProp p)
/* These are the actual flags for DataBase terms */
typedef enum
{
typedef enum {
DBAtomic = 0x1,
DBVar = 0x2,
DBNoVars = 0x4,
@ -868,13 +792,11 @@ typedef enum
DBCode = 0x10,
DBNoCode = 0x20,
DBWithRefs = 0x40
}
db_term_flags;
} db_term_flags;
#define MaxModules 255
#define MaxModules 256
typedef struct
{
typedef struct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
Atom KeyOfBB; /* functor for this property */
@ -883,16 +805,14 @@ typedef struct
rwlock_t BBRWLock; /* a read-write lock to protect the entry */
#endif
SMALLUNSGN ModuleOfBB; /* module for this definition */
}
BlackBoardEntry;
} BlackBoardEntry;
typedef BlackBoardEntry *BBProp;
#if USE_OFFSETS_IN_PROPS
inline EXTERN BlackBoardEntry * RepBBProp(Prop p);
inline EXTERN BlackBoardEntry *
RepBBProp (Prop p)
inline EXTERN BlackBoardEntry * RepBBProp(Prop p)
{
return (BlackBoardEntry *) (AtomBase + Unsigned(p));
}
@ -901,8 +821,7 @@ RepBBProp (Prop p)
inline EXTERN Prop AbsBBProp(BlackBoardEntry * p);
inline EXTERN Prop
AbsBBProp (BlackBoardEntry * p)
inline EXTERN Prop AbsBBProp(BlackBoardEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -912,8 +831,7 @@ AbsBBProp (BlackBoardEntry * p)
inline EXTERN BlackBoardEntry * RepBBProp(Prop p);
inline EXTERN BlackBoardEntry *
RepBBProp (Prop p)
inline EXTERN BlackBoardEntry * RepBBProp(Prop p)
{
return (BlackBoardEntry *) (p);
}
@ -922,8 +840,7 @@ RepBBProp (Prop p)
inline EXTERN Prop AbsBBProp(BlackBoardEntry * p);
inline EXTERN Prop
AbsBBProp (BlackBoardEntry * p)
inline EXTERN Prop AbsBBProp(BlackBoardEntry * p)
{
return (Prop) (p);
}
@ -936,8 +853,7 @@ AbsBBProp (BlackBoardEntry * p)
inline EXTERN PropFlags IsBBProperty(int);
inline EXTERN PropFlags
IsBBProperty (int flags)
inline EXTERN PropFlags IsBBProperty(int flags)
{
return (PropFlags) ((flags == BBProperty));
}
@ -947,23 +863,21 @@ IsBBProperty (int flags)
/* array property entry structure */
/* first case is for dynamic arrays */
typedef struct
{
typedef struct array_entry {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
Int ArrayEArity; /* Arity of Array (positive) */
#if defined(YAPOR) || defined(THREADS)
rwlock_t ArRWLock; /* a read-write lock to protect the entry */
#endif
struct array_entry *NextArrayE; /* Pointer to the actual array */
Term ValueOfVE; /* Pointer to the actual array */
}
ArrayEntry;
} ArrayEntry;
/* second case is for static arrays */
/* first, the valid types */
typedef enum
{
typedef enum {
array_of_ints,
array_of_chars,
array_of_uchars,
@ -972,11 +886,9 @@ typedef enum
array_of_atoms,
array_of_dbrefs,
array_of_terms
}
static_array_types;
} static_array_types;
typedef union
{
typedef union {
Int *ints;
char *chars;
unsigned char *uchars;
@ -985,12 +897,10 @@ typedef union
Term *atoms;
Term *dbrefs;
DBRef *terms;
}
statarray_elements;
} statarray_elements;
/* next, the actual data structure */
typedef struct
{
typedef struct {
Prop NextOfPE; /* used to chain properties */
PropFlags KindOfPE; /* kind of property */
Int ArrayEArity; /* Arity of Array (negative) */
@ -999,16 +909,14 @@ typedef struct
#endif
static_array_types ArrayType; /* Type of Array Elements. */
statarray_elements ValueOfVE; /* Pointer to the Array itself */
}
StaticArrayEntry;
} StaticArrayEntry;
#if USE_OFFSETS_IN_PROPS
inline EXTERN ArrayEntry * RepArrayProp(Prop p);
inline EXTERN ArrayEntry *
RepArrayProp (Prop p)
inline EXTERN ArrayEntry * RepArrayProp(Prop p)
{
return (ArrayEntry *) (AtomBase + Unsigned(p));
}
@ -1017,8 +925,7 @@ RepArrayProp (Prop p)
inline EXTERN Prop AbsArrayProp(ArrayEntry * p);
inline EXTERN Prop
AbsArrayProp (ArrayEntry * p)
inline EXTERN Prop AbsArrayProp(ArrayEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -1027,8 +934,7 @@ AbsArrayProp (ArrayEntry * p)
inline EXTERN StaticArrayEntry * RepStaticArrayProp(Prop p);
inline EXTERN StaticArrayEntry *
RepStaticArrayProp (Prop p)
inline EXTERN StaticArrayEntry * RepStaticArrayProp(Prop p)
{
return (StaticArrayEntry *) (AtomBase + Unsigned(p));
}
@ -1037,8 +943,7 @@ RepStaticArrayProp (Prop p)
inline EXTERN Prop AbsStaticArrayProp(StaticArrayEntry * p);
inline EXTERN Prop
AbsStaticArrayProp (StaticArrayEntry * p)
inline EXTERN Prop AbsStaticArrayProp(StaticArrayEntry * p)
{
return (Prop) (Addr(p)-AtomBase);
}
@ -1048,8 +953,7 @@ AbsStaticArrayProp (StaticArrayEntry * p)
inline EXTERN ArrayEntry * RepArrayProp(Prop p);
inline EXTERN ArrayEntry *
RepArrayProp (Prop p)
inline EXTERN ArrayEntry * RepArrayProp(Prop p)
{
return (ArrayEntry *) (p);
}
@ -1058,8 +962,7 @@ RepArrayProp (Prop p)
inline EXTERN Prop AbsArrayProp(ArrayEntry * p);
inline EXTERN Prop
AbsArrayProp (ArrayEntry * p)
inline EXTERN Prop AbsArrayProp(ArrayEntry * p)
{
return (Prop) (p);
}
@ -1068,8 +971,7 @@ AbsArrayProp (ArrayEntry * p)
inline EXTERN StaticArrayEntry * RepStaticArrayProp(Prop p);
inline EXTERN StaticArrayEntry *
RepStaticArrayProp (Prop p)
inline EXTERN StaticArrayEntry * RepStaticArrayProp(Prop p)
{
return (StaticArrayEntry *) (p);
}
@ -1078,8 +980,7 @@ RepStaticArrayProp (Prop p)
inline EXTERN Prop AbsStaticArrayProp(StaticArrayEntry * p);
inline EXTERN Prop
AbsStaticArrayProp (StaticArrayEntry * p)
inline EXTERN Prop AbsStaticArrayProp(StaticArrayEntry * p)
{
return (Prop) (p);
}
@ -1091,8 +992,7 @@ AbsStaticArrayProp (StaticArrayEntry * p)
inline EXTERN int ArrayIsDynamic(ArrayEntry *);
inline EXTERN int
ArrayIsDynamic (ArrayEntry * are)
inline EXTERN int ArrayIsDynamic(ArrayEntry * are)
{
return (int) (((are)->ArrayEArity > 0 ));
}
@ -1102,8 +1002,7 @@ ArrayIsDynamic (ArrayEntry * are)
inline EXTERN PropFlags IsArrayProperty(int);
inline EXTERN PropFlags
IsArrayProperty (int flags)
inline EXTERN PropFlags IsArrayProperty(int flags)
{
return (PropFlags) ((flags == ArrayProperty) );
}
@ -1117,7 +1016,7 @@ int STD_PROTO (RemoveIndexation, (PredEntry *));
/* dbase.c */
void STD_PROTO(ErDBE,(DBRef));
DBRef STD_PROTO (StoreTermInDB, (Term, int));
DBRef STD_PROTO(StoreTermInDB,(int,int));
Term STD_PROTO(FetchTermFromDB,(DBRef,int));
void STD_PROTO(ReleaseTermFromDB,(DBRef));
@ -1140,12 +1039,10 @@ PredPropByFunc (Functor f, SMALLUNSGN cur_mod)
WRITE_LOCK(fe->FRWLock);
p0 = fe->PropsOfFE;
while (p0)
{
while (p0) {
PredEntry *p = RepPredProp(p0);
if (/* p->KindOfPE != 0 || only props */
(p->ModuleOfPred == cur_mod || !(p->ModuleOfPred)))
{
(p->ModuleOfPred == cur_mod || !(p->ModuleOfPred))) {
WRITE_UNLOCK(f->FRWLock);
return (p0);
}
@ -1163,12 +1060,10 @@ PredPropByAtom (Atom at, SMALLUNSGN cur_mod)
WRITE_LOCK(ae->ARWLock);
p0 = ae->PropsOfAE;
while (p0)
{
while (p0) {
PredEntry *pe = RepPredProp(p0);
if ( pe->KindOfPE == PEProp &&
(pe->ModuleOfPred == cur_mod || !pe->ModuleOfPred))
{
(pe->ModuleOfPred == cur_mod || !pe->ModuleOfPred)) {
WRITE_UNLOCK(ae->ARWLock);
return(p0);
}

View File

@ -228,15 +228,6 @@ inline EXTERN Atom AtomAdjust(Atom at)
inline EXTERN Term AtomTermAdjust(Term);
inline EXTERN Term AtomTermAdjust(Term at)
{
return (Term) ((at) );
}
inline EXTERN Prop PropAdjust(Prop);
inline EXTERN Prop PropAdjust(Prop p)
@ -251,11 +242,20 @@ inline EXTERN Atom AtomAdjust(Atom);
inline EXTERN Atom AtomAdjust(Atom at)
{
return (Atom) ((Atom)(CharP(at)+HDiff) );
return (Atom) ((at == NULL ? (at) : (Atom)(CharP(at)+HDiff) ));
}
#if MMAP_ADDR >= 0x40000000
inline EXTERN Prop PropAdjust(Prop);
inline EXTERN Prop PropAdjust(Prop p)
{
return (Prop) ((p == NULL ? (p) : (Prop)(CharP(p)+HDiff)) );
}
#endif
inline EXTERN Term AtomTermAdjust(Term);
@ -265,27 +265,6 @@ inline EXTERN Term AtomTermAdjust(Term at)
}
#else
inline EXTERN Term AtomTermAdjust(Term);
inline EXTERN Term AtomTermAdjust(Term at)
{
return (Term) (MkAtomTerm((Atom)(CharP(AtomOfTerm(at)+HDiff))) );
}
#endif
inline EXTERN Prop PropAdjust(Prop);
inline EXTERN Prop PropAdjust(Prop p)
{
return (Prop) ((Prop)(CharP(p)+HDiff) );
}
#endif
#if TAGS_FAST_OPS
inline EXTERN Term BlobTermAdjust(Term);
@ -393,7 +372,16 @@ inline EXTERN PredEntry * PtoPredAdjust(PredEntry *);
inline EXTERN PredEntry * PtoPredAdjust(PredEntry * ptr)
{
return (PredEntry *) (((CELL *)(CharP(ptr) + HDiff)) );
return (PredEntry *) (((PredEntry *)(CharP(ptr) + HDiff)) );
}
inline EXTERN ArrayEntry * PtoArrayEAdjust(ArrayEntry *);
inline EXTERN ArrayEntry * PtoArrayEAdjust(ArrayEntry * ptr)
{
return (ArrayEntry *) (((ArrayEntry *)(CharP(ptr) + HDiff)) );
}

View File

@ -12,7 +12,13 @@ cd ../OPTYap
splat
cd ../VC
splat
cd include
cd ../LGPL
splat
cd pillow
splat
cd examples
splat
cd ../../../include
splat
/bin/cp config.h config.h.mine
/bin/cp ../../../bins/cyg/*.h .

View File

@ -847,7 +847,7 @@ CC="cc -64" $YAP_SRC_PATH/configure --...
@cindex booting
We next describe how to invoke Yap in Unix systems.
@node Running Yap Interactively,Running Prolog Files, ,Run
@node Running Yap Interactively, ,Running Prolog Files,Run
@section Running Yap Interactively
Most often you will want to use Yap in interactive mode. Assuming that
@ -924,7 +924,7 @@ YAP will try to find library files from the YAPSHAREDIR/library
directory.
@end itemize
@node Running Prolog Files, ,Interactive Mode, Run
@node Running Prolog Files, Running Yap Interactively, , Run
@section Running Prolog Files
YAP can also be used to run Prolog files as scripts, at least in
@ -2473,9 +2473,9 @@ be @code{unknown}, and the second argument should be either
@code{error}, @code{warning}, @code{fail}, or a goal.
@item user:unknown_predicate_handler(+G,+M,?NG)
@findex user:unknown_predicate_handler/3
@syindex user:unknown_predicate_handler/3
@cnindex user:unknown_predicate_handler/3
@findex unknown_predicate_handler/3
@syindex unknown_predicate_handler/3
@cnindex unknown_predicate_handler/3
The user may also define clauses for
@code{user:unknown_predicate_handler/3} hook predicate. This
user-defined procedure is called before any system processing for the
@ -5312,9 +5312,9 @@ for DCG rules is applied, together with the arithmetic optimizer
whenever the compilation of arithmetic expressions is in progress.
@item user:goal_expansion(+@var{G},+@var{M},-@var{NG})
@findex user:goal_expansion/3
@snindex user:goal_expansion/3
@cnindex user:goal_expansion/3
@findex goal_expansion/3
@snindex goal_expansion/3
@cnindex goal_expansion/3
Yap now supports @code{goal_expansion/3}. This is an user-defined
procedure that is called after term expansion when compiling or
asserting goals for each sub-goal in a clause. The first argument is