YAP 7.1.0
YapInterface.h File Reference
#include "YapConfig.h"
#include "YapDefs.h"
#include <wchar.h>
#include "YapFormat.h"

Go to the source code of this file.


#define __YAP_PROLOG__   1
#define __BEGIN_DECLS   /* empty */
#define __END_DECLS   /* empty */
#define YAP_Deref(t)   (t)
 X_API macro. More...
#define YAP_ARG1   YAP_A(1)
#define YAP_ARG2   YAP_A(2)
#define YAP_ARG3   YAP_A(3)
#define YAP_ARG4   YAP_A(4)
#define YAP_ARG5   YAP_A(5)
#define YAP_ARG6   YAP_A(6)
#define YAP_ARG7   YAP_A(7)
#define YAP_ARG8   YAP_A(8)
#define YAP_ARG9   YAP_A(9)
#define YAP_ARG10   YAP_A(10)
#define YAP_ARG11   YAP_A(11)
#define YAP_ARG12   YAP_A(12)
#define YAP_ARG13   YAP_A(13)
#define YAP_ARG14   YAP_A(14)
#define YAP_ARG15   YAP_A(15)
#define YAP_ARG16   YAP_A(16)
#define YAP_PRESERVE_DATA(ptr, type)   (ptr = (type *)YAP_ExtraSpace())
#define YAP_PRESERVED_DATA(ptr, type)   (ptr = (type *)YAP_ExtraSpace())
#define YAP_PRESERVED_DATA_CUT(ptr, type)   (ptr = (type *)YAP_ExtraSpaceCut())
#define YAP_cut_succeed()
#define YAP_cut_fail()
#define YAP_Error(id, inp, ...)    YAP_Error__( __FILE__, __FUNCTION__, __LINE__, id, inp, __VA_ARGS__)
#define IOSTREAM   void
#define YAP_LookupModule(T)   (T)
#define YAP_ModuleName(mod)   (mod)
#define YAP_InitCPred(N, A, F)   YAP_UserCPredicate(N, F, A)
#define YAP_MkPointerTerm(ptr)   YAP_MkIntTerm((YAP_Int)(ptr))


