2016-04-22 18:25:59 +01:00
|
|
|
/*************************************************************************
|
2001-04-09 20:54:03 +01:00
|
|
|
* *
|
|
|
|
* YAP Prolog %W% %G% *
|
|
|
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
|
|
|
* *
|
|
|
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
|
|
|
* *
|
|
|
|
**************************************************************************
|
|
|
|
* *
|
|
|
|
* File: Yap.proto *
|
|
|
|
* mods: *
|
|
|
|
* comments: Function declarations for YAP *
|
2008-08-07 21:51:23 +01:00
|
|
|
* version: $Id: Yapproto.h,v 1.90 2008-08-07 20:51:23 vsc Exp $ *
|
2001-04-09 20:54:03 +01:00
|
|
|
*************************************************************************/
|
|
|
|
|
2016-02-28 19:32:55 +00:00
|
|
|
#if defined(_WIN32)
|
|
|
|
#define X_API __declspec(dllexport)
|
2016-02-29 03:13:23 +00:00
|
|
|
#else
|
|
|
|
#define X_API
|
2016-02-28 19:32:55 +00:00
|
|
|
#endif
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* prototype file for Yap */
|
|
|
|
|
|
|
|
/* absmi.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Int Yap_absmi(int);
|
|
|
|
extern int Yap_absmiEND(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* adtdefs.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term Yap_ArrayToList(Term *, size_t);
|
|
|
|
extern int Yap_GetName(char *, UInt, Term);
|
|
|
|
extern Term Yap_GetValue(Atom);
|
|
|
|
extern int Yap_HasOp(Atom);
|
|
|
|
extern struct operator_entry *
|
|
|
|
Yap_GetOpPropForAModuleHavingALock(struct AtomEntryStruct *, Term);
|
|
|
|
extern Atom Yap_LookupAtom(const char *);
|
|
|
|
extern Atom Yap_ULookupAtom(const unsigned char *);
|
|
|
|
extern Atom Yap_LookupAtomWithLength(const char *, size_t);
|
|
|
|
extern Atom Yap_FullLookupAtom(const char *);
|
|
|
|
extern void Yap_LookupAtomWithAddress(const char *, struct AtomEntryStruct *);
|
|
|
|
extern Prop Yap_NewPredPropByFunctor(struct FunctorEntryStruct *, Term);
|
|
|
|
extern Prop Yap_NewPredPropByAtom(struct AtomEntryStruct *, Term);
|
|
|
|
extern Prop Yap_PredPropByFunctorNonThreadLocal(struct FunctorEntryStruct *, Term);
|
|
|
|
extern Prop Yap_PredPropByAtomNonThreadLocal(struct AtomEntryStruct *, Term);
|
|
|
|
extern Functor Yap_UnlockedMkFunctor(struct AtomEntryStruct *, arity_t);
|
|
|
|
extern Functor Yap_MkFunctor(Atom, arity_t);
|
|
|
|
extern void Yap_MkFunctorWithAddress(Atom, unsigned int, FunctorEntry *);
|
|
|
|
extern void Yap_PutValue(Atom, Term);
|
|
|
|
extern void Yap_ReleaseAtom(Atom);
|
|
|
|
extern int Yap_AtomIncreaseHold(Atom);
|
|
|
|
extern int Yap_AtomDecreaseHold(Atom);
|
|
|
|
extern struct operator_entry *Yap_OpPropForModule(Atom, Term);
|
2002-10-17 01:05:29 +01:00
|
|
|
|
2008-03-25 22:03:14 +00:00
|
|
|
#ifdef SFUNC
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term MkSFTerm(Functor, int, Term *, Term);
|
|
|
|
extern CELL *ArgsOfSFTerm(Term);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Prop Yap_GetPredPropByAtom(Atom, Term);
|
|
|
|
extern Prop Yap_GetPredPropByFunc(Functor, Term);
|
|
|
|
extern Prop Yap_GetPredPropByAtomInThisModule(Atom, Term);
|
|
|
|
extern Prop Yap_GetPredPropByFuncInThisModule(Functor, Term);
|
|
|
|
extern Prop Yap_GetPredPropHavingLock(Atom, unsigned int, Term);
|
|
|
|
extern Prop Yap_GetExpProp(Atom, unsigned int);
|
|
|
|
extern Prop Yap_GetExpPropHavingLock(struct AtomEntryStruct *, unsigned int);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2002-06-04 19:21:55 +01:00
|
|
|
/* agc.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_atom_gc(CACHE_TYPE1);
|
|
|
|
extern void Yap_init_agc(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* alloc.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_FreeCodeSpace(void *);
|
|
|
|
extern void *Yap_AllocAtomSpace(size_t);
|
|
|
|
extern void *Yap_AllocCodeSpace(size_t);
|
|
|
|
extern void *Yap_ReallocCodeSpace(void *, size_t);
|
|
|
|
extern ADDR Yap_AllocFromForeignArea(Int);
|
|
|
|
extern int Yap_ExtendWorkSpace(Int);
|
|
|
|
extern void Yap_FreeAtomSpace(void *);
|
|
|
|
extern int Yap_FreeWorkSpace(void);
|
|
|
|
extern void Yap_InitMemory(UInt, UInt, UInt);
|
|
|
|
extern void Yap_InitExStacks(int, int, int);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* amasm.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern OPCODE Yap_opcode(op_numbers);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* analyst.c */
|
|
|
|
#ifdef ANALYST
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitAnalystPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* ANALYST */
|
|
|
|
|
|
|
|
/* arrays.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitArrayPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2013-05-15 23:12:01 +01:00
|
|
|
/* atoms.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitBackAtoms(void);
|
|
|
|
extern void Yap_InitAtomPreds(void);
|
2013-05-15 23:12:01 +01:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* attvar.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitAttVarPreds(void);
|
|
|
|
extern void Yap_MkEmptyWakeUp(Atom mod);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* bb.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitBBPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* bignum.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term Yap_MkULLIntTerm(YAP_ULONG_LONG);
|
|
|
|
extern int Yap_IsStringTerm(Term);
|
|
|
|
extern int Yap_IsWideStringTerm(Term);
|
|
|
|
extern Term Yap_RatTermToApplTerm(Term);
|
|
|
|
extern void Yap_InitBigNums(void);
|
|
|
|
extern Term Yap_AllocExternalDataInStack(CELL, size_t);
|
|
|
|
extern int Yap_CleanOpaqueVariable(CELL *);
|
|
|
|
extern CELL *Yap_HeapStoreOpaqueTerm(Term t);
|
|
|
|
extern size_t Yap_OpaqueTermToString(Term t, char *str, size_t max);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* c_interface.c */
|
2014-04-28 11:48:24 +01:00
|
|
|
#ifndef YAP_CPP_INTERFACE
|
2016-07-31 16:31:22 +01:00
|
|
|
extern X_API Int YAP_Execute(struct pred_entry *, CPredicate);
|
|
|
|
extern X_API Int YAP_ExecuteFirst(struct pred_entry *, CPredicate);
|
|
|
|
extern X_API Int YAP_ExecuteNext(struct pred_entry *, CPredicate);
|
|
|
|
extern X_API Int YAP_ExecuteOnCut(struct pred_entry *, CPredicate, struct cut_c_str *);
|
|
|
|
extern X_API Int YAP_RunGoalOnce(Term);
|
2014-04-28 11:48:24 +01:00
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* cdmgr.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term Yap_all_calls(void);
|
|
|
|
extern Atom Yap_ConsultingFile(USES_REGS1);
|
|
|
|
extern struct pred_entry *Yap_PredForChoicePt(choiceptr bptr, op_numbers *op);
|
|
|
|
extern void Yap_InitCdMgr(void);
|
|
|
|
extern struct pred_entry *Yap_PredFromClause(Term t USES_REGS);
|
|
|
|
extern bool Yap_discontiguous(struct pred_entry *ap, Term mode USES_REGS);
|
|
|
|
extern bool Yap_multiple(struct pred_entry *ap, Term mode USES_REGS);
|
|
|
|
extern void Yap_init_consult(int, const char *);
|
|
|
|
extern void Yap_end_consult(void);
|
|
|
|
extern void Yap_Abolish(struct pred_entry *);
|
|
|
|
extern void Yap_BuildMegaClause(struct pred_entry *);
|
|
|
|
extern void Yap_EraseMegaClause(yamop *, struct pred_entry *);
|
|
|
|
extern void Yap_ResetConsultStack(void);
|
|
|
|
extern void Yap_AssertzClause(struct pred_entry *, yamop *);
|
|
|
|
extern void Yap_HidePred(struct pred_entry *pe);
|
|
|
|
extern int Yap_SetNoTrace(char *name, UInt arity, Term tmod);
|
|
|
|
extern bool Yap_unknown(Term tflagvalue);
|
|
|
|
extern struct pred_entry *Yap_MkLogPred(struct pred_entry *pe);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* cmppreds.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Int Yap_compare_terms(Term, Term);
|
|
|
|
extern Int Yap_acmp(Term, Term USES_REGS);
|
|
|
|
extern void Yap_InitCmpPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* compiler.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern yamop *Yap_cclause(Term, Int, Term, Term);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* computils.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern int Yap_DebugPutc(FILE *, wchar_t);
|
|
|
|
extern int Yap_DebugPuts(FILE *, const char *);
|
|
|
|
extern void Yap_DebugSetIFile(char *);
|
|
|
|
extern void Yap_DebugEndline(void);
|
|
|
|
extern void Yap_DebugPlWrite(Term t);
|
|
|
|
extern void Yap_DebugPlWriteln(Term t);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* corout.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitCoroutPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef COROUTINING
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term Yap_ListOfWokenGoals(void);
|
|
|
|
extern void Yap_WakeUp(CELL *);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* dbase.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern struct pred_entry *Yap_FindLUIntKey(Int);
|
|
|
|
extern int Yap_DBTrailOverflow(void);
|
|
|
|
extern CELL Yap_EvalMasks(Term, CELL *);
|
|
|
|
extern void Yap_InitBackDB(void);
|
|
|
|
extern void Yap_InitDBPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* errors.c */
|
2014-09-16 10:00:31 +01:00
|
|
|
#if DEBUG
|
2016-07-31 16:31:22 +01:00
|
|
|
extern const char *Yap_PrintPredName(struct pred_entry *ap);
|
2014-09-16 10:00:31 +01:00
|
|
|
#endif
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_RestartYap(int);
|
|
|
|
extern void Yap_exit(int);
|
|
|
|
extern bool Yap_Warning(const char *s, ...);
|
|
|
|
extern bool Yap_PrintWarning(Term t);
|
|
|
|
extern bool Yap_HandleError__(const char *file, const char *function, int lineno,
|
2016-04-22 18:25:59 +01:00
|
|
|
const char *s, ...);
|
|
|
|
#define Yap_HandleError(...) \
|
|
|
|
Yap_HandleError__(__FILE__, __FUNCTION__, __LINE__, __VA_ARGS__)
|
2016-07-31 16:31:22 +01:00
|
|
|
extern int Yap_SWIHandleError(const char *, ...);
|
|
|
|
extern void Yap_InitErrorPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* eval.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitEval(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* exec.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_fail_all(choiceptr bb USES_REGS);
|
|
|
|
extern Term Yap_ExecuteCallMetaCall(Term);
|
|
|
|
extern void Yap_InitExecFs(void);
|
|
|
|
extern bool Yap_JumpToEnv(Term);
|
|
|
|
extern Term Yap_RunTopGoal(Term, bool);
|
|
|
|
extern bool Yap_execute_goal(Term, int, Term, bool);
|
|
|
|
extern bool Yap_exec_absmi(bool, yap_reset_t);
|
|
|
|
extern void Yap_trust_last(void);
|
|
|
|
|
|
|
|
extern void Yap_PrepGoal(UInt, CELL *, choiceptr USES_REGS);
|
|
|
|
extern bool Yap_execute_pred(struct pred_entry *ppe, CELL *pt,
|
2016-04-22 18:25:59 +01:00
|
|
|
bool pass_exception USES_REGS);
|
2016-07-31 16:31:22 +01:00
|
|
|
extern int Yap_dogc(int extra_args, Term *tp USES_REGS);
|
|
|
|
extern Term Yap_PredicateIndicator(Term t, Term mod);
|
|
|
|
extern bool Yap_Execute(Term t USES_REGS);
|
2015-07-06 12:01:55 +01:00
|
|
|
|
2013-01-07 09:47:14 +00:00
|
|
|
/* exo.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitExoPreds(void);
|
|
|
|
extern void Yap_udi_Interval_init(void);
|
|
|
|
extern bool Yap_Reset(yap_reset_t mode);
|
2013-01-07 09:47:14 +00:00
|
|
|
|
2013-01-29 10:50:04 +00:00
|
|
|
/* foreign.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern char *Yap_FindExecutable(void);
|
2013-01-29 10:50:04 +00:00
|
|
|
|
2005-12-17 03:25:39 +00:00
|
|
|
/* gprof.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitLowProf(void);
|
2015-11-09 18:22:43 +00:00
|
|
|
#if LOW_PROF
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_inform_profiler_of_clause__(void *, void *, struct pred_entry *,
|
2015-11-09 18:22:43 +00:00
|
|
|
gprof_info);
|
|
|
|
#define Yap_inform_profiler_of_clause(CODE0, CODEF, AP, MODE) \
|
|
|
|
{ \
|
|
|
|
if (GLOBAL_FPreds) \
|
|
|
|
Yap_inform_profiler_of_clause__(CODE0, CODEF, AP, MODE); \
|
|
|
|
}
|
2005-12-17 03:25:39 +00:00
|
|
|
#else
|
2015-11-09 18:22:43 +00:00
|
|
|
#define Yap_inform_profiler_of_clause(CODE0, CODEF, AP, MODE)
|
2005-12-17 03:25:39 +00:00
|
|
|
#endif
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_tell_gprof(yamop *);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2006-08-22 17:12:46 +01:00
|
|
|
/* globals.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term Yap_NewArena(UInt, CELL *);
|
|
|
|
extern CELL *Yap_GetFromArena(Term *, UInt, UInt);
|
|
|
|
extern void Yap_InitGlobals(void);
|
|
|
|
extern Term Yap_SaveTerm(Term);
|
|
|
|
extern Term Yap_SetGlobalVal(Atom, Term);
|
|
|
|
extern Term Yap_GetGlobal(Atom);
|
|
|
|
extern Int Yap_DeleteGlobal(Atom);
|
|
|
|
extern void Yap_AllocateDefaultArena(Int, Int, int);
|
2006-08-22 17:12:46 +01:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* grow.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Int Yap_total_stack_shift_time(void);
|
|
|
|
extern void Yap_InitGrowPreds(void);
|
|
|
|
extern UInt Yap_InsertInGlobal(CELL *, UInt);
|
|
|
|
extern int Yap_growheap(bool, size_t, void *);
|
|
|
|
extern int Yap_growstack(size_t);
|
|
|
|
extern int Yap_growtrail(size_t, bool);
|
|
|
|
extern int Yap_growglobal(CELL **);
|
|
|
|
extern int Yap_locked_growheap(bool, size_t, void *);
|
|
|
|
extern int Yap_locked_growstack(size_t);
|
|
|
|
extern int Yap_locked_growtrail(size_t, bool);
|
|
|
|
extern int Yap_locked_growglobal(CELL **);
|
|
|
|
extern CELL **Yap_shift_visit(CELL **, CELL ***, CELL ***);
|
2010-01-14 15:58:19 +00:00
|
|
|
#ifdef THREADS
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_CopyThreadStacks(int, int, int);
|
2010-01-14 15:58:19 +00:00
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* heapgc.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Int Yap_total_gc_time(void);
|
|
|
|
extern void Yap_init_gc(void);
|
|
|
|
extern bool Yap_is_gc_verbose(void);
|
|
|
|
extern int Yap_gc(Int, CELL *, yamop *);
|
|
|
|
extern int Yap_locked_gc(Int, CELL *, yamop *);
|
|
|
|
extern int Yap_gcl(UInt, Int, CELL *, yamop *);
|
|
|
|
extern int Yap_locked_gcl(UInt, Int, CELL *, yamop *);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* init.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern int Yap_IsOpType(char *);
|
|
|
|
extern void Yap_InitWorkspace(UInt, UInt, UInt, UInt, UInt, int, int, int);
|
|
|
|
extern bool Yap_AddCallToFli(struct pred_entry *pe, CPredicate call);
|
|
|
|
extern bool Yap_AddRetryToFli(struct pred_entry *pe, CPredicate re);
|
|
|
|
extern bool Yap_AddCutToFli(struct pred_entry *pe, CPredicate cut);
|
|
|
|
extern const char *Yap_version(void);
|
2004-02-19 19:24:46 +00:00
|
|
|
|
2011-05-23 16:19:47 +01:00
|
|
|
#ifdef YAPOR
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_init_yapor_workers(void);
|
2011-05-23 16:19:47 +01:00
|
|
|
#endif /* YAPOR */
|
2004-02-19 19:24:46 +00:00
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_KillStacks(int);
|
2004-02-19 19:24:46 +00:00
|
|
|
#else
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_KillStacks(int);
|
2004-02-19 19:24:46 +00:00
|
|
|
#endif
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitYaamRegs(int);
|
|
|
|
extern void Yap_ReInitWTime(void);
|
|
|
|
extern int Yap_OpDec(int, char *, Atom, Term);
|
|
|
|
extern void Yap_CloseScratchPad(void);
|
2002-11-11 17:38:10 +00:00
|
|
|
|
|
|
|
/* inlines.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitInlines(void);
|
|
|
|
extern int Yap_eq(Term, Term);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* iopreds.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitPlIO(void);
|
|
|
|
extern void Yap_InitBackIO(void);
|
|
|
|
extern void Yap_InitIOPreds(void);
|
2015-11-09 18:22:43 +00:00
|
|
|
extern void Yap_DebugPlWrite(Term t);
|
|
|
|
extern void Yap_DebugPlWriteln(Term t);
|
|
|
|
extern void Yap_DebugErrorPutc(int n);
|
|
|
|
extern void Yap_DebugErrorPuts(const char *s);
|
|
|
|
extern void Yap_DebugWriteIndicator(struct pred_entry *ap);
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_PlWriteToStream(Term, int, int);
|
|
|
|
extern void Yap_CloseReadline(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
/* depth_lim.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern bool Yap_InitReadline(Term t);
|
|
|
|
extern void Yap_InitItDeepenPreds(void);
|
|
|
|
extern struct AliasDescS *Yap_InitStandardAliases(void);
|
|
|
|
extern struct vfs *Yap_InitAssetManager(void);
|
2015-11-09 18:22:43 +00:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* load_foreign.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitLoadForeign(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* mavar.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitMaVarCPreds(void);
|
|
|
|
extern Term Yap_NewTimedVar(Term);
|
|
|
|
extern Term Yap_NewEmptyTimedVar(void);
|
|
|
|
extern Term Yap_ReadTimedVar(Term);
|
|
|
|
extern Term Yap_UpdateTimedVar(Term, Term);
|
2002-11-11 17:38:10 +00:00
|
|
|
|
|
|
|
/* modules.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term Yap_Module(Term);
|
|
|
|
extern Term Yap_Module_Name(struct pred_entry *);
|
|
|
|
extern struct pred_entry *Yap_ModulePred(Term);
|
|
|
|
extern void Yap_NewModulePred(Term, struct pred_entry *);
|
|
|
|
extern Term Yap_StripModule(Term, Term *);
|
|
|
|
extern Term Yap_YapStripModule(Term, Term *);
|
|
|
|
extern void Yap_InitModules(void);
|
|
|
|
extern void Yap_InitModulesC(void);
|
|
|
|
extern struct mod_entry *Yap_GetModuleEntry(Term tmod);
|
|
|
|
extern Term Yap_GetModuleFromEntry(struct mod_entry *me);
|
|
|
|
extern bool Yap_CharacterEscapes(Term mt);
|
|
|
|
extern bool Yap_constPred(struct pred_entry *pt);
|
|
|
|
extern bool Yap_isSystemModule(Term mod);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2002-02-11 20:46:41 +00:00
|
|
|
#if HAVE_MPI
|
|
|
|
/* mpi.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitMPI(void);
|
2002-02-11 20:46:41 +00:00
|
|
|
#endif
|
|
|
|
|
2002-10-03 18:29:46 +01:00
|
|
|
#if HAVE_MPE
|
|
|
|
/* mpe.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitMPE(void);
|
2002-10-03 18:29:46 +01:00
|
|
|
#endif
|
|
|
|
|
2002-11-11 17:38:10 +00:00
|
|
|
/* other.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term Yap_MkApplTerm(Functor, arity_t, const Term *);
|
|
|
|
extern Term Yap_MkNewApplTerm(Functor, arity_t);
|
|
|
|
extern Term Yap_MkNewPairTerm(void);
|
|
|
|
extern Term Yap_Globalise(Term);
|
2002-11-11 17:38:10 +00:00
|
|
|
|
2006-08-02 19:18:31 +01:00
|
|
|
/* readutil.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitReadUtil(void);
|
2006-08-02 19:18:31 +01:00
|
|
|
|
2011-08-03 08:23:00 +01:00
|
|
|
/* qly.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitQLY(void);
|
|
|
|
extern YAP_file_type_t Yap_Restore(const char *, const char *);
|
|
|
|
extern void Yap_InitQLYR(void);
|
2011-08-03 08:23:00 +01:00
|
|
|
|
2012-10-23 14:55:17 +01:00
|
|
|
/* range.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitRange(void);
|
2012-10-23 14:55:17 +01:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* save.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern int Yap_SavedInfo(const char *, const char *, CELL *, CELL *, CELL *);
|
|
|
|
extern int Yap_SavedStateRestore(char *, char *);
|
|
|
|
extern FILE *Yap_OpenRestore(const char *, const char *);
|
|
|
|
extern void Yap_InitSavePreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* scanner.c */
|
|
|
|
|
2013-02-08 16:36:45 +00:00
|
|
|
/* signals.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitSignalCPreds(void);
|
|
|
|
extern void *Yap_InitSignals(int wid);
|
|
|
|
extern bool Yap_DisableInterrupts(int wid);
|
|
|
|
extern bool Yap_EnableInterrupts(int wid);
|
2013-02-08 16:36:45 +00:00
|
|
|
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitSockets(void);
|
2015-06-19 00:52:03 +01:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* sort.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitSortPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2015-09-21 23:05:36 +01:00
|
|
|
/* stack.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitStInfo(void);
|
|
|
|
extern void Yap_dump_stack(void);
|
|
|
|
extern void Yap_detect_bug_location(yamop *yap_pc, int where_from, int psize);
|
2015-09-25 10:57:26 +01:00
|
|
|
|
2015-09-21 23:05:36 +01:00
|
|
|
#if !defined(YAPOR) && !defined(THREADS)
|
2016-07-31 16:31:22 +01:00
|
|
|
extern bool Yap_search_for_static_predicate_in_use(struct pred_entry *, bool);
|
2015-09-21 23:05:36 +01:00
|
|
|
#endif
|
2013-12-02 14:49:41 +00:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* stdpreds.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitBackCPreds(void);
|
|
|
|
extern void Yap_InitCPreds(void);
|
|
|
|
extern void Yap_show_statistics(void);
|
|
|
|
extern int Yap_IsOpMaxPrio(Atom);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* sysbits.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern size_t Yap_InitPageSize(void);
|
|
|
|
extern bool Yap_set_fpu_exceptions(Term);
|
|
|
|
extern UInt Yap_cputime(void);
|
|
|
|
extern uint64_t Yap_walltime(void);
|
|
|
|
extern int Yap_dir_separator(int);
|
|
|
|
extern int Yap_volume_header(char *);
|
|
|
|
extern int Yap_signal_index(const char *);
|
2008-03-25 22:03:14 +00:00
|
|
|
#ifdef MAC
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_SetTextFile(char *);
|
2002-11-11 17:38:10 +00:00
|
|
|
#endif
|
2016-02-28 19:32:55 +00:00
|
|
|
#if __ANDROID__
|
2016-04-05 02:28:56 +01:00
|
|
|
#include <android/asset_manager.h>
|
2015-11-09 18:22:43 +00:00
|
|
|
extern AAssetManager *Yap_assetManager;
|
2015-04-13 13:28:17 +01:00
|
|
|
|
2015-11-09 18:22:43 +00:00
|
|
|
extern void *Yap_openAssetFile(const char *path);
|
|
|
|
extern bool Yap_isAsset(const char *path);
|
2015-04-13 13:28:17 +01:00
|
|
|
#endif
|
2016-07-31 16:31:22 +01:00
|
|
|
extern const char *Yap_getcwd(const char *, size_t);
|
|
|
|
extern void Yap_cputime_interval(Int *, Int *);
|
|
|
|
extern void Yap_systime_interval(Int *, Int *);
|
|
|
|
extern void Yap_InitSysbits(int wid);
|
|
|
|
extern void Yap_InitSysPreds(void);
|
|
|
|
extern void Yap_InitcTime(int);
|
|
|
|
extern void Yap_InitTime(int);
|
|
|
|
extern double Yap_random(void);
|
2008-03-27 00:41:33 +00:00
|
|
|
#ifdef _WIN32
|
2016-07-31 16:31:22 +01:00
|
|
|
extern char *Yap_RegistryGetString(char *);
|
|
|
|
extern void Yap_WinError(char *);
|
2008-03-27 00:41:33 +00:00
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2016-07-31 16:31:22 +01:00
|
|
|
extern const char *Yap_AbsoluteFile(const char *spec, char *obuf, bool ok);
|
|
|
|
extern const char *Yap_AbsoluteFileInBuffer(const char *spec, char *outp, size_t sz,
|
2016-04-22 18:25:59 +01:00
|
|
|
bool ok);
|
2016-07-31 16:31:22 +01:00
|
|
|
extern const char *Yap_findFile(const char *isource, const char *idef,
|
2016-04-22 18:25:59 +01:00
|
|
|
const char *root, char *result, bool access,
|
2016-05-10 08:33:44 +01:00
|
|
|
YAP_file_type_t ftype, bool expand_root, bool in_lib);
|
2004-01-23 02:23:51 +00:00
|
|
|
/* threads.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitThreadPreds(void);
|
|
|
|
extern void Yap_InitFirstWorkerThreadHandle(void);
|
|
|
|
extern int Yap_ThreadID(void);
|
|
|
|
extern int Yap_NOfThreads(void);
|
2011-03-11 19:49:32 +00:00
|
|
|
#if THREADS
|
2016-07-31 16:31:22 +01:00
|
|
|
extern int Yap_InitThread(int);
|
2011-03-11 19:49:32 +00:00
|
|
|
#endif
|
2016-07-31 16:31:22 +01:00
|
|
|
extern intptr_t system_thread_id(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
/* tracer.c */
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitLowLevelTrace(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
2016-11-02 05:16:36 +00:00
|
|
|
extern void *Yap_InitTextAllocator( void );
|
|
|
|
|
2009-03-27 15:28:50 +00:00
|
|
|
/* udi.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_udi_init(void);
|
|
|
|
extern void Yap_udi_abolish(struct pred_entry *);
|
2009-03-27 15:28:50 +00:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* unify.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern int Yap_rational_tree_loop(CELL *, CELL *, CELL **, CELL **);
|
|
|
|
extern void Yap_InitAbsmi(void);
|
|
|
|
extern void Yap_InitUnify(void);
|
|
|
|
extern void Yap_TrimTrail(void);
|
|
|
|
extern int Yap_Unifiable(Term d0, Term d1);
|
|
|
|
extern int Yap_IUnify(register CELL d0, register CELL d1);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* userpreds.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_InitUserCPreds(void);
|
|
|
|
extern void Yap_InitUserBacks(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* utilpreds.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Term Yap_CopyTerm(Term);
|
|
|
|
extern bool Yap_Variant(Term, Term);
|
|
|
|
extern size_t Yap_ExportTerm(Term, char *, size_t, UInt);
|
|
|
|
extern size_t Yap_SizeOfExportedTerm(char *);
|
|
|
|
extern Term Yap_ImportTerm(char *);
|
|
|
|
extern bool Yap_IsListTerm(Term);
|
|
|
|
extern bool Yap_IsListOrPartialListTerm(Term);
|
|
|
|
extern Term Yap_CopyTermNoShare(Term);
|
|
|
|
extern int Yap_SizeGroundTerm(Term, int);
|
|
|
|
extern bool Yap_IsGroundTerm(Term);
|
|
|
|
extern bool Yap_IsAcyclicTerm(Term);
|
|
|
|
extern void Yap_InitUtilCPreds(void);
|
|
|
|
extern Int Yap_TermHash(Term, Int, Int, int);
|
|
|
|
extern Int Yap_NumberVars(Term, Int, bool);
|
|
|
|
extern Term Yap_TermVariables(Term t, UInt arity USES_REGS);
|
|
|
|
extern Term Yap_UnNumberTerm(Term, int);
|
|
|
|
extern Int Yap_SkipList(Term *, Term **);
|
2001-04-09 20:54:03 +01:00
|
|
|
/* yap.c */
|
|
|
|
|
2011-06-01 17:34:04 +01:00
|
|
|
/* write.c */
|
|
|
|
|
2007-10-18 09:24:16 +01:00
|
|
|
/* yap2swi.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_swi_install(void);
|
|
|
|
extern void Yap_InitSWIHash(void);
|
|
|
|
extern int Yap_get_stream_handle(Term, int, int, void *);
|
|
|
|
extern Term Yap_get_stream_position(void *);
|
|
|
|
extern struct AtomEntryStruct *Yap_lookupBlob(void *blob, size_t len, void *type,
|
2015-11-09 18:22:43 +00:00
|
|
|
int *newp);
|
2007-10-18 09:24:16 +01:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* opt.preds.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_init_optyap_preds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2011-03-03 11:41:21 +00:00
|
|
|
/* pl-file.c */
|
2016-01-31 10:42:08 +00:00
|
|
|
// struct PL_local_data *Yap_InitThreadIO(int wid);
|
2016-07-31 16:31:22 +01:00
|
|
|
extern void Yap_flush(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2013-11-05 17:59:19 +00:00
|
|
|
/* pl-yap.c */
|
2016-07-31 16:31:22 +01:00
|
|
|
extern Int Yap_source_line_no(void);
|
|
|
|
extern Atom Yap_source_file_name(void);
|
|
|
|
|
|
|
|
extern void Yap_install_blobs(void);
|
2015-06-19 00:52:03 +01:00
|
|
|
|
2016-07-31 16:31:22 +01:00
|
|
|
extern yamop *Yap_gcP(void);
|
2015-06-19 00:52:03 +01:00
|
|
|
|
2016-07-31 16:31:22 +01:00
|
|
|
#if USE_MYDDAS
|
|
|
|
extern void init_myddas(void);
|
|
|
|
#endif
|
2016-01-31 10:42:08 +00:00
|
|
|
|
|
|
|
#if !HAVE_STRNCAT
|
|
|
|
#define strncat(X, Y, Z) strcat(X, Y)
|
|
|
|
#endif
|
|
|
|
#if !HAVE_STRNCPY
|
|
|
|
#define strncpy(X, Y, Z) strcpy(X, Y)
|
|
|
|
#endif
|