config changes

This commit is contained in:
Vitor Santos Costa 2015-11-09 18:22:43 +00:00
parent 3aeebed2cf
commit cddb8191c8
8 changed files with 348 additions and 332 deletions

View File

@ -2652,7 +2652,7 @@ X_API Int YAP_Init(YAP_init_args *yap_init) {
Yap_init_yapor_global_local_memory(); Yap_init_yapor_global_local_memory();
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */ #endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
GLOBAL_PrologShouldHandleInterrupts = yap_init->PrologShouldHandleInterrupts; GLOBAL_PrologShouldHandleInterrupts = yap_init->PrologShouldHandleInterrupts;
Yap_InitSysbits(); /* init signal handling and time, required by later Yap_InitSysbits(0); /* init signal handling and time, required by later
functions */ functions */
GLOBAL_argv = yap_init->Argv; GLOBAL_argv = yap_init->Argv;
GLOBAL_argc = yap_init->Argc; GLOBAL_argc = yap_init->Argc;

View File

@ -64,6 +64,7 @@ include(CheckIncludeFiles)
include(CheckFunctionExists) include(CheckFunctionExists)
include(CheckPrototypeExists) include(CheckPrototypeExists)
include(CheckTypeSize) include(CheckTypeSize)
include(CheckVariableExists)
include(CheckCXXSourceCompiles) include(CheckCXXSourceCompiles)
include(TestBigEndian) include(TestBigEndian)
include (CMakeDependentOption) include (CMakeDependentOption)
@ -243,7 +244,7 @@ if (HAVE_GCC)
# replace instructions codes by the address of their code # replace instructions codes by the address of their code
option (WITH_THREADED_CODE "threaded code" ON) option (WITH_THREADED_CODE "threaded code" ON)
if (WITH_THREADED_CODE) if (WITH_THREADED_CODE)
set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS THREADED_CODE=1) set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS THREADED_CODE=1;USE_SYSTEM_MALLOC=1)
endif (WITH_THREADED_CODE) endif (WITH_THREADED_CODE)
endif (HAVE_GCC) endif (HAVE_GCC)

View File