X_API YAP_Term YAP_A (int)
X_API YAP_Term YAP_SetA (int, YAP_Term)
X_API YAP_Bool YAP_IsVarTerm (YAP_Term)
X_API YAP_Bool YAP_IsNonVarTerm (YAP_Term)
X_API YAP_Term YAP_MkVarTerm (void)
X_API YAP_Bool YAP_IsIntTerm (YAP_Term)
X_API YAP_Bool YAP_IsLongIntTerm (YAP_Term)
X_API YAP_Bool YAP_IsBigNumTerm (YAP_Term)
X_API YAP_Bool YAP_IsRationalTerm (YAP_Term)
X_API YAP_Bool YAP_IsFloatTerm (YAP_Term)
X_API YAP_Bool YAP_IsNumberTerm (YAP_Term)
X_API YAP_Bool YAP_IsDbRefTerm (YAP_Term)
X_API YAP_Bool YAP_IsAtomTerm (YAP_Term)
X_API YAP_Bool YAP_IsStringTerm (YAP_Term)
X_API YAP_Bool YAP_IsPairTerm (YAP_Term)
X_API YAP_Bool YAP_IsApplTerm (YAP_Term)
X_API YAP_Bool YAP_IsCompoundTerm (YAP_Term)
X_API YAP_Term YAP_MkIntTerm (YAP_Int)
X_API YAP_Term YAP_MkStringTerm (const char *)
X_API YAP_Term YAP_MkUnsignedStringTerm (const unsigned char *)
X_API YAP_Term YAP_MkBigNumTerm (void *)
X_API YAP_Term YAP_MkRationalTerm (void *)
X_API const unsigned char * YAP_UnsignedStringOfTerm (YAP_Term)
X_API const char * YAP_StringOfTerm (YAP_Term)
X_API YAP_Int YAP_IntOfTerm (YAP_Term)
X_API YAP_Bool YAP_BigNumOfTerm (YAP_Term t, void *b)
X_API YAP_Bool YAP_RationalOfTerm (YAP_Term, void *)
X_API YAP_Term YAP_MkFloatTerm (YAP_Float)
X_API YAP_Float YAP_FloatOfTerm (YAP_Term)
X_API YAP_Term YAP_MkAtomTerm (YAP_Atom)
X_API YAP_Atom YAP_AtomOfTerm (YAP_Term)
X_API YAP_Atom YAP_LookupAtom (const char *c)
X_API YAP_Atom YAP_LookupWideAtom (const wchar_t *c)
X_API YAP_Atom YAP_FullLookupAtom (const char *c)
X_API size_t YAP_AtomNameLength (YAP_Atom)
X_API YAP_Bool YAP_IsWideAtom (YAP_Atom a)
X_API const char * YAP_AtomName (YAP_Atom a)
X_API const wchar_t * YAP_WideAtomName (YAP_Atom a)
X_API YAP_Term YAP_MkPairTerm (YAP_Term, YAP_Term)
X_API YAP_Term YAP_MkListFromTerms (YAP_Term *, YAP_Int)
X_API YAP_Term YAP_MkNewPairTerm (void)
X_API YAP_Term YAP_HeadOfTerm (YAP_Term)
X_API YAP_Term YAP_TailOfTerm (YAP_Term)
X_API YAP_Int YAP_SkipList (YAP_Term *, YAP_Term **)
X_API YAP_Term YAP_TermNil (void)
X_API int YAP_IsTermNil (YAP_Term)
X_API YAP_Term YAP_MkApplTerm (YAP_Functor functor, YAP_UInt arity, YAP_Term args[])
X_API YAP_Term YAP_MkNewApplTerm (YAP_Functor f, YAP_UInt arity)
X_API YAP_Functor YAP_FunctorOfTerm (YAP_Term t)
X_API YAP_Term YAP_ArgOfTerm (YAP_UInt n, YAP_Term t)
X_API YAP_Term * YAP_ArgsOfTerm (YAP_Term t)
X_API YAP_Functor YAP_MkFunctor (YAP_Atom a, YAP_UInt n)
X_API YAP_Atom YAP_NameOfFunctor (YAP_Functor g)
X_API YAP_UInt YAP_ArityOfFunctor (YAP_Functor f)
X_API void * YAP_ExtraSpace (void)
X_API void * YAP_ExtraSpaceCut (void)
X_API YAP_Bool YAP_Unify (YAP_Term t1, YAP_Term t2)
X_API void YAP_UserCPredicate (const char *, YAP_UserCPred, YAP_Arity arity)
X_API void YAP_UserCPredicateWithArgs (const char *, YAP_UserCPred, YAP_Arity, YAP_Term)
X_API void YAP_UserBackCPredicate (const char *, YAP_UserCPred, YAP_UserCPred, YAP_Arity, YAP_Arity)
X_API void YAP_UserBackCutCPredicate (const char *name, YAP_UserCPred, YAP_UserCPred, YAP_UserCPred, YAP_Arity, YAP_Arity)
X_API YAP_Int YAP_ListLength (YAP_Term)
X_API size_t YAP_UTF8_TextLength (YAP_Term t)
X_API YAP_Int YAP_CallProlog (YAP_Term t)
X_API void YAP_cut_up (void)
X_API void * YAP_AllocSpaceFromYap (size_t)
X_API void * YAP_ReallocSpaceFromYap (void *, size_t)
X_API void YAP_FreeSpaceFromYap (void *)
X_API YAP_Int YAP_RunGoal (YAP_Term)
X_API YAP_Int YAP_RunGoalOnce (YAP_Term)
X_API YAP_Bool YAP_RestartGoal (void)
X_API YAP_Bool YAP_ShutdownGoal (int)
X_API YAP_Bool YAP_ContinueGoal (void)
X_API void YAP_PruneGoal (YAP_dogoalinfo *)
X_API YAP_PredEntryPtr YAP_FunctorToPred (YAP_Functor)
X_API YAP_PredEntryPtr YAP_AtomToPred (YAP_Atom)
X_API YAP_PredEntryPtr YAP_FunctorToPredInModule (YAP_Functor, YAP_Module)
X_API YAP_PredEntryPtr YAP_AtomToPredInModule (YAP_Atom, YAP_Module)
X_API YAP_Bool YAP_EnterGoal (YAP_PredEntryPtr, YAP_Term *, YAP_dogoalinfo *)
X_API YAP_Bool YAP_RetryGoal (YAP_dogoalinfo *)
X_API YAP_Bool YAP_LeaveGoal (bool, YAP_dogoalinfo *)
X_API YAP_Bool YAP_GoalHasException (YAP_Term *)
X_API void YAP_ClearExceptions (void)
X_API int YAP_Reset (yap_reset_t reset, bool reset_global)
X_API void YAP_Error__ (const char *f, const char *fn, int pos, int myerrno, YAP_Term t, const char *buf,...)
X_API char * YAP_WriteBuffer (YAP_Term, char *, size_t, int)
X_API char * YAP_WriteDynamicBuffer (YAP_Term t, YAP_encoding_t enc, int flags)
 write a a term to n user-provided buffer: make sure not tp overflow the buffer even if the text is much larger More...
