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
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
/* prototype file for Yap */
|
|
|
|
|
|
|
|
/* absmi.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Int Yap_absmi(int);
|
|
|
|
int Yap_absmiEND(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* adtdefs.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_ArrayToList(Term *,int);
|
|
|
|
int Yap_GetName(char *,UInt,Term);
|
|
|
|
Term Yap_GetValue(Atom);
|
|
|
|
int Yap_HasOp(Atom);
|
|
|
|
struct operator_entry *Yap_GetOpPropForAModuleHavingALock(AtomEntry *, Term);
|
|
|
|
Atom Yap_LookupAtom(char *);
|
2013-12-02 14:49:41 +00:00
|
|
|
Atom Yap_LookupAtomWithLength(char *, size_t);
|
|
|
|
Atom Yap_LookupUTF8Atom(char *);
|
2013-04-25 23:15:04 +01:00
|
|
|
Atom Yap_LookupMaybeWideAtom(wchar_t *);
|
|
|
|
Atom Yap_LookupMaybeWideAtomWithLength(wchar_t *, size_t);
|
|
|
|
Atom Yap_FullLookupAtom(char *);
|
|
|
|
void Yap_LookupAtomWithAddress(char *,AtomEntry *);
|
|
|
|
Prop Yap_NewPredPropByFunctor(struct FunctorEntryStruct *, Term);
|
|
|
|
Prop Yap_NewPredPropByAtom(struct AtomEntryStruct *, Term);
|
|
|
|
Prop Yap_PredPropByFunctorNonThreadLocal(struct FunctorEntryStruct *, Term);
|
|
|
|
Prop Yap_PredPropByAtomNonThreadLocal(struct AtomEntryStruct *, Term);
|
|
|
|
Functor Yap_UnlockedMkFunctor(AtomEntry *,unsigned int);
|
|
|
|
Functor Yap_MkFunctor(Atom,unsigned int);
|
|
|
|
void Yap_MkFunctorWithAddress(Atom,unsigned int,FunctorEntry *);
|
|
|
|
void Yap_PutValue(Atom,Term);
|
|
|
|
void Yap_ReleaseAtom(Atom);
|
|
|
|
int Yap_AtomIncreaseHold(Atom);
|
|
|
|
int Yap_AtomDecreaseHold(Atom);
|
|
|
|
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
|
2013-04-25 23:15:04 +01:00
|
|
|
Term MkSFTerm(Functor,int,Term *,Term);
|
|
|
|
CELL *ArgsOfSFTerm(Term);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
2013-04-25 23:15:04 +01:00
|
|
|
Prop Yap_GetPredPropByAtom(Atom, Term);
|
|
|
|
Prop Yap_GetPredPropByFunc(Functor, Term);
|
|
|
|
Prop Yap_GetPredPropByAtomInThisModule(Atom, Term);
|
|
|
|
Prop Yap_GetPredPropByFuncInThisModule(Functor, Term);
|
|
|
|
Prop Yap_GetPredPropHavingLock(Atom,unsigned int, Term);
|
|
|
|
Prop Yap_GetExpProp(Atom,unsigned int);
|
|
|
|
Prop Yap_GetExpPropHavingLock(AtomEntry *,unsigned int);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2002-06-04 19:21:55 +01:00
|
|
|
/* agc.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_atom_gc( CACHE_TYPE1 );
|
|
|
|
void Yap_init_agc( void );
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* alloc.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_FreeCodeSpace(char *);
|
|
|
|
char *Yap_AllocAtomSpace(size_t);
|
|
|
|
char *Yap_AllocCodeSpace(size_t);
|
|
|
|
char *Yap_ReallocCodeSpace(char *,size_t);
|
|
|
|
ADDR Yap_AllocFromForeignArea(Int);
|
|
|
|
int Yap_ExtendWorkSpace(Int);
|
|
|
|
void Yap_FreeAtomSpace(char *);
|
|
|
|
int Yap_FreeWorkSpace(void);
|
|
|
|
void Yap_InitMemory(UInt,UInt,UInt);
|
|
|
|
void Yap_InitExStacks(int,int,int);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* amasm.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
OPCODE Yap_opcode(op_numbers);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* analyst.c */
|
|
|
|
#ifdef ANALYST
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitAnalystPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* ANALYST */
|
|
|
|
|
|
|
|
/* arrays.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitArrayPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2013-05-15 23:12:01 +01:00
|
|
|
/* atoms.c */
|
|
|
|
void Yap_InitBackAtoms(void);
|
|
|
|
void Yap_InitAtomPreds(void);
|
|
|
|
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* attvar.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitAttVarPreds(void);
|
2013-04-30 21:23:01 +01:00
|
|
|
void Yap_MkEmptyWakeUp(Atom mod);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* bb.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitBBPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* bignum.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_MkULLIntTerm(YAP_ULONG_LONG);
|
|
|
|
int Yap_IsStringTerm(Term);
|
|
|
|
int Yap_IsWideStringTerm(Term);
|
|
|
|
Term Yap_RatTermToApplTerm(Term);
|
|
|
|
void Yap_InitBigNums(void);
|
|
|
|
Term Yap_AllocExternalDataInStack(CELL, size_t);
|
|
|
|
int Yap_CleanOpaqueVariable(CELL *);
|
2014-01-17 09:39:29 +00:00
|
|
|
CELL *Yap_HeapStoreOpaqueTerm(Term t);
|
|
|
|
size_t Yap_OpaqueTermToString(Term t, char *str, size_t max);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* c_interface.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Int YAP_Execute(struct pred_entry *, CPredicate);
|
|
|
|
Int YAP_ExecuteFirst(struct pred_entry *, CPredicate);
|
|
|
|
Int YAP_ExecuteNext(struct pred_entry *, CPredicate);
|
|
|
|
Int YAP_ExecuteOnCut(struct pred_entry *, CPredicate, struct cut_c_str *);
|
2013-11-04 01:03:57 +00:00
|
|
|
Int YAP_RunGoalOnce(Term);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* cdmgr.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_all_calls(void);
|
|
|
|
Atom Yap_ConsultingFile(void);
|
|
|
|
struct pred_entry *Yap_PredForChoicePt(choiceptr);
|
|
|
|
void Yap_InitCdMgr(void);
|
|
|
|
void Yap_init_consult(int, char *);
|
|
|
|
void Yap_end_consult(void);
|
|
|
|
void Yap_Abolish(struct pred_entry *);
|
|
|
|
void Yap_BuildMegaClause(struct pred_entry *);
|
|
|
|
void Yap_EraseMegaClause(yamop *,struct pred_entry *);
|
|
|
|
void Yap_ResetConsultStack(void);
|
|
|
|
void Yap_AssertzClause(struct pred_entry *, yamop *);
|
2012-10-19 18:10:48 +01:00
|
|
|
void Yap_HidePred(struct pred_entry *pe);
|
2013-12-11 01:05:51 +00:00
|
|
|
int Yap_SetNoTrace(char *name, UInt arity, Term tmod);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* cmppreds.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Int Yap_compare_terms(Term,Term);
|
2013-04-30 00:22:53 +01:00
|
|
|
Int Yap_acmp(Term, Term USES_REGS);
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitCmpPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* compiler.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
yamop *Yap_cclause(Term, Int, Term, Term);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* computils.c */
|
|
|
|
|
|
|
|
/* corout.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitCoroutPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef COROUTINING
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_ListOfWokenGoals(void);
|
|
|
|
void Yap_WakeUp(CELL *);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* dbase.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
struct pred_entry *Yap_FindLUIntKey(Int);
|
|
|
|
int Yap_DBTrailOverflow(void);
|
|
|
|
CELL Yap_EvalMasks(Term,CELL *);
|
|
|
|
void Yap_InitBackDB(void);
|
|
|
|
void Yap_InitDBPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* errors.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_RestartYap(int);
|
|
|
|
void Yap_exit(int);
|
|
|
|
yamop *Yap_Error(yap_error_number,Term,char *msg, ...);
|
|
|
|
yamop *Yap_NilError(yap_error_number,char *msg, ...);
|
2013-12-02 14:49:41 +00:00
|
|
|
int Yap_HandleError( const char *msg, ... );
|
|
|
|
int Yap_SWIHandleError( const char *, ... );
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* eval.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitEval(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* exec.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_ExecuteCallMetaCall(Term);
|
|
|
|
void Yap_InitExecFs(void);
|
|
|
|
Int Yap_JumpToEnv(Term);
|
|
|
|
Term Yap_RunTopGoal(Term);
|
|
|
|
void Yap_ResetExceptionTerm(int);
|
|
|
|
Int Yap_execute_goal(Term, int, Term);
|
|
|
|
Int Yap_exec_absmi(int);
|
|
|
|
void Yap_trust_last(void);
|
|
|
|
Term Yap_GetException(void);
|
|
|
|
void Yap_PrepGoal(UInt, CELL *, choiceptr USES_REGS);
|
2013-11-16 00:27:02 +00:00
|
|
|
int Yap_dogc( int extra_args, Term *tp USES_REGS );
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2013-01-07 09:47:14 +00:00
|
|
|
/* exo.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitExoPreds(void);
|
2013-04-25 20:21:41 +01:00
|
|
|
void Yap_udi_Interval_init(void);
|
2013-01-07 09:47:14 +00:00
|
|
|
|
2013-01-29 10:50:04 +00:00
|
|
|
/* foreign.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
char *Yap_FindExecutable(void);
|
2013-01-29 10:50:04 +00:00
|
|
|
|
2005-12-17 03:25:39 +00:00
|
|
|
/* gprof.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitLowProf(void);
|
2005-12-17 03:25:39 +00:00
|
|
|
#if LOW_PROF
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_inform_profiler_of_clause__(void *,void *,struct pred_entry *, gprof_info);
|
2013-02-08 20:38:04 +00:00
|
|
|
#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
|
2012-03-09 11:46:34 +00:00
|
|
|
#define Yap_inform_profiler_of_clause(CODE0,CODEF,AP,MODE)
|
2005-12-17 03:25:39 +00:00
|
|
|
#endif
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_tell_gprof(yamop *);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2006-08-22 17:12:46 +01:00
|
|
|
/* globals.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_NewArena(UInt,CELL *);
|
|
|
|
CELL *Yap_GetFromArena(Term *,UInt,UInt);
|
|
|
|
void Yap_InitGlobals(void);
|
|
|
|
Term Yap_SaveTerm(Term);
|
|
|
|
Term Yap_SetGlobalVal(Atom, Term);
|
|
|
|
Int Yap_DeleteGlobal(Atom);
|
|
|
|
void Yap_AllocateDefaultArena(Int, Int, int);
|
2006-08-22 17:12:46 +01:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* grow.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Int Yap_total_stack_shift_time(void);
|
|
|
|
void Yap_InitGrowPreds(void);
|
|
|
|
UInt Yap_InsertInGlobal(CELL *, UInt);
|
|
|
|
int Yap_growheap(int, size_t, void *);
|
|
|
|
int Yap_growstack( size_t );
|
|
|
|
int Yap_growtrail(long, int);
|
|
|
|
int Yap_growglobal(CELL **);
|
|
|
|
CELL **Yap_shift_visit(CELL **, CELL ***, CELL ***);
|
2010-01-14 15:58:19 +00:00
|
|
|
#ifdef THREADS
|
2013-04-25 23:15:04 +01:00
|
|
|
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 */
|
2013-04-25 23:15:04 +01:00
|
|
|
Int Yap_total_gc_time(void);
|
|
|
|
void Yap_init_gc(void);
|
|
|
|
int Yap_is_gc_verbose(void);
|
|
|
|
int Yap_gc(Int, CELL *, yamop *);
|
|
|
|
int Yap_gcl(UInt, Int, CELL *, yamop *);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* init.c */
|
|
|
|
#ifdef DEBUG
|
2013-04-25 23:15:04 +01:00
|
|
|
int Yap_DebugPutc(int,wchar_t);
|
|
|
|
void Yap_DebugSetIFile(char *);
|
|
|
|
void Yap_DebugEndline(void);
|
|
|
|
int Yap_DebugGetc(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
2013-04-25 23:15:04 +01:00
|
|
|
int Yap_IsOpType(char *);
|
|
|
|
void Yap_InitCPred(char *, unsigned long int, CPredicate, UInt);
|
|
|
|
void Yap_InitAsmPred(char *, unsigned long int, int, CPredicate, UInt);
|
|
|
|
void Yap_InitCmpPred(char *, unsigned long int, CmpPredicate, UInt);
|
|
|
|
void Yap_InitCPredBack(char *, unsigned long int, unsigned int, CPredicate,CPredicate,UInt);
|
|
|
|
void Yap_InitCPredBackCut(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,UInt);
|
2010-01-28 15:42:49 +00:00
|
|
|
#ifdef CUT_C
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitCPredBack_(char *, unsigned long int, unsigned int, CPredicate,CPredicate,CPredicate,UInt);
|
2005-11-18 18:52:41 +00:00
|
|
|
#endif
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitWorkspace(UInt,UInt,UInt,UInt,UInt,int,int,int);
|
2004-02-19 19:24:46 +00:00
|
|
|
|
2011-05-23 16:19:47 +01:00
|
|
|
#ifdef YAPOR
|
2013-04-25 23:15:04 +01:00
|
|
|
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)
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_KillStacks(int);
|
2004-02-19 19:24:46 +00:00
|
|
|
#else
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_KillStacks(int);
|
2004-02-19 19:24:46 +00:00
|
|
|
#endif
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitYaamRegs(int);
|
|
|
|
void Yap_ReInitWallTime(void);
|
|
|
|
int Yap_OpDec(int,char *,Atom,Term);
|
|
|
|
void Yap_CloseScratchPad(void);
|
2002-11-11 17:38:10 +00:00
|
|
|
|
|
|
|
/* inlines.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitInlines(void);
|
|
|
|
int Yap_eq(Term, Term);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* iopreds.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitBackIO(void);
|
|
|
|
void Yap_InitIOPreds(void);
|
2012-02-18 11:01:06 +00:00
|
|
|
void *Yap_GetStreamHandle(Atom at);
|
|
|
|
void *Yap_GetInputStream(Atom at);
|
|
|
|
void *Yap_GetOutputStream(Atom at);
|
2005-12-05 17:16:12 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
extern void Yap_DebugPlWrite (Term t);
|
|
|
|
extern void Yap_DebugErrorPutc (int n);
|
|
|
|
#endif
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_PlWriteToStream(Term, int, int);
|
2001-04-09 20:54:03 +01:00
|
|
|
/* depth_lim.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitItDeepenPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* load_foreign.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitLoadForeign(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* mavar.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitMaVarCPreds(void);
|
|
|
|
Term Yap_NewTimedVar(Term);
|
|
|
|
Term Yap_NewEmptyTimedVar(void);
|
|
|
|
Term Yap_ReadTimedVar(Term);
|
|
|
|
Term Yap_UpdateTimedVar(Term, Term);
|
2002-11-11 17:38:10 +00:00
|
|
|
|
|
|
|
/* modules.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_Module(Term);
|
|
|
|
Term Yap_Module_Name(struct pred_entry *);
|
|
|
|
struct pred_entry *Yap_ModulePred(Term);
|
|
|
|
void Yap_NewModulePred(Term, struct pred_entry *);
|
|
|
|
Term Yap_StripModule(Term, Term *);
|
|
|
|
void Yap_InitModules(void);
|
|
|
|
void Yap_InitModulesC(void);
|
2013-11-13 10:38:20 +00:00
|
|
|
struct mod_entry *Yap_GetModuleEntry(Term tmod);
|
|
|
|
Term Yap_GetModuleFromEntry(struct mod_entry *me);
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2002-02-11 20:46:41 +00:00
|
|
|
#if HAVE_MPI
|
|
|
|
/* mpi.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
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 */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitMPE(void);
|
2002-10-03 18:29:46 +01:00
|
|
|
#endif
|
|
|
|
|
2002-11-11 17:38:10 +00:00
|
|
|
|
|
|
|
/* other.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_MkApplTerm(Functor,unsigned int,Term *);
|
|
|
|
Term Yap_MkNewApplTerm(Functor,unsigned int);
|
|
|
|
Term Yap_MkNewPairTerm(void);
|
|
|
|
Term Yap_Globalise(Term);
|
2002-11-11 17:38:10 +00:00
|
|
|
|
|
|
|
|
2006-08-02 19:18:31 +01:00
|
|
|
/* readutil.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitReadUtil(void);
|
2006-08-02 19:18:31 +01:00
|
|
|
|
2011-08-03 08:23:00 +01:00
|
|
|
/* qly.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitQLY(void);
|
|
|
|
int Yap_Restore(char *, char *);
|
|
|
|
void Yap_InitQLYR(void);
|
2011-08-03 08:23:00 +01:00
|
|
|
|
2012-10-23 14:55:17 +01:00
|
|
|
/* range.c */
|
|
|
|
void Yap_InitRange(void);
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* save.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
int Yap_SavedInfo(char *,char *,CELL *,CELL *,CELL *);
|
|
|
|
int Yap_SavedStateRestore(char *, char *);
|
|
|
|
struct io_stream *Yap_OpenRestore(char *, char *);
|
|
|
|
void Yap_InitSavePreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* scanner.c */
|
|
|
|
|
2013-02-08 16:36:45 +00:00
|
|
|
/* signals.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_signal(yap_signals);
|
|
|
|
void Yap_undo_signal(yap_signals);
|
|
|
|
void Yap_InitSignalCPreds(void);
|
2013-02-08 16:36:45 +00:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* sort.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitSortPreds(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2013-12-02 14:49:41 +00:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* stdpreds.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitBackCPreds(void);
|
|
|
|
void Yap_InitCPreds(void);
|
|
|
|
void Yap_show_statistics(void);
|
|
|
|
int Yap_IsOpMaxPrio(Atom);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* sysbits.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitPageSize(void);
|
|
|
|
void Yap_set_fpu_exceptions(int);
|
|
|
|
UInt Yap_cputime(void);
|
|
|
|
Int Yap_walltime(void);
|
|
|
|
int Yap_dir_separator(int);
|
|
|
|
int Yap_volume_header(char *);
|
|
|
|
void Yap_InitSysPath(void);
|
|
|
|
int Yap_signal_index(const char *);
|
2008-03-25 22:03:14 +00:00
|
|
|
#ifdef MAC
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_SetTextFile(char *);
|
2002-11-11 17:38:10 +00:00
|
|
|
#endif
|
2013-04-25 23:15:04 +01:00
|
|
|
int Yap_getcwd(const char *, int);
|
|
|
|
void Yap_cputime_interval(Int *,Int *);
|
|
|
|
void Yap_systime_interval(Int *,Int *);
|
|
|
|
void Yap_walltime_interval(Int *,Int *);
|
|
|
|
void Yap_InitSysbits(void);
|
|
|
|
void Yap_InitSysPreds(void);
|
|
|
|
void Yap_InitTime(int);
|
|
|
|
int Yap_TrueFileName(char *, char *, int);
|
|
|
|
double Yap_random(void);
|
2008-03-27 00:41:33 +00:00
|
|
|
#ifdef _WIN32
|
2013-04-25 23:15:04 +01:00
|
|
|
char *Yap_RegistryGetString(char *);
|
|
|
|
void Yap_WinError(char *);
|
2008-03-27 00:41:33 +00:00
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2004-01-23 02:23:51 +00:00
|
|
|
/* threads.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitThreadPreds(void);
|
2013-11-13 10:38:20 +00:00
|
|
|
void Yap_InitFirstWorkerThreadHandle(void);
|
2011-03-11 19:49:32 +00:00
|
|
|
#if THREADS
|
2013-04-25 23:15:04 +01:00
|
|
|
int Yap_InitThread(int);
|
2011-03-11 19:49:32 +00:00
|
|
|
#endif
|
2004-01-23 02:23:51 +00:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* tracer.c */
|
|
|
|
#ifdef LOW_LEVEL_TRACER
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitLowLevelTrace(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
2009-03-27 15:28:50 +00:00
|
|
|
/* udi.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_udi_init(void);
|
|
|
|
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 */
|
2013-04-25 23:15:04 +01:00
|
|
|
int Yap_rational_tree_loop(CELL *, CELL *, CELL **, CELL **);
|
|
|
|
void Yap_InitAbsmi(void);
|
|
|
|
void Yap_InitUnify(void);
|
|
|
|
void Yap_TrimTrail(void);
|
|
|
|
int Yap_Unifiable(Term d0, Term d1);
|
|
|
|
int Yap_IUnify(register CELL d0,register CELL d1);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* userpreds.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitUserCPreds(void);
|
|
|
|
void Yap_InitUserBacks(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
/* utilpreds.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
Term Yap_CopyTerm(Term);
|
|
|
|
int Yap_Variant(Term, Term);
|
|
|
|
size_t Yap_ExportTerm(Term, char *, size_t, UInt);
|
|
|
|
size_t Yap_SizeOfExportedTerm(char *);
|
|
|
|
Term Yap_ImportTerm(char *);
|
|
|
|
int Yap_IsListTerm(Term);
|
|
|
|
int Yap_IsListOrPartialListTerm(Term);
|
|
|
|
Term Yap_CopyTermNoShare(Term);
|
|
|
|
int Yap_SizeGroundTerm(Term, int);
|
|
|
|
int Yap_IsGroundTerm(Term);
|
|
|
|
int Yap_IsAcyclicTerm(Term);
|
|
|
|
void Yap_InitUtilCPreds(void);
|
|
|
|
Int Yap_TermHash(Term, Int, Int, int);
|
|
|
|
Int Yap_NumberVars(Term, Int, int);
|
|
|
|
Term Yap_UnNumberTerm(Term, int);
|
|
|
|
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 */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_plwrite(Term, void *, int, int, int);
|
2013-12-02 14:49:41 +00:00
|
|
|
int Yap_FormatFloat( Float f, const char *s, size_t sz );
|
2011-06-01 17:34:04 +01:00
|
|
|
|
2006-03-09 15:52:06 +00:00
|
|
|
/* MYDDAS */
|
|
|
|
|
2006-03-10 16:58:39 +00:00
|
|
|
#if defined MYDDAS_MYSQL || defined MYDDAS_ODBC
|
|
|
|
|
2006-03-09 15:52:06 +00:00
|
|
|
/* myddas_initialization.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
MYDDAS_GLOBAL myddas_init_initialize_myddas(void);
|
|
|
|
MYDDAS_UTIL_CONNECTION myddas_init_initialize_connection(void *,void *,MYDDAS_UTIL_CONNECTION);
|
|
|
|
MYDDAS_UTIL_PREDICATE myddas_init_initialize_predicate(char *, int, char *,MYDDAS_UTIL_PREDICATE);
|
2006-06-06 15:11:36 +01:00
|
|
|
|
|
|
|
#ifdef MYDDAS_STATS
|
|
|
|
/* myddas_statistics.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
MYDDAS_GLOBAL myddas_stats_initialize_global_stats(MYDDAS_GLOBAL);
|
|
|
|
MYDDAS_STATS_STRUCT myddas_stats_initialize_connection_stats(void);
|
|
|
|
void myddas_stats_delete_stats_list(MYDDAS_STATS_STRUCT);
|
2006-06-06 15:11:36 +01:00
|
|
|
#endif /* MYDDAS_STATS */
|
2006-03-09 15:52:06 +00:00
|
|
|
|
2006-04-24 13:04:21 +01:00
|
|
|
#ifdef MYDDAS_MYSQL
|
2006-03-09 15:52:06 +00:00
|
|
|
/* myddas_util.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void myddas_util_table_write(MYSQL_RES *);
|
2006-04-24 13:04:21 +01:00
|
|
|
#endif
|
2013-04-25 23:15:04 +01:00
|
|
|
Short myddas_util_connection_type(void *);
|
|
|
|
MYDDAS_UTIL_CONNECTION myddas_util_add_connection(void *,void *);
|
|
|
|
MYDDAS_UTIL_CONNECTION myddas_util_search_connection(void *);
|
|
|
|
void myddas_util_delete_connection(void *);
|
|
|
|
MYDDAS_UTIL_CONNECTION myddas_util_add_predicate(char * ,Int , char *,void *);
|
|
|
|
MYDDAS_UTIL_PREDICATE myddas_util_search_predicate(char * ,Int , char *);
|
|
|
|
void myddas_util_delete_predicate(MYDDAS_UTIL_PREDICATE);
|
2006-03-09 15:52:06 +00:00
|
|
|
|
|
|
|
/* Get's the number of queries to save */
|
2013-04-25 23:15:04 +01:00
|
|
|
UInt myddas_util_get_total_multi_queries_number(MYDDAS_UTIL_CONNECTION);
|
|
|
|
void myddas_util_set_total_multi_queries_number(MYDDAS_UTIL_CONNECTION,UInt);
|
2006-03-09 15:52:06 +00:00
|
|
|
#ifdef MYDDAS_ODBC
|
|
|
|
/* Return enviromment identifier*/
|
2013-04-25 23:15:04 +01:00
|
|
|
SQLHENV myddas_util_get_odbc_enviromment(SQLHDBC);
|
2006-03-09 15:52:06 +00:00
|
|
|
#endif
|
|
|
|
|
2013-04-25 23:15:04 +01:00
|
|
|
void * myddas_util_get_list_pred(MYDDAS_UTIL_CONNECTION);
|
|
|
|
void * myddas_util_get_pred_next(void *);
|
|
|
|
char * myddas_util_get_pred_module(void *);
|
|
|
|
char * myddas_util_get_pred_name(void *);
|
|
|
|
MyddasInt myddas_util_get_pred_arity(void *);
|
2006-03-09 15:52:06 +00:00
|
|
|
//DELETE THIS WHEN DB_STATS IS COMPLETED
|
2013-04-25 23:15:04 +01:00
|
|
|
MyddasInt get_myddas_top(void);
|
2006-03-09 15:52:06 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
void check_int(void);
|
|
|
|
#endif
|
|
|
|
|
2006-03-10 16:58:39 +00:00
|
|
|
#endif /* MYDDAS_MYSQL || MYDDAS_ODBC */
|
|
|
|
|
2006-03-09 15:52:06 +00:00
|
|
|
/* myddas_mysql.c */
|
|
|
|
#if defined MYDDAS_MYSQL
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitMYDDAS_MySQLPreds(void);
|
|
|
|
void Yap_InitBackMYDDAS_MySQLPreds(void);
|
2005-11-22 11:25:59 +00:00
|
|
|
#endif
|
2006-03-09 15:52:06 +00:00
|
|
|
|
|
|
|
/* myddas_odbc.c */
|
|
|
|
#if defined MYDDAS_ODBC
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitMYDDAS_ODBCPreds(void);
|
|
|
|
void Yap_InitBackMYDDAS_ODBCPreds(void);
|
2005-11-22 11:25:59 +00:00
|
|
|
#endif
|
2006-03-09 15:52:06 +00:00
|
|
|
|
|
|
|
/* myddas_shared.c */
|
|
|
|
#if defined MYDDAS_ODBC || defined MYDDAS_MYSQL
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_MYDDAS_delete_all_myddas_structs(void);
|
|
|
|
void Yap_InitMYDDAS_SharedPreds(void);
|
|
|
|
void Yap_InitBackMYDDAS_SharedPreds(void);
|
2005-11-22 11:25:59 +00:00
|
|
|
#endif
|
2006-03-09 15:52:06 +00:00
|
|
|
|
|
|
|
/* myddas_top_level.c */
|
2006-02-05 02:19:15 +00:00
|
|
|
#if defined MYDDAS_TOP_LEVEL && defined MYDDAS_MYSQL //&& defined HAVE_LIBREADLINE
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_InitMYDDAS_TopLevelPreds(void);
|
2006-02-05 02:19:15 +00:00
|
|
|
#endif
|
2005-11-18 18:52:41 +00:00
|
|
|
|
2007-10-18 09:24:16 +01:00
|
|
|
/* yap2swi.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
void Yap_swi_install(void);
|
|
|
|
void Yap_InitSWIHash(void);
|
|
|
|
int Yap_get_stream_handle(Term, int, int, void *);
|
|
|
|
Term Yap_get_stream_position(void *);
|
2007-10-18 09:24:16 +01:00
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
/* opt.preds.c */
|
2013-04-25 23:15:04 +01:00
|
|
|
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 */
|
|
|
|
struct PL_local_data *Yap_InitThreadIO(int wid);
|
2012-04-12 23:52:25 +01:00
|
|
|
void Yap_flush(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2013-11-05 17:59:19 +00:00
|
|
|
/* pl-yap.c */
|
|
|
|
Int Yap_source_line_no( void );
|
|
|
|
Atom Yap_source_file_name( void );
|
|
|
|
|
2008-08-28 04:43:00 +01:00
|
|
|
static inline
|
|
|
|
yamop *
|
|
|
|
gc_P(yamop *p, yamop *cp)
|
|
|
|
{
|
|
|
|
return (p->opc == Yap_opcode(_execute_cpred) ? cp : p);
|
|
|
|
}
|
2011-08-03 08:23:00 +01:00
|
|
|
|
|
|
|
|