@ -20,11 +20,12 @@ Int Yap_absmi(int);
int Yap_absmiEND(void); int Yap_absmiEND(void);
/* adtdefs.c */ /* adtdefs.c */
Term Yap_ArrayToList(Term *,size_t); Term Yap_ArrayToList(Term *, size_t);
int Yap_GetName(char *,UInt,Term); int Yap_GetName(char *, UInt, Term);
Term Yap_GetValue(Atom); Term Yap_GetValue(Atom);
int Yap_HasOp(Atom); int Yap_HasOp(Atom);
struct operator_entry *Yap_GetOpPropForAModuleHavingALock(struct AtomEntryStruct *, Term); struct operator_entry *
Yap_GetOpPropForAModuleHavingALock(struct AtomEntryStruct *, Term);
Atom Yap_LookupAtom(const char *); Atom Yap_LookupAtom(const char *);
Atom Yap_ULookupAtom(const unsigned char *); Atom Yap_ULookupAtom(const unsigned char *);
Atom Yap_LookupAtomWithLength(const char *, size_t); Atom Yap_LookupAtomWithLength(const char *, size_t);
@ -32,23 +33,22 @@ Atom Yap_LookupUTF8Atom(const unsigned char *);
Atom Yap_LookupMaybeWideAtom(const wchar_t *); Atom Yap_LookupMaybeWideAtom(const wchar_t *);
Atom Yap_LookupMaybeWideAtomWithLength(const wchar_t *, size_t); Atom Yap_LookupMaybeWideAtomWithLength(const wchar_t *, size_t);
Atom Yap_FullLookupAtom(const char *); Atom Yap_FullLookupAtom(const char *);
void Yap_LookupAtomWithAddress(const char *,struct AtomEntryStruct *); void Yap_LookupAtomWithAddress(const char *, struct AtomEntryStruct *);
Prop Yap_NewPredPropByFunctor(struct FunctorEntryStruct *, Term); Prop Yap_NewPredPropByFunctor(struct FunctorEntryStruct *, Term);
Prop Yap_NewPredPropByAtom(struct AtomEntryStruct *, Term); Prop Yap_NewPredPropByAtom(struct AtomEntryStruct *, Term);
Prop Yap_PredPropByFunctorNonThreadLocal(struct FunctorEntryStruct *, Term); Prop Yap_PredPropByFunctorNonThreadLocal(struct FunctorEntryStruct *, Term);
Prop Yap_PredPropByAtomNonThreadLocal(struct AtomEntryStruct *, Term); Prop Yap_PredPropByAtomNonThreadLocal(struct AtomEntryStruct *, Term);
Functor Yap_UnlockedMkFunctor(struct AtomEntryStruct *,unsigned int); Functor Yap_UnlockedMkFunctor(struct AtomEntryStruct *, unsigned int);
Functor Yap_MkFunctor(Atom,unsigned int); Functor Yap_MkFunctor(Atom, unsigned int);
void Yap_MkFunctorWithAddress(Atom,unsigned int,FunctorEntry *); void Yap_MkFunctorWithAddress(Atom, unsigned int, FunctorEntry *);
void Yap_PutValue(Atom,Term); void Yap_PutValue(Atom, Term);
void Yap_ReleaseAtom(Atom); void Yap_ReleaseAtom(Atom);
int Yap_AtomIncreaseHold(Atom); int Yap_AtomIncreaseHold(Atom);
int Yap_AtomDecreaseHold(Atom); int Yap_AtomDecreaseHold(Atom);
struct operator_entry *Yap_OpPropForModule(Atom, Term); struct operator_entry *Yap_OpPropForModule(Atom, Term);
#ifdef SFUNC #ifdef SFUNC
Term MkSFTerm(Functor,int,Term *,Term); Term MkSFTerm(Functor, int, Term *, Term);
CELL *ArgsOfSFTerm(Term); CELL *ArgsOfSFTerm(Term);
#endif #endif
@ -56,25 +56,25 @@ Prop Yap_GetPredPropByAtom(Atom, Term);
Prop Yap_GetPredPropByFunc(Functor, Term); Prop Yap_GetPredPropByFunc(Functor, Term);
Prop Yap_GetPredPropByAtomInThisModule(Atom, Term); Prop Yap_GetPredPropByAtomInThisModule(Atom, Term);
Prop Yap_GetPredPropByFuncInThisModule(Functor, Term); Prop Yap_GetPredPropByFuncInThisModule(Functor, Term);
Prop Yap_GetPredPropHavingLock(Atom,unsigned int, Term); Prop Yap_GetPredPropHavingLock(Atom, unsigned int, Term);
Prop Yap_GetExpProp(Atom,unsigned int); Prop Yap_GetExpProp(Atom, unsigned int);
Prop Yap_GetExpPropHavingLock(struct AtomEntryStruct *,unsigned int); Prop Yap_GetExpPropHavingLock(struct AtomEntryStruct *, unsigned int);
/* agc.c */ /* agc.c */
void Yap_atom_gc( CACHE_TYPE1 ); void Yap_atom_gc(CACHE_TYPE1);
void Yap_init_agc( void ); void Yap_init_agc(void);
/* alloc.c */ /* alloc.c */
void Yap_FreeCodeSpace(void *); void Yap_FreeCodeSpace(void *);
void *Yap_AllocAtomSpace(size_t); void *Yap_AllocAtomSpace(size_t);
void *Yap_AllocCodeSpace(size_t); void *Yap_AllocCodeSpace(size_t);
void *Yap_ReallocCodeSpace(void *,size_t); void *Yap_ReallocCodeSpace(void *, size_t);
ADDR Yap_AllocFromForeignArea(Int); ADDR Yap_AllocFromForeignArea(Int);
int Yap_ExtendWorkSpace(Int); int Yap_ExtendWorkSpace(Int);
void Yap_FreeAtomSpace(void *); void Yap_FreeAtomSpace(void *);
int Yap_FreeWorkSpace(void); int Yap_FreeWorkSpace(void);
void Yap_InitMemory(UInt,UInt,UInt); void Yap_InitMemory(UInt, UInt, UInt);
void Yap_InitExStacks(int,int,int); void Yap_InitExStacks(int, int, int);
/* amasm.c */ /* amasm.c */
OPCODE Yap_opcode(op_numbers); OPCODE Yap_opcode(op_numbers);
@ -91,7 +91,6 @@ void Yap_InitArrayPreds(void);
void Yap_InitBackAtoms(void); void Yap_InitBackAtoms(void);
void Yap_InitAtomPreds(void); void Yap_InitAtomPreds(void);
/* attvar.c */ /* attvar.c */
void Yap_InitAttVarPreds(void); void Yap_InitAttVarPreds(void);
void Yap_MkEmptyWakeUp(Atom mod); void Yap_MkEmptyWakeUp(Atom mod);
@ -121,24 +120,24 @@ Int YAP_RunGoalOnce(Term);
/* cdmgr.c */ /* cdmgr.c */
Term Yap_all_calls(void); Term Yap_all_calls(void);
Atom Yap_ConsultingFile( USES_REGS1 ); Atom Yap_ConsultingFile(USES_REGS1);
struct pred_entry *Yap_PredForChoicePt(choiceptr bptr, op_numbers *op); struct pred_entry *Yap_PredForChoicePt(choiceptr bptr, op_numbers *op);
void Yap_InitCdMgr(void); void Yap_InitCdMgr(void);
struct pred_entry * Yap_PredFromClause( Term t USES_REGS ); struct pred_entry *Yap_PredFromClause(Term t USES_REGS);
bool Yap_discontiguous(struct pred_entry *ap USES_REGS ); bool Yap_discontiguous(struct pred_entry *ap USES_REGS);
bool Yap_multiple(struct pred_entry *ap, int mode USES_REGS ); bool Yap_multiple(struct pred_entry *ap, int mode USES_REGS);
void Yap_init_consult(int, const char *); void Yap_init_consult(int, const char *);
void Yap_end_consult(void); void Yap_end_consult(void);
void Yap_Abolish(struct pred_entry *); void Yap_Abolish(struct pred_entry *);
void Yap_BuildMegaClause(struct pred_entry *); void Yap_BuildMegaClause(struct pred_entry *);
void Yap_EraseMegaClause(yamop *,struct pred_entry *); void Yap_EraseMegaClause(yamop *, struct pred_entry *);
void Yap_ResetConsultStack(void); void Yap_ResetConsultStack(void);
void Yap_AssertzClause(struct pred_entry *, yamop *); void Yap_AssertzClause(struct pred_entry *, yamop *);
void Yap_HidePred(struct pred_entry *pe); void Yap_HidePred(struct pred_entry *pe);
int Yap_SetNoTrace(char *name, UInt arity, Term tmod); int Yap_SetNoTrace(char *name, UInt arity, Term tmod);
/* cmppreds.c */ /* cmppreds.c */
Int Yap_compare_terms(Term,Term); Int Yap_compare_terms(Term, Term);
Int Yap_acmp(Term, Term USES_REGS); Int Yap_acmp(Term, Term USES_REGS);
void Yap_InitCmpPreds(void); void Yap_InitCmpPreds(void);
@ -146,14 +145,13 @@ void Yap_InitCmpPreds(void);
yamop *Yap_cclause(Term, Int, Term, Term); yamop *Yap_cclause(Term, Int, Term, Term);
/* computils.c */ /* computils.c */
int Yap_DebugPutc(FILE *,wchar_t); int Yap_DebugPutc(FILE *, wchar_t);
int Yap_DebugPuts(FILE *,const char *); int Yap_DebugPuts(FILE *, const char *);
void Yap_DebugSetIFile(char *); void Yap_DebugSetIFile(char *);
void Yap_DebugEndline(void); void Yap_DebugEndline(void);
void Yap_DebugPlWrite(Term t); void Yap_DebugPlWrite(Term t);
void Yap_DebugPlWriteln(Term t); void Yap_DebugPlWriteln(Term t);
/* corout.c */ /* corout.c */
void Yap_InitCoroutPreds(void); void Yap_InitCoroutPreds(void);
#ifdef COROUTINING #ifdef COROUTINING
@ -164,46 +162,46 @@ void Yap_WakeUp(CELL *);
/* dbase.c */ /* dbase.c */
struct pred_entry *Yap_FindLUIntKey(Int); struct pred_entry *Yap_FindLUIntKey(Int);
int Yap_DBTrailOverflow(void); int Yap_DBTrailOverflow(void);
CELL Yap_EvalMasks(Term,CELL *); CELL Yap_EvalMasks(Term, CELL *);
void Yap_InitBackDB(void); void Yap_InitBackDB(void);
void Yap_InitDBPreds(void); void Yap_InitDBPreds(void);
/* errors.c */ /* errors.c */
#if DEBUG #if DEBUG
void void Yap_PrintPredName(struct pred_entry *ap);
Yap_PrintPredName( struct pred_entry *ap );
#endif #endif
void Yap_RestartYap(int); void Yap_RestartYap(int);
void Yap_exit(int); void Yap_exit(int);
bool Yap_Warning( const char *s, ... ); bool Yap_Warning(const char *s, ...);
bool Yap_PrintWarning( Term t ); bool Yap_PrintWarning(Term t);
int Yap_HandleError( const char *msg, ... ); int Yap_HandleError(const char *msg, ...);
int Yap_SWIHandleError( const char *, ... ); int Yap_SWIHandleError(const char *, ...);
/* eval.c */ /* eval.c */
void Yap_InitEval(void); void Yap_InitEval(void);
/* exec.c */ /* exec.c */
void Yap_fail_all( choiceptr bb USES_REGS); void Yap_fail_all(choiceptr bb USES_REGS);
Term Yap_ExecuteCallMetaCall(Term); Term Yap_ExecuteCallMetaCall(Term);
void Yap_InitExecFs(void); void Yap_InitExecFs(void);
Int Yap_JumpToEnv(Term); Int Yap_JumpToEnv(Term);
Term Yap_RunTopGoal(Term); Term Yap_RunTopGoal(Term);
void Yap_ResetExceptionTerm(int); void Yap_ResetExceptionTerm(int);
Int Yap_execute_goal(Term, int, Term, bool); Int Yap_execute_goal(Term, int, Term, bool);
Int Yap_exec_absmi( bool, yap_reset_t ); Int Yap_exec_absmi(bool, yap_reset_t);
void Yap_trust_last(void); void Yap_trust_last(void);
Term Yap_GetException(void); Term Yap_GetException(void);
void Yap_PrepGoal(UInt, CELL *, choiceptr USES_REGS); void Yap_PrepGoal(UInt, CELL *, choiceptr USES_REGS);
int Yap_execute_pred(struct pred_entry *ppe, CELL *pt, bool pass_exception USES_REGS); int Yap_execute_pred(struct pred_entry *ppe, CELL *pt,
int Yap_dogc( int extra_args, Term *tp USES_REGS ); bool pass_exception USES_REGS);
int Yap_dogc(int extra_args, Term *tp USES_REGS);
Term Yap_PredicateIndicator(Term t, Term mod); Term Yap_PredicateIndicator(Term t, Term mod);
bool Yap_Execute(Term t USES_REGS); bool Yap_Execute(Term t USES_REGS);
/* exo.c */ /* exo.c */
void Yap_InitExoPreds(void); void Yap_InitExoPreds(void);
void Yap_udi_Interval_init(void); void Yap_udi_Interval_init(void);
bool Yap_Reset( yap_reset_t mode ); bool Yap_Reset(yap_reset_t mode);
/* foreign.c */ /* foreign.c */
char *Yap_FindExecutable(void); char *Yap_FindExecutable(void);
@ -211,16 +209,21 @@ char *Yap_FindExecutable(void);
/* gprof.c */ /* gprof.c */
void Yap_InitLowProf(void); void Yap_InitLowProf(void);
#if LOW_PROF #if LOW_PROF
void Yap_inform_profiler_of_clause__(void *,void *,struct pred_entry *, gprof_info); void Yap_inform_profiler_of_clause__(void *, void *, struct pred_entry *,
#define Yap_inform_profiler_of_clause(CODE0,CODEF,AP,MODE) {if (GLOBAL_FPreds) Yap_inform_profiler_of_clause__(CODE0,CODEF,AP,MODE);} gprof_info);
#define Yap_inform_profiler_of_clause(CODE0, CODEF, AP, MODE) \
{ \
if (GLOBAL_FPreds) \
Yap_inform_profiler_of_clause__(CODE0, CODEF, AP, MODE); \
}
#else #else
#define Yap_inform_profiler_of_clause(CODE0,CODEF,AP,MODE) #define Yap_inform_profiler_of_clause(CODE0, CODEF, AP, MODE)
#endif #endif
void Yap_tell_gprof(yamop *); void Yap_tell_gprof(yamop *);
/* globals.c */ /* globals.c */
Term Yap_NewArena(UInt,CELL *); Term Yap_NewArena(UInt, CELL *);
CELL *Yap_GetFromArena(Term *,UInt,UInt); CELL *Yap_GetFromArena(Term *, UInt, UInt);
void Yap_InitGlobals(void); void Yap_InitGlobals(void);
Term Yap_SaveTerm(Term); Term Yap_SaveTerm(Term);
Term Yap_SetGlobalVal(Atom, Term); Term Yap_SetGlobalVal(Atom, Term);
@ -233,11 +236,11 @@ Int Yap_total_stack_shift_time(void);
void Yap_InitGrowPreds(void); void Yap_InitGrowPreds(void);
UInt Yap_InsertInGlobal(CELL *, UInt); UInt Yap_InsertInGlobal(CELL *, UInt);
int Yap_growheap(bool, size_t, void *); int Yap_growheap(bool, size_t, void *);
int Yap_growstack( size_t ); int Yap_growstack(size_t);
int Yap_growtrail(size_t, bool); int Yap_growtrail(size_t, bool);
int Yap_growglobal(CELL **); int Yap_growglobal(CELL **);
int Yap_locked_growheap(bool, size_t, void *); int Yap_locked_growheap(bool, size_t, void *);
int Yap_locked_growstack( size_t ); int Yap_locked_growstack(size_t);
int Yap_locked_growtrail(size_t, bool); int Yap_locked_growtrail(size_t, bool);
int Yap_locked_growglobal(CELL **); int Yap_locked_growglobal(CELL **);
CELL **Yap_shift_visit(CELL **, CELL ***, CELL ***); CELL **Yap_shift_visit(CELL **, CELL ***, CELL ***);
@ -256,10 +259,10 @@ int Yap_locked_gcl(UInt, Int, CELL *, yamop *);
/* init.c */ /* init.c */
int Yap_IsOpType(char *); int Yap_IsOpType(char *);
void Yap_InitWorkspace(UInt,UInt,UInt,UInt,UInt,int,int,int); void Yap_InitWorkspace(UInt, UInt, UInt, UInt, UInt, int, int, int);
bool Yap_AddCallToFli( struct pred_entry *pe, CPredicate call ); bool Yap_AddCallToFli(struct pred_entry *pe, CPredicate call);
bool Yap_AddRetryToFli( struct pred_entry *pe, CPredicate re ); bool Yap_AddRetryToFli(struct pred_entry *pe, CPredicate re);
bool Yap_AddCutToFli( struct pred_entry *pe, CPredicate cut ); bool Yap_AddCutToFli(struct pred_entry *pe, CPredicate cut);
#ifdef YAPOR #ifdef YAPOR
void Yap_init_yapor_workers(void); void Yap_init_yapor_workers(void);
@ -271,7 +274,7 @@ void Yap_KillStacks(int);
#endif #endif
void Yap_InitYaamRegs(int); void Yap_InitYaamRegs(int);
void Yap_ReInitWTime(void); void Yap_ReInitWTime(void);
int Yap_OpDec(int,char *,Atom,Term); int Yap_OpDec(int, char *, Atom, Term);
void Yap_CloseScratchPad(void); void Yap_CloseScratchPad(void);
/* inlines.c */ /* inlines.c */
@ -279,18 +282,18 @@ void Yap_InitInlines(void);
int Yap_eq(Term, Term); int Yap_eq(Term, Term);
/* iopreds.c */ /* iopreds.c */
void Yap_InitPlIO (void); void Yap_InitPlIO(void);
void Yap_InitBackIO(void); void Yap_InitBackIO(void);
void Yap_InitIOPreds(void); void Yap_InitIOPreds(void);
extern void Yap_DebugPlWrite (Term t); extern void Yap_DebugPlWrite(Term t);
extern void Yap_DebugPlWriteln (Term t); extern void Yap_DebugPlWriteln(Term t);
extern void Yap_DebugErrorPutc (int n); extern void Yap_DebugErrorPutc(int n);
extern void Yap_DebugErrorPuts (const char *s); extern void Yap_DebugErrorPuts(const char *s);
extern void Yap_DebugWriteIndicator( struct pred_entry *ap ); extern void Yap_DebugWriteIndicator(struct pred_entry *ap);
void Yap_PlWriteToStream(Term, int, int); void Yap_PlWriteToStream(Term, int, int);
/* depth_lim.c */ /* depth_lim.c */
void Yap_InitItDeepenPreds(void); void Yap_InitItDeepenPreds(void);
struct AliasDescS * Yap_InitStandardAliases(void); struct AliasDescS *Yap_InitStandardAliases(void);
/* load_foreign.c */ /* load_foreign.c */
void Yap_InitLoadForeign(void); void Yap_InitLoadForeign(void);
@ -325,14 +328,12 @@ void Yap_InitMPI(void);
void Yap_InitMPE(void); void Yap_InitMPE(void);
#endif #endif
/* other.c */ /* other.c */
Term Yap_MkApplTerm(Functor,arity_t,const Term *); Term Yap_MkApplTerm(Functor, arity_t, const Term *);
Term Yap_MkNewApplTerm(Functor,arity_t); Term Yap_MkNewApplTerm(Functor, arity_t);
Term Yap_MkNewPairTerm(void); Term Yap_MkNewPairTerm(void);
Term Yap_Globalise(Term); Term Yap_Globalise(Term);
/* readutil.c */ /* readutil.c */
void Yap_InitReadUtil(void); void Yap_InitReadUtil(void);
@ -345,7 +346,7 @@ void Yap_InitQLYR(void);
void Yap_InitRange(void); void Yap_InitRange(void);
/* save.c */ /* save.c */
int Yap_SavedInfo(char *,char *,CELL *,CELL *,CELL *); int Yap_SavedInfo(char *, char *, CELL *, CELL *, CELL *);
int Yap_SavedStateRestore(char *, char *); int Yap_SavedStateRestore(char *, char *);
FILE *Yap_OpenRestore(char *, char *); FILE *Yap_OpenRestore(char *, char *);
void Yap_InitSavePreds(void); void Yap_InitSavePreds(void);
@ -356,14 +357,14 @@ void Yap_InitSavePreds(void);
void Yap_InitSignalCPreds(void); void Yap_InitSignalCPreds(void);
void *Yap_InitSignals(int wid); void *Yap_InitSignals(int wid);
void Yap_InitSockets (void); void Yap_InitSockets(void);
/* sort.c */ /* sort.c */
void Yap_InitSortPreds(void); void Yap_InitSortPreds(void);
/* stack.c */ /* stack.c */
void Yap_InitStInfo(void); void Yap_InitStInfo(void);
void Yap_dump_stack( void ); void Yap_dump_stack(void);
void Yap_detect_bug_location(yamop *yap_pc, int where_from, int psize); void Yap_detect_bug_location(yamop *yap_pc, int where_from, int psize);
#if !defined(YAPOR) && !defined(THREADS) #if !defined(YAPOR) && !defined(THREADS)
@ -388,43 +389,38 @@ int Yap_signal_index(const char *);
void Yap_SetTextFile(char *); void Yap_SetTextFile(char *);
#endif #endif
#if __ANDROIDD__ #if __ANDROIDD__
extern AAssetManager * Yap_assetManager; extern AAssetManager *Yap_assetManager;
extern void *Yap_openAssetFile( const char *path ) ; extern void *Yap_openAssetFile(const char *path);
extern bool Yap_isAsset( const char *path ); extern bool Yap_isAsset(const char *path);
#endif #endif
const char *Yap_getcwd(const char *, size_t); const char *Yap_getcwd(const char *, size_t);
void Yap_cputime_interval(Int *,Int *); void Yap_cputime_interval(Int *, Int *);
void Yap_systime_interval(Int *,Int *); void Yap_systime_interval(Int *, Int *);
void Yap_walltime_interval(Int *,Int *); void Yap_walltime_interval(Int *, Int *);
void Yap_InitSysbits(void); void Yap_InitSysbits(int wid);
void Yap_InitSysPreds(void); void Yap_InitSysPreds(void);
void Yap_InitcTime(int); void Yap_InitcTime(int);
void Yap_InitTime(int); void Yap_InitTime(int);
int Yap_TrueFileName(const char *, char *, int); int Yap_TrueFileName(const char *, char *, int);
int Yap_TruePrefixedFileName(const char *,const char *, char *, int); int Yap_TruePrefixedFileName(const char *, const char *, char *, int);
double Yap_random(void); double Yap_random(void);
#ifdef _WIN32 #ifdef _WIN32
char *Yap_RegistryGetString(char *); char *Yap_RegistryGetString(char *);
void Yap_WinError(char *); void Yap_WinError(char *);
#endif #endif
typedef enum { typedef enum { YAP_STD, YAP_SAVED_STATE, YAP_OBJ, YAP_PL, YAP_QLY } file_type_t;
YAP_STD,
YAP_SAVED_STATE,
YAP_OBJ,
YAP_PL,
YAP_QLY
} file_type_t;
bool bool Yap_trueFileName(const char *isource, const char *idef, const char *root,
Yap_trueFileName (const char *isource, const char * idef, const char *root, char *result, bool access, file_type_t ftype, bool expand_root, bool in_lib); char *result, bool access, file_type_t ftype,
bool expand_root, bool in_lib);
/* threads.c */ /* threads.c */
void Yap_InitThreadPreds(void); void Yap_InitThreadPreds(void);
void Yap_InitFirstWorkerThreadHandle(void); void Yap_InitFirstWorkerThreadHandle(void);
int Yap_ThreadID( void ); int Yap_ThreadID(void);
int Yap_NOfThreads( void ); int Yap_NOfThreads(void);
#if THREADS #if THREADS
int Yap_InitThread(int); int Yap_InitThread(int);
#endif #endif
@ -444,7 +440,7 @@ void Yap_InitAbsmi(void);
void Yap_InitUnify(void); void Yap_InitUnify(void);
void Yap_TrimTrail(void); void Yap_TrimTrail(void);
int Yap_Unifiable(Term d0, Term d1); int Yap_Unifiable(Term d0, Term d1);
int Yap_IUnify(register CELL d0,register CELL d1); int Yap_IUnify(register CELL d0, register CELL d1);
/* userpreds.c */ /* userpreds.c */
void Yap_InitUserCPreds(void); void Yap_InitUserCPreds(void);
@ -465,12 +461,11 @@ int Yap_IsAcyclicTerm(Term);
void Yap_InitUtilCPreds(void); void Yap_InitUtilCPreds(void);
Int Yap_TermHash(Term, Int, Int, int); Int Yap_TermHash(Term, Int, Int, int);
Int Yap_NumberVars(Term, Int, int); Int Yap_NumberVars(Term, Int, int);
Term Yap_TermVariables( Term t, UInt arity USES_REGS ); Term Yap_TermVariables(Term t, UInt arity USES_REGS);
Term Yap_UnNumberTerm(Term, int); Term Yap_UnNumberTerm(Term, int);
Int Yap_SkipList(Term *, Term **); Int Yap_SkipList(Term *, Term **);
/* yap.c */ /* yap.c */
/* write.c */ /* write.c */
/* yap2swi.c */ /* yap2swi.c */
@ -478,7 +473,8 @@ void Yap_swi_install(void);
void Yap_InitSWIHash(void); void Yap_InitSWIHash(void);
int Yap_get_stream_handle(Term, int, int, void *); int Yap_get_stream_handle(Term, int, int, void *);
Term Yap_get_stream_position(void *); Term Yap_get_stream_position(void *);
struct AtomEntryStruct *Yap_lookupBlob(void *blob, size_t len, void *type, int *newp); struct AtomEntryStruct *Yap_lookupBlob(void *blob, size_t len, void *type,
int *newp);
/* opt.preds.c */ /* opt.preds.c */
void Yap_init_optyap_preds(void); void Yap_init_optyap_preds(void);
@ -488,11 +484,9 @@ void Yap_init_optyap_preds(void);
void Yap_flush(void); void Yap_flush(void);
/* pl-yap.c */ /* pl-yap.c */
Int Yap_source_line_no( void ); Int Yap_source_line_no(void);
Atom Yap_source_file_name( void ); Atom Yap_source_file_name(void);
void Yap_install_blobs(void);
void yamop *Yap_gcP(void);
Yap_install_blobs(void);
yamop * Yap_gcP(void);

View File

@ -1935,14 +1935,19 @@ signal. */
#define USE_JUDY ${WITH_JUDY} #define USE_JUDY ${WITH_JUDY}
#endif #endif
/* use mmap in or-parallel allocation */ /* use Doug Lea's malloc ot implement the data-base. */
#ifndef USE_SYSTEM_MMAP #ifndef USE_DL_MALLOC
#define USE_SYSTEM_MMAP ${WITH_SYSTEM_MMAP} #cmakedefine USE_DL_MALLOC ${WITH_DL_MALLOC}
#endif #endif
/* use shm in or-parallel allocation */ /* use the OS malloc or some other external library to implement the data-base. */
#ifndef USE_SYSTEM_SHM #ifndef USE_SYSTEM_MALLOC
#define USE_SYSTEM_SHM ${WITH_SYSTEM_SHM} #cmakedefine USE_SYSTEM_MALLOC ${WITH_SYSTEM_MALLOC}
#endif
/* Use mmap in or-parallel copying */
#ifndef USE_SYSTEM_MMAP
#cmakedefine USE_SYSTEM_MMAP ${WITH_SYSTEM_MMAP}
#endif #endif
/* Whether daylight savings time offset is set via the altzone variable */ /* Whether daylight savings time offset is set via the altzone variable */
@ -1960,6 +1965,13 @@ signal. */
#cmakedefine USE_TIME_GMTOFF ${USE_TIME_GMTOFF} #cmakedefine USE_TIME_GMTOFF ${USE_TIME_GMTOFF}
#endif #endif
/* use the original YP malloc to implement the data-base. */
#ifndef USE_YAP_MALLOC
#cmakedefine USE_YAP_MALLOC ${WITH_YAP_MALLOC}
#endif
/* Define to name of the UUID header file. */ /* Define to name of the UUID header file. */
#ifndef UUID_H #ifndef UUID_H
#cmakedefine UUID_H "${UUID_H}" #cmakedefine UUID_H "${UUID_H}"

View File

@ -44,12 +44,21 @@ macro_log_feature (READLINE_FOUND "libreadline"
"http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html") "http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html")
if (READLINE_FOUND) if (READLINE_FOUND)
# - Find the readline library
# This module defines
# READLINE_INCLUDE_DIR, path to readline/readline.h, etc.
# READLINE_LIBRARIES, the libraries required to use READLINE.
# READLINE_FOUND, If false, do not try to use READLINE.
# also defined, but not for general use are
# READLINE_readline_LIBRARY, where to find the READLINE library.
# READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined]
set( CMAKE_REQUIRED_INCLUDES ${READLINE_INCLUDE_DIR} ${CMAKE_REQUIRED_INCLUDES} ) set( CMAKE_REQUIRED_INCLUDES ${READLINE_INCLUDE_DIR} ${CMAKE_REQUIRED_INCLUDES} )
set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${READLINE_LIBRARIES} ) set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${READLINE_LIBRARIES} )
check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H ) check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H )
check_include_files( "stdio.h;readline/history.h" HAVE_READLINE_HISTORY_H ) check_include_files( "stdio.h;readline/history.h" HAVE_READLINE_HISTORY_H )
if (HAVE_READLINE_READLINE_H) if (HAVE_READLINE_READLINE_H)
SET ( USE_READLINE 1 ) SET ( USE_READLINE ON )
check_function_exists( add_history HAVE_ADD_HISTORY ) check_function_exists( add_history HAVE_ADD_HISTORY )
check_function_exists( rl_begin_undo_group HAVE_RL_BEGIN_UNDO_GROUP) check_function_exists( rl_begin_undo_group HAVE_RL_BEGIN_UNDO_GROUP)
check_function_exists( rl_clear_pending_input HAVE_RL_CLEAR_PENDING_INPUT) check_function_exists( rl_clear_pending_input HAVE_RL_CLEAR_PENDING_INPUT)
@ -60,12 +69,12 @@ if (READLINE_FOUND)
check_function_exists( rl_reset_after_signal HAVE_RL_RESET_AFTER_SIGNAL ) check_function_exists( rl_reset_after_signal HAVE_RL_RESET_AFTER_SIGNAL )
check_function_exists( rl_set_keyboard_input_timeout HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT ) check_function_exists( rl_set_keyboard_input_timeout HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT )
check_function_exists( rl_set_prompt HAVE_RL_SET_PROMPT) check_function_exists( rl_set_prompt HAVE_RL_SET_PROMPT)
check_symbol_exists( rl_catch_signals stdio.h;readline/readline.h HAVE_DECL_RL_CATCH_SIGNALS ) check_variable_exists( rl_catch_signals "readline/readline.h" HAVE_DECL_RL_CATCH_SIGNALS )
check_symbol_exists( rl_completion_func_t stdio.h;readline/readline.h HAVE_DECL_RL_COMPLETION_FUNC_T ) check_symbol_exists( rl_completion_func_t stdio.h;readline/readline.h HAVE_DECL_RL_COMPLETION_FUNC_T )
check_symbol_exists( rl_done stdio.h;readline/readline.h HAVE_DECL_RL_DONE ) check_variable_exists( rl_done stdio.h;readline/readline.h HAVE_DECL_RL_DONE )
check_symbol_exists( rl_hook_func_t stdio.h;readline/readline.h HAVE_DECL_RL_HOOK_FUNC_T ) check_symbol_exists( rl_hook_func_t stdio.h;readline/readline.h HAVE_DECL_RL_HOOK_FUNC_T )
check_symbol_exists( rl_event_hook stdio.h;readline/readline.h HAVE_DECL_RL_EVENT_HOOK ) check_symbol_exists( rl_event_hook stdio.h;readline/readline.h HAVE_DECL_RL_EVENT_HOOK )
check_symbol_exists( rl_readline_state stdio.h;readline/readline.h HAVE_DECL_RL_READLINE_STATE ) check_variable_exists( rl_readline_state stdio.h;readline/readline.h HAVE_DECL_RL_READLINE_STATE )
endif() endif()
endif (READLINE_FOUND) endif (READLINE_FOUND)