X_API YAP_Term YAP_CopyTerm (YAP_Term t)
X_API bool YAP_CompileClause (YAP_Term Cl)
X_API int YAP_NewExo (YAP_PredEntryPtr ap, size_t data, void *user_di)
X_API int YAP_AssertTuples (YAP_PredEntryPtr pred, const YAP_Term *ts, size_t offset, size_t sz)
X_API void YAP_Init (YAP_init_args *)
X_API void YAP_FastInit (char saved_state[], int argc, char *argv[])
X_API YAP_Term YAP_Read (FILE *s)
 read a Prolog term from an operating system stream $s$ More...
X_API YAP_Term YAP_ReadFromStream (int s)
 read a Prolog term from a Prolog opened stream $s$ More...
X_API YAP_Term YAP_ReadClauseFromStream (int s, YAP_Term varNames, YAP_Term)
 read a Prolog clause from a Prolog opened stream $s$ More...
X_API void YAP_Write (YAP_Term t, FILE *s, int)
X_API FILE * YAP_TermToStream (YAP_Term t)
X_API int YAP_InitConsult (int mode, const char *filename, char *buf, int *previous_sno)
X_API void YAP_EndConsult (int s, int *previous_sno, const char *previous_cwd)
X_API void YAP_Exit (int)
X_API void YAP_PutValue (YAP_Atom, YAP_Term)
X_API YAP_Term YAP_GetValue (YAP_Atom)
X_API YAP_Term YAP_FloatsToList (YAP_Float *, size_t)
X_API YAP_Int YAP_ListToFloats (YAP_Term, YAP_Float *, size_t)
X_API YAP_Term YAP_IntsToList (YAP_Int *, size_t)
X_API YAP_Int YAP_ListToInts (YAP_Term, YAP_Int *, size_t)
X_API char * YAP_StringToBuffer (YAP_Term, char *, unsigned int)
X_API YAP_Term YAP_BufferToString (const char *s)
X_API YAP_Term YAP_NBufferToString (const char *s, size_t len)
X_API YAP_Term YAP_WideBufferToString (const wchar_t *)
X_API YAP_Term YAP_NWideBufferToString (const wchar_t *s, size_t len)
X_API YAP_Term YAP_BufferToAtomList (const char *s)
X_API YAP_Term YAP_NBufferToAtomList (const char *s, size_t len)
X_API YAP_Term YAP_WideBufferToAtomList (const wchar_t *s)
X_API YAP_Term YAP_NWideBufferToAtomList (const wchar_t *s, size_t len)
X_API YAP_Term YAP_NWideBufferToAtomDiffList (const wchar_t *s, YAP_Term t0, size_t len)
X_API YAP_Term YAP_BufferToDiffList (const char *s, YAP_Term t0)
X_API YAP_Term YAP_NBufferToDiffList (const char *s, YAP_Term t0, size_t len)
X_API YAP_Term YAP_WideBufferToDiffList (const wchar_t *s, YAP_Term t0)
X_API YAP_Term YAP_NWideBufferToDiffList (const wchar_t *s, YAP_Term t0, size_t len)
X_API YAP_Term YAP_ReadBuffer (const char *s, YAP_Term *tp)
X_API int YAP_InitSocks (const char *host, long port)
X_API void YAP_SetOutputMessage (void)
X_API int YAP_StreamToFileNo (YAP_Term)
X_API void * YAP_RepStreamFromId (int sno)
 Utility routine to Obtain a pointer to the YAP representation of a stream. More...