View File

@ -1,6 +1,6 @@
/* Define if you have libreadline */ /* Define if you have libreadline */
#ifndef HAVE_LIBREADLINE #ifndef HAVE_LIBREADLINE
#define HAVE_LIBREADLINE ${USE_READLINE} #cmakedefine USE_READLINE ${USE_READLINE}
#endif #endif
/* Define to 1 if you have the <readline/history.h> header file. */ /* Define to 1 if you have the <readline/history.h> header file. */

View File

@ -50,7 +50,7 @@ static char SccsId[] = "%W% %G%";
#include "iopreds.h" #include "iopreds.h"
#if defined(HAVE_LIBREADLINE) #if defined(USE_READLINE)
#include <readline/readline.h> #include <readline/readline.h>
#include <readline/history.h> #include <readline/history.h>
@ -356,7 +356,7 @@ Yap_ReadlineForSIGINT(void)
static Int has_readline(USES_REGS1) static Int has_readline(USES_REGS1)
{ {
#if HAVE_LIBREADLINE && HAVE_READLINE_READLINE_H #if USE_READLINE
return true; return true;
#else #else
return false; return false;

View File

@ -1973,7 +1973,7 @@ Yap_InitPageSize(void)
* predicates * predicates
*/ */
void void
Yap_InitSysbits (void) Yap_InitSysbits (int wid)
{ {
CACHE_REGS CACHE_REGS
#if __simplescalar__ #if __simplescalar__