X_API void YAP_CloseAllOpenStreams (void)
X_API void YAP_FlushAllStreams (void)
X_API void YAP_StartSlots (void)
 initialize the slot data-structure: all existing slots will be discarded More...
X_API void YAP_EndSlots (void)
 discard all existing slots: operates as More...
X_API YAP_handle_t YAP_NewSlots (int)
X_API YAP_handle_t YAP_CurrentSlot (void)
 report the current position of the slots, assuming that they occupy the top of the stack More...
X_API YAP_handle_t YAP_InitSlot (YAP_Term)
X_API YAP_Term YAP_GetFromSlot (YAP_handle_t)
 read from a slot More...
X_API YAP_Term * YAP_AddressFromSlot (YAP_handle_t)
 get the memory address of a slot More...
X_API YAP_Term * YAP_AddressOfTermInSlot (YAP_handle_t)
 get the memory address of the term actually stored in a slot More...
X_API void YAP_PutInSlot (YAP_handle_t, YAP_Term)
X_API int YAP_RecoverSlots (int n, YAP_handle_t top_slot)
 Succeeds if it recovers the space allocated for $n$ contiguous slots starting at topSlot. More...
X_API YAP_handle_t YAP_ArgsToSlots (int)
 copies the first new n YAAM registers to slots More...
X_API void YAP_SlotsToArgs (int, YAP_handle_t)
X_API void YAP_Throw (YAP_Term)
X_API void YAP_AsyncThrow (YAP_Term)
X_API void YAP_Halt (int)
X_API YAP_Term * YAP_TopOfLocalStack (void)
X_API void * YAP_Predicate (YAP_Atom, YAP_Arity, YAP_Term)
X_API void YAP_PredicateInfo (void *, YAP_Atom *, YAP_Arity *, YAP_Module *)
X_API YAP_Module YAP_CurrentModule (void)
X_API YAP_Module YAP_SetCurrentModule (YAP_Module)
X_API YAP_Module YAP_CreateModule (YAP_Atom)
X_API YAP_Term YAP_StripModule (YAP_Term, YAP_Module *)
X_API int YAP_AtomGetHold (YAP_Atom)
X_API int YAP_AtomReleaseHold (YAP_Atom)
X_API YAP_agc_hook YAP_AGCRegisterHook (YAP_agc_hook hook)
X_API int YAP_HaltRegisterHook (YAP_halt_hook, void *)
X_API char * YAP_cwd (void)
X_API int YAP_ThreadSelf (void)
X_API int YAP_ThreadCreateEngine (YAP_thread_attr *attr)
X_API int YAP_ThreadAttachEngine (int)
X_API int YAP_ThreadDetachEngine (int)
X_API int YAP_ThreadDestroyEngine (int)
X_API YAP_Term YAP_MkBlobTerm (unsigned int)
X_API void * YAP_BlobOfTerm (YAP_Term)
X_API int YAP_CompareTerms (YAP_Term, YAP_Term)
X_API YAP_Term YAP_OpenList (int)
X_API YAP_Term YAP_ExtendList (YAP_Term, YAP_Term)
X_API int YAP_CloseList (YAP_Term, YAP_Term)
X_API int YAP_IsAttVar (YAP_Term)
X_API YAP_Term YAP_AttsOfVar (YAP_Term)
X_API void * YAP_FileDescriptorFromStream (YAP_Term)
X_API int YAP_FileNoFromStream (YAP_Term)
X_API void * YAP_Record (YAP_Term)
X_API YAP_Term YAP_Recorded (void *)
X_API int YAP_Erase (void *)
X_API int YAP_Variant (YAP_Term, YAP_Term)
X_API YAP_Int YAP_NumberVars (YAP_Term, YAP_Int)
X_API YAP_Term YAP_UnNumberVars (YAP_Term)
X_API int YAP_IsNumberedVariable (YAP_Term)
X_API int YAP_Unifiable (YAP_Term, YAP_Term)
X_API int YAP_ExactlyEqual (YAP_Term, YAP_Term)
X_API YAP_Int YAP_TermHash (YAP_Term, YAP_Int, YAP_Int, int)
X_API void YAP_signal (int)
X_API YAP_Term YAP_GetYAPFlag (YAP_Term flag)
X_API int YAP_SetYAPFlag (YAP_Term flag, YAP_Term set)
X_API YAP_Int YAP_VarSlotToNumber (YAP_Int)
X_API YAP_Term YAP_ModuleUser (void)
X_API YAP_Int YAP_NumberOfClausesForPredicate (YAP_PredEntryPtr)
X_API int YAP_MaxOpPriority (YAP_Atom, YAP_Term)
X_API int YAP_OpInfo (YAP_Atom, YAP_Term, int, int *, int *)
X_API YAP_Bool YAP_IsExternalDataInStackTerm (YAP_Term)
X_API YAP_Term YAP_AllocExternalDataInStack (size_t bytes)
X_API void * YAP_ExternalDataInStackFromTerm (YAP_Term t)
X_API YAP_opaque_tag_t YAP_NewOpaqueType (struct YAP_opaque_handler_struct *f)
X_API YAP_Bool YAP_IsOpaqueObjectTerm (YAP_Term t, YAP_opaque_tag_t tag)
X_API YAP_Term YAP_NewOpaqueObject (YAP_opaque_tag_t tag, size_t bytes)
X_API void * YAP_OpaqueObjectFromTerm (YAP_Term t)
X_API YAP_CELL * YAP_HeapStoreOpaqueTerm (YAP_Term t)
X_API int YAP_Argv (char ***)
X_API bool YAP_DelayInit (YAP_ModInit_t f, const char s[])
 YAP_DelayInit() More...
X_API YAP_tag_t YAP_TagOfTerm (YAP_Term)
X_API size_t YAP_ExportTerm (YAP_Term, char *, size_t)
X_API size_t YAP_SizeOfExportedTerm (char *)
X_API YAP_Term YAP_ImportTerm (char *)
X_API int YAP_RequiresExtraStack (size_t)
X_API YAP_file_type_t YAP_parse_yap_arguments (int argc, char *argv[], YAP_init_args *iap)
 YAP_parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap) More...
X_API void * YAP_foreign_stream (int sno)
X_API YAP_Int YAP_AtomToInt (YAP_Atom At)
X_API YAP_Atom YAP_IntToAtom (YAP_Int i)
X_API YAP_Int YAP_FunctorToInt (YAP_Functor At)
X_API YAP_Functor YAP_IntToFunctor (YAP_Int i)
X_API YAP_PredEntryPtr YAP_TopGoal (void)
X_API void * YAP_GetStreamFromId (int no)
 given a stream descriptor or stream alias (see open/3 ), return YAP's internal handle More...
X_API void * YAP_PointerOfTerm (YAP_Term t)
X_API void * YAP_FetchArray (YAP_Term t1, intptr_t *sz, int *type)