YAP 7.1.0
Term Handles or Slots

Term handles correspond to SWI-Prolog's term_t datatype: they are a safe representation of terms. More...

Detailed Description

Term handles correspond to SWI-Prolog's term_t datatype: they are a safe representation of terms.

Slots are safe houses in the stack, the garbage collector and the stack shifter know about them and make sure they have correct values In this case, we use a slot to preserve t during the execution of YAP_RunGoal) When the execution of t is over we read the (possibly changed) value of t back from the slot sl and tell YAP that the slot sl is not needed and can be given back to the system

YAP supports storing and manipulating term_t like slots or handles, but in the C the programmer needs to take care as most operations still require unwrapping the term inside

For implementation details and more information, please check term_t_slots in the implementation section

Macro Definition Documentation

◆ FRG_REDO_BITS

#define FRG_REDO_BITS   2

Definition at line 1175 of file c_interface.c.

◆ FRG_REDO_MASK

#define FRG_REDO_MASK   0x00000003L

Definition at line 1174 of file c_interface.c.

◆ REDO_INT

#define REDO_INT   0x02 /* Returned an integer */

Definition at line 1176 of file c_interface.c.

◆ REDO_PTR

#define REDO_PTR   0x03 /* returned a pointer */

Definition at line 1177 of file c_interface.c.

Typedef Documentation

◆ CBPredicate0

typedef uintptr_t(* CBPredicate0) (struct foreign_context *)

Definition at line 978 of file c_interface.c.

◆ CBPredicate1

typedef uintptr_t(* CBPredicate1) (yhandle_t, struct foreign_context *)

Definition at line 980 of file c_interface.c.

◆ CBPredicate10

typedef uintptr_t(* CBPredicate10) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 1010 of file c_interface.c.

◆ CBPredicate2

typedef uintptr_t(* CBPredicate2) (yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 982 of file c_interface.c.

◆ CBPredicate3

typedef uintptr_t(* CBPredicate3) (yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 985 of file c_interface.c.

◆ CBPredicate4

typedef uintptr_t(* CBPredicate4) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 988 of file c_interface.c.

◆ CBPredicate5

typedef uintptr_t(* CBPredicate5) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 991 of file c_interface.c.

◆ CBPredicate6

typedef uintptr_t(* CBPredicate6) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 994 of file c_interface.c.

◆ CBPredicate7

typedef uintptr_t(* CBPredicate7) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 998 of file c_interface.c.

◆ CBPredicate8

typedef uintptr_t(* CBPredicate8) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 1002 of file c_interface.c.

◆ CBPredicate9

typedef uintptr_t(* CBPredicate9) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 1006 of file c_interface.c.

◆ CPredicate0

typedef Int(* CPredicate0) (void)

Definition at line 876 of file c_interface.c.

◆ CPredicate1

typedef Int(* CPredicate1) (yhandle_t)

Definition at line 878 of file c_interface.c.

◆ CPredicate10

typedef Int(* CPredicate10) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)

Definition at line 902 of file c_interface.c.

◆ CPredicate2

typedef Int(* CPredicate2) (yhandle_t, yhandle_t)

Definition at line 880 of file c_interface.c.

◆ CPredicate3

typedef Int(* CPredicate3) (yhandle_t, yhandle_t, yhandle_t)

Definition at line 882 of file c_interface.c.

◆ CPredicate4

typedef Int(* CPredicate4) (yhandle_t, yhandle_t, yhandle_t, yhandle_t)

Definition at line 884 of file c_interface.c.

◆ CPredicate5

typedef Int(* CPredicate5) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)

Definition at line 886 of file c_interface.c.

◆ CPredicate6

typedef Int(* CPredicate6) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)

Definition at line 889 of file c_interface.c.

◆ CPredicate7

typedef Int(* CPredicate7) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)

Definition at line 892 of file c_interface.c.

◆ CPredicate8

typedef Int(* CPredicate8) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)

Definition at line 895 of file c_interface.c.

◆ CPredicate9

typedef Int(* CPredicate9) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)

Definition at line 898 of file c_interface.c.

◆ CPredicateV

typedef Int(* CPredicateV) (yhandle_t, yhandle_t, struct foreign_context *)

Definition at line 906 of file c_interface.c.

Function Documentation

◆ YAP_A()

X_API YAP_Term YAP_A ( int  i)

Definition at line 231 of file c_interface.c.

◆ YAP_AddressFromSlot()

X_API Term * YAP_AddressFromSlot ( YAP_handle_t  slot)

get the memory address of a slot

Return the address of slot slot: please use with care

Definition at line 850 of file c_interface.c.

◆ YAP_AddressOfTermInSlot()

X_API Term * YAP_AddressOfTermInSlot ( YAP_handle_t  slot)

get the memory address of the term actually stored in a slot

Definition at line 855 of file c_interface.c.

◆ YAP_AGCRegisterHook()

X_API YAP_agc_hook YAP_AGCRegisterHook ( YAP_agc_hook  hook)

Definition at line 2558 of file c_interface.c.

◆ YAP_AllocExternalDataInStack()

X_API Term YAP_AllocExternalDataInStack ( size_t  bytes)

Definition at line 1882 of file c_interface.c.

◆ YAP_AllocSpaceFromYap()

X_API void * YAP_AllocSpaceFromYap ( size_t  size)

Definition at line 1335 of file c_interface.c.

◆ YAP_ArgOfTerm()

X_API Term YAP_ArgOfTerm ( UInt  n,
Term  t 
)

Definition at line 683 of file c_interface.c.

◆ YAP_ArgsOfTerm()

X_API Term * YAP_ArgsOfTerm ( Term  t)

Definition at line 685 of file c_interface.c.

◆ YAP_ArgsToSlots()

X_API yhandle_t YAP_ArgsToSlots ( int  HowMany)

copies the first new n YAAM registers to slots

Store the current first HowMany arguments in new slots

Definition at line 2850 of file c_interface.c.

◆ YAP_Argv()

X_API int YAP_Argv ( char ***  argvp)

Definition at line 2966 of file c_interface.c.

◆ YAP_ArityOfFunctor()

X_API UInt YAP_ArityOfFunctor ( YAP_Functor  f)

Definition at line 699 of file c_interface.c.

◆ YAP_AsyncThrow()

X_API void YAP_AsyncThrow ( Term  t)

Definition at line 2411 of file c_interface.c.

◆ YAP_AtomGetHold()

X_API int YAP_AtomGetHold ( YAP_Atom  at)

Definition at line 2554 of file c_interface.c.

◆ YAP_AtomName()

X_API const char * YAP_AtomName ( YAP_Atom  a)

Definition at line 452 of file c_interface.c.

◆ YAP_AtomNameLength()

X_API size_t YAP_AtomNameLength ( YAP_Atom  at)

Definition at line 528 of file c_interface.c.

◆ YAP_AtomOfTerm()

X_API YAP_Atom YAP_AtomOfTerm ( Term  t)

Definition at line 439 of file c_interface.c.

◆ YAP_AtomReleaseHold()

X_API int YAP_AtomReleaseHold ( YAP_Atom  at)

Definition at line 2556 of file c_interface.c.

◆ YAP_AtomToInt()

X_API Int YAP_AtomToInt ( YAP_Atom  At)

Definition at line 3145 of file c_interface.c.

◆ YAP_AtomToPred()

X_API YAP_PredEntryPtr YAP_AtomToPred ( YAP_Atom  at)

Definition at line 1714 of file c_interface.c.

◆ YAP_AtomToPredInModule()

X_API YAP_PredEntryPtr YAP_AtomToPredInModule ( YAP_Atom  at,
Term  mod 
)

Definition at line 1723 of file c_interface.c.

◆ YAP_AttsOfVar()

X_API Term YAP_AttsOfVar ( Term  t)

Definition at line 2748 of file c_interface.c.

◆ YAP_BigNumOfTerm()

X_API YAP_Bool YAP_BigNumOfTerm ( Term  t,
void *  b 
)

Definition at line 355 of file c_interface.c.

◆ YAP_BlobOfTerm()

X_API void * YAP_BlobOfTerm ( Term  t)

Definition at line 409 of file c_interface.c.

◆ YAP_BufferToAtomList()

X_API YAP_Term YAP_BufferToAtomList ( const char *  s)

Definition at line 1511 of file c_interface.c.

◆ YAP_BufferToDiffList()

X_API Term YAP_BufferToDiffList ( const char *  s,
Term  t0 
)

Definition at line 1607 of file c_interface.c.

◆ YAP_BufferToString()

X_API Term YAP_BufferToString ( const char *  s)

Definition at line 1389 of file c_interface.c.

◆ YAP_ClearExceptions()

X_API void YAP_ClearExceptions ( void  )

Definition at line 2118 of file c_interface.c.

◆ YAP_CloseAllOpenStreams()

X_API void YAP_CloseAllOpenStreams ( void  )

Definition at line 2389 of file c_interface.c.

◆ YAP_CloseList()

X_API int YAP_CloseList ( Term  t0,
Term  tail 
)

Definition at line 2731 of file c_interface.c.

◆ YAP_CompareTerms()

X_API int YAP_CompareTerms ( Term  t1,
Term  t2 
)

Definition at line 2358 of file c_interface.c.

◆ YAP_CompileClause()

X_API bool YAP_CompileClause ( Term  t)

Definition at line 2315 of file c_interface.c.

◆ YAP_ContinueGoal()

X_API bool YAP_ContinueGoal ( void  )

Definition at line 2079 of file c_interface.c.

◆ YAP_CopyTerm()

X_API YAP_Term YAP_CopyTerm ( Term  t)

Definition at line 2260 of file c_interface.c.

◆ YAP_CreateModule()

X_API Term YAP_CreateModule ( YAP_Atom  at)

Definition at line 2498 of file c_interface.c.

◆ YAP_CurrentModule()

X_API Term YAP_CurrentModule ( void  )

Definition at line 2486 of file c_interface.c.

◆ YAP_CurrentSlot()

X_API Int YAP_CurrentSlot ( void  )

report the current position of the slots, assuming that they occupy the top of the stack

Definition at line 825 of file c_interface.c.

◆ YAP_cut_up()

X_API void YAP_cut_up ( void  )

Definition at line 733 of file c_interface.c.

◆ YAP_cwd()

X_API char * YAP_cwd ( void  )

Definition at line 2568 of file c_interface.c.

◆ YAP_EndConsult()

X_API void YAP_EndConsult ( int  sno,
int *  osnop,
const char *  full 
)

Definition at line 2188 of file c_interface.c.

◆ YAP_EndSlots()

X_API void YAP_EndSlots ( void  )

discard all existing slots: operates as

StartSlots, but should be called when we're done

Definition at line 151 of file c_interface.c.

◆ YAP_EnterGoal()

X_API bool YAP_EnterGoal ( YAP_PredEntryPtr  ape,
CELL *  ptr,
YAP_dogoalinfo dgi 
)

Definition at line 1737 of file c_interface.c.

◆ YAP_Erase()

X_API int YAP_Erase ( void *  handle)

Definition at line 2836 of file c_interface.c.

◆ YAP_Error__()

X_API void YAP_Error__ ( const char *  file,
const char *  function,
int  lineno,
int  myerrno,
Term  t,
const char *  buf,
  ... 
)

Definition at line 1686 of file c_interface.c.

◆ YAP_ExactlyEqual()

X_API int YAP_ExactlyEqual ( Term  t1,
Term  t2 
)

Definition at line 792 of file c_interface.c.

◆ YAP_Execute()

X_API Int YAP_Execute ( PredEntry pe,
CPredicate  exec_code 
)

Definition at line 1131 of file c_interface.c.

◆ YAP_ExecuteFirst()

X_API Int YAP_ExecuteFirst ( PredEntry pe,
CPredicate  exec_code 
)

Definition at line 1179 of file c_interface.c.

◆ YAP_ExecuteNext()

X_API Int YAP_ExecuteNext ( PredEntry pe,
CPredicate  exec_code 
)

Definition at line 1275 of file c_interface.c.

◆ YAP_ExecuteOnCut()

X_API Int YAP_ExecuteOnCut ( PredEntry pe,
CPredicate  exec_code,
struct cut_c_str top 
)

Definition at line 1227 of file c_interface.c.

◆ YAP_Exit()

X_API void YAP_Exit ( int  retval)

Definition at line 2370 of file c_interface.c.

◆ YAP_ExportTerm()

X_API size_t YAP_ExportTerm ( Term  inp,
char *  buf,
size_t  len 
)

Definition at line 3100 of file c_interface.c.

◆ YAP_ExtendList()

X_API Term YAP_ExtendList ( Term  t0,
Term  inp 
)

Definition at line 2718 of file c_interface.c.

◆ YAP_ExternalDataInStackFromTerm()

X_API void * YAP_ExternalDataInStackFromTerm ( Term  t)

Definition at line 1894 of file c_interface.c.

◆ YAP_ExtraSpace()

X_API void * YAP_ExtraSpace ( void  )

Definition at line 718 of file c_interface.c.

◆ YAP_ExtraSpaceCut()

X_API void * YAP_ExtraSpaceCut ( void  )

Definition at line 703 of file c_interface.c.

◆ YAP_FileDescriptorFromStream()

X_API void * YAP_FileDescriptorFromStream ( Term  t)

Definition at line 2769 of file c_interface.c.

◆ YAP_FileNoFromStream()

X_API int YAP_FileNoFromStream ( Term  t)

Definition at line 2761 of file c_interface.c.

◆ YAP_FloatOfTerm()

X_API YAP_Float YAP_FloatOfTerm ( YAP_Term  t)

Definition at line 430 of file c_interface.c.

◆ YAP_FloatsToList()

X_API Term YAP_FloatsToList ( double *  dblp,
size_t  sz 
)

Definition at line 2579 of file c_interface.c.

◆ YAP_FlushAllStreams()

X_API void YAP_FlushAllStreams ( void  )

Definition at line 2397 of file c_interface.c.

◆ YAP_foreign_stream()

X_API void * YAP_foreign_stream ( int  sno)

Definition at line 3196 of file c_interface.c.

◆ YAP_FreeSpaceFromYap()

X_API void YAP_FreeSpaceFromYap ( void *  ptr)

Definition at line 1350 of file c_interface.c.

◆ YAP_FullLookupAtom()

X_API YAP_Atom YAP_FullLookupAtom ( const char *  c)

Definition at line 510 of file c_interface.c.

◆ YAP_FunctorOfTerm()

X_API YAP_Functor YAP_FunctorOfTerm ( Term  t)

Definition at line 681 of file c_interface.c.

◆ YAP_FunctorToInt()

X_API Int YAP_FunctorToInt ( YAP_Functor  f)

Definition at line 3170 of file c_interface.c.

◆ YAP_FunctorToPred()

X_API YAP_PredEntryPtr YAP_FunctorToPred ( YAP_Functor  func)

Definition at line 1709 of file c_interface.c.

◆ YAP_FunctorToPredInModule()

X_API YAP_PredEntryPtr YAP_FunctorToPredInModule ( YAP_Functor  func,
Term  mod 
)

Definition at line 1719 of file c_interface.c.

◆ YAP_GetFromSlot()

X_API Term YAP_GetFromSlot ( YAP_handle_t  slot)

read from a slot

Definition at line 845 of file c_interface.c.

◆ YAP_GetStreamFromId()

X_API void * YAP_GetStreamFromId ( int  no)

given a stream descriptor or stream alias (see open/3 ), return YAP's internal handle

Definition at line 2172 of file c_interface.c.

◆ YAP_GetValue()

X_API Term YAP_GetValue ( YAP_Atom  at)

Definition at line 2356 of file c_interface.c.

◆ YAP_GoalHasException()

X_API bool YAP_GoalHasException ( Term *  t)

Definition at line 2112 of file c_interface.c.

◆ YAP_Halt()

X_API void YAP_Halt ( int  i)

Definition at line 2420 of file c_interface.c.

◆ YAP_HaltRegisterHook()

X_API int YAP_HaltRegisterHook ( HaltHookFunc  hook,
void *  closure 
)

Definition at line 2564 of file c_interface.c.

◆ YAP_HeadOfTerm()

X_API Term YAP_HeadOfTerm ( Term  t)

Definition at line 622 of file c_interface.c.

◆ YAP_HeapStoreOpaqueTerm()

X_API CELL * YAP_HeapStoreOpaqueTerm ( Term  t)

Definition at line 1943 of file c_interface.c.

◆ YAP_ImportTerm()

X_API Term YAP_ImportTerm ( char *  buf)

Definition at line 3106 of file c_interface.c.

◆ YAP_ImportTfunnumberm()

X_API Term YAP_ImportTfunnumberm ( char *  buf)

Definition at line 3116 of file c_interface.c.

◆ yap_init()

void yap_init ( void  )

Definition at line 3209 of file c_interface.c.

◆ YAP_InitConsult()

X_API int YAP_InitConsult ( int  mode,
const char *  fname,
char *  full,
int *  osnop 
)

Definition at line 2124 of file c_interface.c.

◆ YAP_InitSlot() [1/2]

X_API Int YAP_InitSlot ( Term  t)

Definition at line 835 of file c_interface.c.

◆ YAP_InitSlot() [2/2]

X_API yhandle_t YAP_InitSlot ( YAP_Term  t)

allocate n empty new slots

Return a handle to the system's default slo t iX_API yhandle_t YAP_NewSlots(int NumberOfSlots);

allocate n empty new slots

Allocate NumberOfSlots from the stack and return an handle to the last one The other handle can be obtained by decrementing the handle

◆ YAP_InitSocks()

X_API int YAP_InitSocks ( const char *  host,
long  port 
)

Definition at line 2372 of file c_interface.c.

◆ YAP_IntOfTerm()

X_API Int YAP_IntOfTerm ( Term  t)

Definition at line 339 of file c_interface.c.

◆ YAP_IntsToList()

X_API Term YAP_IntsToList ( Int *  dblp,
size_t  sz 
)

Definition at line 2645 of file c_interface.c.

◆ YAP_IntToAtom()

X_API YAP_Atom YAP_IntToAtom ( Int  i)

Definition at line 3168 of file c_interface.c.

◆ YAP_IntToFunctor()

X_API YAP_Functor YAP_IntToFunctor ( Int  i)

Definition at line 3200 of file c_interface.c.

◆ YAP_IsApplTerm()

X_API YAP_Bool YAP_IsApplTerm ( Term  t)

Definition at line 284 of file c_interface.c.

◆ YAP_IsAtomTerm()

X_API YAP_Bool YAP_IsAtomTerm ( Term  t)

Definition at line 280 of file c_interface.c.

◆ YAP_IsAttVar()

X_API int YAP_IsAttVar ( Term  t)

Definition at line 2740 of file c_interface.c.

◆ YAP_IsBigNumTerm()

X_API YAP_Bool YAP_IsBigNumTerm ( YAP_Term  t)

Definition at line 249 of file c_interface.c.

◆ YAP_IsCompoundTerm()

X_API YAP_Bool YAP_IsCompoundTerm ( Term  t)

Definition at line 288 of file c_interface.c.

◆ YAP_IsDbRefTerm()

X_API YAP_Bool YAP_IsDbRefTerm ( Term  t)

Definition at line 278 of file c_interface.c.

◆ YAP_IsExternalDataInStackTerm()

X_API YAP_Bool YAP_IsExternalDataInStackTerm ( Term  t)

Definition at line 1890 of file c_interface.c.

◆ YAP_IsFloatTerm()

X_API YAP_Bool YAP_IsFloatTerm ( Term  t)

Definition at line 276 of file c_interface.c.

◆ YAP_IsIntTerm()

X_API YAP_Bool YAP_IsIntTerm ( YAP_Term  t)

Definition at line 241 of file c_interface.c.

◆ YAP_IsLongIntTerm()

X_API YAP_Bool YAP_IsLongIntTerm ( YAP_Term  t)

Definition at line 247 of file c_interface.c.

◆ YAP_IsNonVarTerm()

X_API YAP_Bool YAP_IsNonVarTerm ( YAP_Term  t)

Definition at line 274 of file c_interface.c.

◆ YAP_IsNumberedVariable()

X_API int YAP_IsNumberedVariable ( Term  t)

Definition at line 3095 of file c_interface.c.

◆ YAP_IsNumberTerm()

X_API YAP_Bool YAP_IsNumberTerm ( YAP_Term  t)

Definition at line 243 of file c_interface.c.

◆ YAP_IsOpaqueObjectTerm()

X_API YAP_Bool YAP_IsOpaqueObjectTerm ( Term  t,
YAP_opaque_tag_t  tag 
)

Definition at line 1937 of file c_interface.c.

◆ YAP_IsPairTerm()

X_API YAP_Bool YAP_IsPairTerm ( Term  t)

Definition at line 282 of file c_interface.c.

◆ YAP_IsRationalTerm()

X_API YAP_Bool YAP_IsRationalTerm ( YAP_Term  t)

Definition at line 260 of file c_interface.c.

◆ YAP_IsStringTerm()

X_API YAP_Bool YAP_IsStringTerm ( YAP_Term  t)

Definition at line 270 of file c_interface.c.

◆ YAP_IsTermNil()

X_API int YAP_IsTermNil ( Term  t)

Definition at line 2552 of file c_interface.c.

◆ YAP_IsVarTerm()

X_API YAP_Bool YAP_IsVarTerm ( YAP_Term  t)

Definition at line 272 of file c_interface.c.

◆ YAP_IsWideAtom()

X_API bool YAP_IsWideAtom ( YAP_Atom  a)

Definition at line 441 of file c_interface.c.

◆ YAP_LeaveGoal()

X_API bool YAP_LeaveGoal ( bool  successful,
YAP_dogoalinfo dgi 
)

Definition at line 1824 of file c_interface.c.

◆ YAP_ListLength()

X_API Int YAP_ListLength ( Term  t)

Definition at line 3075 of file c_interface.c.

◆ YAP_ListToFloats()

X_API Int YAP_ListToFloats ( Term  t,
double *  dblp,
size_t  sz 
)

Definition at line 2612 of file c_interface.c.

◆ YAP_ListToInts()

X_API Int YAP_ListToInts ( Term  t,
Int *  dblp,
size_t  sz 
)

Definition at line 2678 of file c_interface.c.

◆ YAP_LookupAtom()

X_API YAP_Atom YAP_LookupAtom ( const char *  c)

Definition at line 474 of file c_interface.c.

◆ YAP_LookupWideAtom()

X_API YAP_Atom YAP_LookupWideAtom ( const wchar_t *  c)

Definition at line 492 of file c_interface.c.

◆ YAP_MaxOpPriority()

X_API int YAP_MaxOpPriority ( YAP_Atom  at,
Term  module 
)

Definition at line 2885 of file c_interface.c.

◆ YAP_MkApplTerm()

X_API Term YAP_MkApplTerm ( YAP_Functor  f,
UInt  arity,
Term  args[] 
)

Definition at line 654 of file c_interface.c.

◆ YAP_MkAtomTerm()

X_API Term YAP_MkAtomTerm ( YAP_Atom  n)

Definition at line 432 of file c_interface.c.

◆ YAP_MkBigNumTerm()

X_API Term YAP_MkBigNumTerm ( void *  big)

Definition at line 347 of file c_interface.c.

◆ YAP_MkBlobTerm()

X_API Term YAP_MkBlobTerm ( unsigned int  sz)

Definition at line 386 of file c_interface.c.

◆ YAP_MkCharPTerm()

X_API Term YAP_MkCharPTerm ( char *  n)

Definition at line 313 of file c_interface.c.

◆ YAP_MkFloatTerm()

X_API Term YAP_MkFloatTerm ( double  n)

Definition at line 419 of file c_interface.c.

◆ YAP_MkFunctor()

X_API YAP_Functor YAP_MkFunctor ( YAP_Atom  a,
UInt  n 
)

Definition at line 693 of file c_interface.c.

◆ YAP_MkIntTerm()

X_API Term YAP_MkIntTerm ( Int  n)

Definition at line 293 of file c_interface.c.

◆ YAP_MkListFromTerms()

X_API Term YAP_MkListFromTerms ( Term *  ta,
Int  sz 
)

Definition at line 572 of file c_interface.c.

◆ YAP_MkNewApplTerm()

X_API Term YAP_MkNewApplTerm ( YAP_Functor  f,
UInt  arity 
)

Definition at line 667 of file c_interface.c.

◆ YAP_MkNewPairTerm()

X_API Term YAP_MkNewPairTerm ( void  )

Definition at line 608 of file c_interface.c.

◆ YAP_MkPairTerm()

X_API Term YAP_MkPairTerm ( Term  t1,
Term  t2 
)

Definition at line 548 of file c_interface.c.

◆ YAP_MkRationalTerm()

X_API Term YAP_MkRationalTerm ( void *  big)

Definition at line 366 of file c_interface.c.

◆ YAP_MkStringTerm()

X_API Term YAP_MkStringTerm ( const char *  n)

Definition at line 303 of file c_interface.c.

◆ YAP_MkUnsignedStringTerm()

X_API Term YAP_MkUnsignedStringTerm ( const unsigned char *  n)

Definition at line 323 of file c_interface.c.

◆ YAP_MkVarTerm()

X_API Term YAP_MkVarTerm ( void  )

Definition at line 537 of file c_interface.c.

◆ YAP_ModuleUser()

X_API Term YAP_ModuleUser ( void  )

Definition at line 2877 of file c_interface.c.

◆ YAP_NameOfFunctor()

X_API YAP_Atom YAP_NameOfFunctor ( YAP_Functor  f)

Definition at line 697 of file c_interface.c.

◆ YAP_NBufferToAtomList()

X_API Term YAP_NBufferToAtomList ( const char *  s,
size_t  len 
)

Definition at line 1529 of file c_interface.c.

◆ YAP_NBufferToDiffList()

X_API Term YAP_NBufferToDiffList ( const char *  s,
Term  t0,
size_t  len 
)

Definition at line 1626 of file c_interface.c.

◆ YAP_NBufferToString()

X_API Term YAP_NBufferToString ( const char *  s,
size_t  len 
)

Definition at line 1407 of file c_interface.c.

◆ YAP_NewOpaqueObject()

X_API Term YAP_NewOpaqueObject ( YAP_opaque_tag_t  blob_tag,
size_t  bytes 
)

Definition at line 1917 of file c_interface.c.

◆ YAP_NewOpaqueType()

X_API YAP_opaque_tag_t YAP_NewOpaqueType ( struct YAP_opaque_handler_struct f)

Definition at line 1898 of file c_interface.c.

◆ YAP_NewSlots()

X_API Int YAP_NewSlots ( int  n)

Definition at line 830 of file c_interface.c.

◆ YAP_NumberOfClausesForPredicate()

X_API YAP_handle_t YAP_NumberOfClausesForPredicate ( YAP_PredEntryPtr  ape)

Definition at line 2880 of file c_interface.c.

◆ YAP_NumberVars()

X_API Int YAP_NumberVars ( Term  t,
Int  nbv 
)

Definition at line 3086 of file c_interface.c.

◆ YAP_NWideBufferToAtomDiffList()

X_API Term YAP_NWideBufferToAtomDiffList ( const wchar_t *  s,
Term  t0,
size_t  len 
)

Definition at line 1585 of file c_interface.c.

◆ YAP_NWideBufferToAtomList()

X_API Term YAP_NWideBufferToAtomList ( const wchar_t *  s,
size_t  len 
)

Definition at line 1566 of file c_interface.c.

◆ YAP_NWideBufferToDiffList()

X_API Term YAP_NWideBufferToDiffList ( const wchar_t *  s,
Term  t0,
size_t  len 
)

Definition at line 1666 of file c_interface.c.

◆ YAP_NWideBufferToString()

X_API Term YAP_NWideBufferToString ( const wchar_t *  s,
size_t  len 
)

Definition at line 1444 of file c_interface.c.

◆ YAP_OpaqueObjectFromTerm()

X_API void * YAP_OpaqueObjectFromTerm ( Term  t)

Definition at line 1941 of file c_interface.c.

◆ YAP_OpenList()

X_API Term YAP_OpenList ( int  n)

Definition at line 2700 of file c_interface.c.

◆ YAP_OpInfo()

X_API int YAP_OpInfo ( YAP_Atom  at,
Term  module,
int  opkind,
int *  yap_type,
int *  prio 
)

Definition at line 2903 of file c_interface.c.

◆ YAP_PointerOfTerm()

X_API void * YAP_PointerOfTerm ( Term  t)

Definition at line 3017 of file c_interface.c.

◆ YAP_Predicate()

X_API void * YAP_Predicate ( YAP_Atom  a,
UInt  arity,
Term  m 
)

Definition at line 2427 of file c_interface.c.

◆ YAP_PredicateInfo()

X_API void YAP_PredicateInfo ( void *  p,
YAP_Atom *  a,
UInt *  arity,
Term *  m 
)

Definition at line 2436 of file c_interface.c.

◆ YAP_PruneGoal()

X_API void YAP_PruneGoal ( YAP_dogoalinfo gi)

Definition at line 2092 of file c_interface.c.

◆ YAP_PutInSlot()

X_API void YAP_PutInSlot ( Int  slot,
Term  t 
)

Definition at line 871 of file c_interface.c.

◆ YAP_PutValue()

X_API void YAP_PutValue ( YAP_Atom  at,
Term  t 
)

Definition at line 2354 of file c_interface.c.

◆ YAP_RationalOfTerm()

X_API YAP_Bool YAP_RationalOfTerm ( Term  t,
void *  b 
)

Definition at line 375 of file c_interface.c.

◆ YAP_Read()

X_API Term YAP_Read ( FILE *  f)

read a Prolog term from an operating system stream $s$

Definition at line 2206 of file c_interface.c.

◆ YAP_ReadBuffer()

X_API Term YAP_ReadBuffer ( const char *  s,
Term *  tp 
)

Definition at line 1463 of file c_interface.c.

◆ YAP_ReadClauseFromStream()

X_API Term YAP_ReadClauseFromStream ( int  sno,
Term  vs,
Term  pos 
)

Definition at line 2234 of file c_interface.c.

◆ YAP_ReadFromStream()

X_API Term YAP_ReadFromStream ( int  s)

read a Prolog term from a Prolog opened stream $s$

Check YAP_OpenStream() for how to open Prolog streams in C

Definition at line 2217 of file c_interface.c.

◆ YAP_ReallocSpaceFromYap()

X_API void * YAP_ReallocSpaceFromYap ( void *  ptr,
size_t  size 
)

Definition at line 1321 of file c_interface.c.

◆ YAP_Record()

X_API void * YAP_Record ( Term  t)

Definition at line 2777 of file c_interface.c.

◆ YAP_Recorded()

X_API Term YAP_Recorded ( void *  handle)

Definition at line 2803 of file c_interface.c.

◆ YAP_RecoverSlots()

X_API int YAP_RecoverSlots ( int  n,
YAP_handle_t  topSlot 
)

Succeeds if it recovers the space allocated for $n$ contiguous slots starting at topSlot.

Set the contents of slot slot to t

Definition at line 840 of file c_interface.c.

◆ YAP_RepStreamFromId()

X_API void * YAP_RepStreamFromId ( int  sno)

Obtain a pointer to the YAP representation of a stream.

Utility routine to Obtain a pointer to the YAP representation of a stream.

Parameters
snoStream Id
Returns
data structure for stream

Definition at line 2387 of file c_interface.c.

◆ YAP_RequiresExtraStack()

X_API int YAP_RequiresExtraStack ( size_t  sz)

Definition at line 3118 of file c_interface.c.

◆ YAP_Reset()

X_API int YAP_Reset ( yap_reset_t  mode,
bool  reset_global 
)

Definition at line 2362 of file c_interface.c.

◆ YAP_RestartGoal()

X_API bool YAP_RestartGoal ( void  )

Definition at line 2017 of file c_interface.c.

◆ YAP_RetryGoal()

X_API bool YAP_RetryGoal ( YAP_dogoalinfo dgi)

Definition at line 1782 of file c_interface.c.

◆ YAP_RunGoal()

X_API Int YAP_RunGoal ( Term  t)

Definition at line 1862 of file c_interface.c.

◆ YAP_RunGoalOnce()

X_API Int YAP_RunGoalOnce ( Term  t)

Definition at line 1947 of file c_interface.c.

◆ YAP_SetA()

X_API YAP_Term YAP_SetA ( int  i,
YAP_Term  t 
)

Definition at line 236 of file c_interface.c.

◆ YAP_SetCurrentModule()

X_API Term YAP_SetCurrentModule ( Term  new)

Definition at line 2491 of file c_interface.c.

◆ YAP_SetOutputMessage()

X_API void YAP_SetOutputMessage ( void  )

Definition at line 2374 of file c_interface.c.

◆ YAP_SetYAPFlag()

X_API int YAP_SetYAPFlag ( Term  flag,
Term  val 
)

Definition at line 2865 of file c_interface.c.

◆ YAP_ShutdownGoal()

X_API bool YAP_ShutdownGoal ( int  backtrack)

Definition at line 2038 of file c_interface.c.

◆ YAP_signal()

X_API void YAP_signal ( int  sig)

Definition at line 2863 of file c_interface.c.

◆ YAP_SizeOfExportedTerm()

X_API size_t YAP_SizeOfExportedTerm ( char *  buf)

Definition at line 3110 of file c_interface.c.

◆ YAP_SkipList()

X_API Int YAP_SkipList ( Term *  l,
Term **  tailp 
)

Definition at line 626 of file c_interface.c.

◆ YAP_SlotsToArgs() [1/2]

X_API void YAP_SlotsToArgs ( int  HowMany,
YAP_handle_t  slot 
)

copies n slots such that sl is copied to the last abstract ,achine register

Set the first HowMany arguments to the HowMany slots

◆ YAP_SlotsToArgs() [2/2]

X_API void YAP_SlotsToArgs ( int  n,
yhandle_t  slot 
)

Definition at line 2855 of file c_interface.c.

◆ YAP_StartSlots()

X_API void YAP_StartSlots ( void  )

initialize the slot data-structure: all existing slots will be discarded

Typically, this would be used at the beginning top-level or other outer quqqery

Definition at line 144 of file c_interface.c.

◆ YAP_StreamToFileNo()

X_API int YAP_StreamToFileNo ( Term  t)

Definition at line 2380 of file c_interface.c.

◆ YAP_StringOfTerm()

X_API const char * YAP_StringOfTerm ( Term  t)

Definition at line 333 of file c_interface.c.

◆ YAP_StringToBuffer()

X_API char * YAP_StringToBuffer ( Term  t,
char *  buf,
unsigned int  bufsize 
)

copy a string to a buffer, the buffer must have been malloced

Parameters
tthe text, or string
bufthe user-provided buffer
bufsizebu
Returns

Definition at line 1362 of file c_interface.c.

◆ YAP_StripModule()

X_API Term YAP_StripModule ( Term  t,
Term *  modp 
)

Definition at line 2506 of file c_interface.c.

◆ YAP_TagOfTerm()

X_API YAP_tag_t YAP_TagOfTerm ( Term  t)

Definition at line 2973 of file c_interface.c.

◆ YAP_TailOfTerm()

X_API Term YAP_TailOfTerm ( Term  t)

Definition at line 624 of file c_interface.c.

◆ YAP_TermHash()

X_API Int YAP_TermHash ( Term  t,
Int  sz,
Int  depth,
int  variant 
)

Definition at line 814 of file c_interface.c.

◆ YAP_TermNil()

X_API Term YAP_TermNil ( void  )

Definition at line 2550 of file c_interface.c.

◆ YAP_TermToStream()

X_API FILE * YAP_TermToStream ( Term  t)

Definition at line 2174 of file c_interface.c.

◆ YAP_ThreadAttachEngine()

X_API int YAP_ThreadAttachEngine ( int  wid)

Definition at line 2526 of file c_interface.c.

◆ YAP_ThreadCreateEngine()

X_API int YAP_ThreadCreateEngine ( struct YAP_thread_attr_struct attr)

Definition at line 2518 of file c_interface.c.

◆ YAP_ThreadDestroyEngine()

X_API int YAP_ThreadDestroyEngine ( int  wid)

Definition at line 2542 of file c_interface.c.

◆ YAP_ThreadDetachEngine()

X_API int YAP_ThreadDetachEngine ( int  wid)

Definition at line 2534 of file c_interface.c.

◆ YAP_ThreadSelf()

X_API int YAP_ThreadSelf ( void  )

Definition at line 2510 of file c_interface.c.

◆ YAP_Throw()

X_API void YAP_Throw ( Term  t)

Definition at line 2405 of file c_interface.c.

◆ YAP_TopGoal()

X_API YAP_PredEntryPtr YAP_TopGoal ( void  )

Definition at line 3202 of file c_interface.c.

◆ YAP_TopOfLocalStack()

X_API CELL * YAP_TopOfLocalStack ( void  )

Definition at line 2422 of file c_interface.c.

◆ YAP_Unifiable()

X_API int YAP_Unifiable ( Term  t1,
Term  t2 
)

Definition at line 781 of file c_interface.c.

◆ YAP_Unify()

X_API bool YAP_Unify ( Term  t1,
Term  t2 
)

Definition at line 771 of file c_interface.c.

◆ YAP_UnNumberVars()

X_API Term YAP_UnNumberVars ( Term  t)

Definition at line 3090 of file c_interface.c.

◆ YAP_UnsignedStringOfTerm()

X_API const unsigned char * YAP_UnsignedStringOfTerm ( Term  t)

Definition at line 335 of file c_interface.c.

◆ YAP_UserBackCPredicate()

X_API void YAP_UserBackCPredicate ( const char *  name,
YAP_UserCPred  init,
YAP_UserCPred  cont,
arity_t  arity,
arity_t  extra 
)

Definition at line 2470 of file c_interface.c.

◆ YAP_UserBackCPredicate_()

X_API void YAP_UserBackCPredicate_ ( const char *  name,
YAP_UserCPred  init,
YAP_UserCPred  cont,
YAP_Arity  arity,
YAP_Arity  extra 
)

Definition at line 2456 of file c_interface.c.

◆ YAP_UserBackCutCPredicate()

X_API void YAP_UserBackCutCPredicate ( const char *  name,
YAP_UserCPred  init,
YAP_UserCPred  cont,
YAP_UserCPred  cut,
YAP_Arity  arity,
YAP_Arity  extra 
)

Definition at line 2463 of file c_interface.c.

◆ YAP_UserCPredicate()

X_API void YAP_UserCPredicate ( const char *  name,
YAP_UserCPred  def,
YAP_Arity  arity 
)

Definition at line 2451 of file c_interface.c.

◆ YAP_UserCPredicateWithArgs()

X_API void YAP_UserCPredicateWithArgs ( const char *  a,
YAP_UserCPred  f,
arity_t  arity,
Term  mod 
)

Definition at line 2477 of file c_interface.c.

◆ YAP_UTF8_TextLength()

X_API size_t YAP_UTF8_TextLength ( Term  t)

Output the number of bytes needed to represent a string in UTF-8 Note that the terminating zero is not included.

No error checking is performed (the programmer should have that done)

Parameters
ta list of codes, chars, string or atom
Returns
a positive number with the size, or 0

Definition at line 3041 of file c_interface.c.

◆ YAP_Variant()

X_API int YAP_Variant ( Term  t1,
Term  t2 
)

Definition at line 803 of file c_interface.c.

◆ YAP_VarSlotToNumber()

X_API yhandle_t YAP_VarSlotToNumber ( yhandle_t  s)

Definition at line 2868 of file c_interface.c.

◆ YAP_WideAtomName()

X_API const wchar_t * YAP_WideAtomName ( YAP_Atom  a)

Definition at line 459 of file c_interface.c.

◆ YAP_WideBufferToAtomList()

X_API Term YAP_WideBufferToAtomList ( const wchar_t *  s)

Definition at line 1548 of file c_interface.c.

◆ YAP_WideBufferToDiffList()

X_API Term YAP_WideBufferToDiffList ( const wchar_t *  s,
Term  t0 
)

Definition at line 1647 of file c_interface.c.

◆ YAP_WideBufferToString()

X_API Term YAP_WideBufferToString ( const wchar_t *  s)

Definition at line 1426 of file c_interface.c.

◆ YAP_Write()

X_API void YAP_Write ( Term  t,
FILE *  f,
int  flags 
)

Definition at line 2250 of file c_interface.c.

◆ YAP_WriteBuffer()

X_API char * YAP_WriteBuffer ( Term  t,
char *  buf,
size_t  sze,
int  flags 
)

Definition at line 2271 of file c_interface.c.

◆ YAP_WriteDynamicBuffer()

X_API char * YAP_WriteDynamicBuffer ( YAP_Term  t,
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

Definition at line 2305 of file c_interface.c.

Variable Documentation

◆ AtomTranslations

size_t AtomTranslations

Definition at line 3142 of file c_interface.c.

◆ FunctorTranslations

size_t FunctorTranslations

Definition at line 3143 of file c_interface.c.

◆ MaxAtomTranslations

size_t MaxAtomTranslations

Definition at line 3142 of file c_interface.c.

◆ MaxFunctorTranslations

size_t MaxFunctorTranslations

Definition at line 3143 of file c_interface.c.

◆ TR_Atoms

atom_t* TR_Atoms

Definition at line 3140 of file c_interface.c.

◆ TR_Functors

functor_t* TR_Functors

Definition at line 3141 of file c_interface.c.

◆ YAP_BPROLOG_curr_toam_status

Term YAP_BPROLOG_curr_toam_status

Definition at line 3030 of file c_interface.c.

◆ YAP_BPROLOG_exception

int YAP_BPROLOG_exception

Definition at line 3029 of file c_interface.c.

Macros

#define FRG_REDO_MASK   0x00000003L
 
#define FRG_REDO_BITS   2
 
#define REDO_INT   0x02 /* Returned an integer */
 
#define REDO_PTR   0x03 /* returned a pointer */
 

Typedefs

typedef Int(* CPredicate0) (void)
 
typedef Int(* CPredicate1) (yhandle_t)
 
typedef Int(* CPredicate2) (yhandle_t, yhandle_t)
 
typedef Int(* CPredicate3) (yhandle_t, yhandle_t, yhandle_t)
 
typedef Int(* CPredicate4) (yhandle_t, yhandle_t, yhandle_t, yhandle_t)
 
typedef Int(* CPredicate5) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)
 
typedef Int(* CPredicate6) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)
 
typedef Int(* CPredicate7) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)
 
typedef Int(* CPredicate8) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)
 
typedef Int(* CPredicate9) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)
 
typedef Int(* CPredicate10) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t)
 
typedef Int(* CPredicateV) (yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate0) (struct foreign_context *)
 
typedef uintptr_t(* CBPredicate1) (yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate2) (yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate3) (yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate4) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate5) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate6) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate7) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate8) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate9) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)
 
typedef uintptr_t(* CBPredicate10) (yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, yhandle_t, struct foreign_context *)
 

Functions

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 yhandle_t YAP_CurrentSlot (void)
 report the current position of the slots, assuming that they occupy the top of the stack More...
 
X_API yhandle_t YAP_InitSlot (YAP_Term t)
 allocate n empty new slots More...
 
X_API YAP_Term YAP_GetFromSlot (YAP_handle_t slot)
 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 slot, YAP_Term t)
 store term in a slot
 
X_API int YAP_RecoverSlots (int, YAP_handle_t topSlot)
 Succeeds if it recovers the space allocated for $n$ contiguous slots starting at topSlot. More...
 
X_API YAP_handle_t YAP_ArgsToSlots (int HowMany)
 copies the first new n YAAM registers to slots More...
 
X_API void YAP_SlotsToArgs (int HowMany, YAP_handle_t slot)
 copies n slots such that sl is copied to the last abstract ,achine register More...
 
X_API YAP_Term YAP_A (int i)
 
X_API YAP_Term YAP_SetA (int i, YAP_Term t)
 
X_API YAP_Bool YAP_IsIntTerm (YAP_Term t)
 
X_API YAP_Bool YAP_IsNumberTerm (YAP_Term t)
 
X_API YAP_Bool YAP_IsLongIntTerm (YAP_Term t)
 
X_API YAP_Bool YAP_IsBigNumTerm (YAP_Term t)
 
X_API YAP_Bool YAP_IsRationalTerm (YAP_Term t)
 
X_API YAP_Bool YAP_IsStringTerm (YAP_Term t)
 
X_API YAP_Bool YAP_IsVarTerm (YAP_Term t)
 
X_API YAP_Bool YAP_IsNonVarTerm (YAP_Term t)
 
X_API YAP_Bool YAP_IsFloatTerm (Term t)
 
X_API YAP_Bool YAP_IsDbRefTerm (Term t)
 
X_API YAP_Bool YAP_IsAtomTerm (Term t)
 
X_API YAP_Bool YAP_IsPairTerm (Term t)
 
X_API YAP_Bool YAP_IsApplTerm (Term t)
 
X_API YAP_Bool YAP_IsCompoundTerm (Term t)
 
X_API Term YAP_MkIntTerm (Int n)
 
X_API Term YAP_MkStringTerm (const char *n)
 
X_API Term YAP_MkCharPTerm (char *n)
 
X_API Term YAP_MkUnsignedStringTerm (const unsigned char *n)
 
X_API const char * YAP_StringOfTerm (Term t)
 
X_API const unsigned char * YAP_UnsignedStringOfTerm (Term t)
 
X_API Int YAP_IntOfTerm (Term t)
 
X_API Term YAP_MkBigNumTerm (void *big)
 
X_API YAP_Bool YAP_BigNumOfTerm (Term t, void *b)
 
X_API Term YAP_MkRationalTerm (void *big)
 
X_API YAP_Bool YAP_RationalOfTerm (Term t, void *b)
 
X_API Term YAP_MkBlobTerm (unsigned int sz)
 
X_API void * YAP_BlobOfTerm (Term t)
 
X_API Term YAP_MkFloatTerm (double n)
 
X_API YAP_Float YAP_FloatOfTerm (YAP_Term t)
 
X_API Term YAP_MkAtomTerm (YAP_Atom n)
 
X_API YAP_Atom YAP_AtomOfTerm (Term t)
 
X_API 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_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 at)
 
X_API Term YAP_MkVarTerm (void)
 
X_API Term YAP_MkPairTerm (Term t1, Term t2)
 
X_API Term YAP_MkListFromTerms (Term *ta, Int sz)
 
X_API Term YAP_MkNewPairTerm ()
 
X_API Term YAP_HeadOfTerm (Term t)
 
X_API Term YAP_TailOfTerm (Term t)
 
X_API Int YAP_SkipList (Term *l, Term **tailp)
 
X_API Term YAP_MkApplTerm (YAP_Functor f, UInt arity, Term args[])
 
X_API Term YAP_MkNewApplTerm (YAP_Functor f, UInt arity)
 
X_API YAP_Functor YAP_FunctorOfTerm (Term t)
 
X_API Term YAP_ArgOfTerm (UInt n, Term t)
 
X_API Term * YAP_ArgsOfTerm (Term t)
 
X_API YAP_Functor YAP_MkFunctor (YAP_Atom a, UInt n)
 
X_API YAP_Atom YAP_NameOfFunctor (YAP_Functor f)
 
X_API UInt YAP_ArityOfFunctor (YAP_Functor f)
 
X_API void * YAP_ExtraSpaceCut (void)
 
X_API void * YAP_ExtraSpace (void)
 
X_API void YAP_cut_up (void)
 
X_API bool YAP_Unify (Term t1, Term t2)
 
X_API int YAP_Unifiable (Term t1, Term t2)
 
X_API int YAP_ExactlyEqual (Term t1, Term t2)
 
X_API int YAP_Variant (Term t1, Term t2)
 
X_API Int YAP_TermHash (Term t, Int sz, Int depth, int variant)
 
X_API Int YAP_NewSlots (int n)
 
X_API Int YAP_InitSlot (Term t)
 
X_API void YAP_PutInSlot (Int slot, Term t)
 
X_API Int YAP_Execute (PredEntry *pe, CPredicate exec_code)
 
X_API Int YAP_ExecuteFirst (PredEntry *pe, CPredicate exec_code)
 
X_API Int YAP_ExecuteOnCut (PredEntry *pe, CPredicate exec_code, struct cut_c_str *top)
 
X_API Int YAP_ExecuteNext (PredEntry *pe, CPredicate exec_code)
 
X_API void * YAP_ReallocSpaceFromYap (void *ptr, size_t size)
 
X_API void * YAP_AllocSpaceFromYap (size_t size)
 
X_API void YAP_FreeSpaceFromYap (void *ptr)
 
X_API char * YAP_StringToBuffer (Term t, char *buf, unsigned int bufsize)
 copy a string to a buffer, the buffer must have been malloced More...
 
X_API Term YAP_BufferToString (const char *s)
 
X_API Term YAP_NBufferToString (const char *s, size_t len)
 
X_API Term YAP_WideBufferToString (const wchar_t *s)
 
X_API Term YAP_NWideBufferToString (const wchar_t *s, size_t len)
 
X_API Term YAP_ReadBuffer (const char *s, Term *tp)
 
X_API YAP_Term YAP_BufferToAtomList (const char *s)
 
X_API Term YAP_NBufferToAtomList (const char *s, size_t len)
 
X_API Term YAP_WideBufferToAtomList (const wchar_t *s)
 
X_API Term YAP_NWideBufferToAtomList (const wchar_t *s, size_t len)
 
X_API Term YAP_NWideBufferToAtomDiffList (const wchar_t *s, Term t0, size_t len)
 
X_API Term YAP_BufferToDiffList (const char *s, Term t0)
 
X_API Term YAP_NBufferToDiffList (const char *s, Term t0, size_t len)
 
X_API Term YAP_WideBufferToDiffList (const wchar_t *s, Term t0)
 
X_API Term YAP_NWideBufferToDiffList (const wchar_t *s, Term t0, size_t len)
 
X_API void YAP_Error__ (const char *file, const char *function, int lineno, int myerrno, Term t, const char *buf,...)
 
X_API YAP_PredEntryPtr YAP_FunctorToPred (YAP_Functor func)
 
X_API YAP_PredEntryPtr YAP_AtomToPred (YAP_Atom at)
 
X_API YAP_PredEntryPtr YAP_FunctorToPredInModule (YAP_Functor func, Term mod)
 
X_API YAP_PredEntryPtr YAP_AtomToPredInModule (YAP_Atom at, Term mod)
 
X_API bool YAP_EnterGoal (YAP_PredEntryPtr ape, CELL *ptr, YAP_dogoalinfo *dgi)
 
X_API bool YAP_RetryGoal (YAP_dogoalinfo *dgi)
 
X_API bool YAP_LeaveGoal (bool successful, YAP_dogoalinfo *dgi)
 
X_API Int YAP_RunGoal (Term t)
 
X_API Term YAP_AllocExternalDataInStack (size_t bytes)
 
X_API YAP_Bool YAP_IsExternalDataInStackTerm (Term t)
 
X_API void * YAP_ExternalDataInStackFromTerm (Term t)
 
X_API YAP_opaque_tag_t YAP_NewOpaqueType (struct YAP_opaque_handler_struct *f)
 
X_API Term YAP_NewOpaqueObject (YAP_opaque_tag_t blob_tag, size_t bytes)
 
X_API YAP_Bool YAP_IsOpaqueObjectTerm (Term t, YAP_opaque_tag_t tag)
 
X_API void * YAP_OpaqueObjectFromTerm (Term t)
 
X_API CELL * YAP_HeapStoreOpaqueTerm (Term t)
 
X_API Int YAP_RunGoalOnce (Term t)
 
X_API bool YAP_RestartGoal (void)
 
X_API bool YAP_ShutdownGoal (int backtrack)
 
X_API bool YAP_ContinueGoal (void)
 
X_API void YAP_PruneGoal (YAP_dogoalinfo *gi)
 
X_API bool YAP_GoalHasException (Term *t)
 
X_API void YAP_ClearExceptions (void)
 
X_API int YAP_InitConsult (int mode, const char *fname, char *full, int *osnop)
 
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 FILE * YAP_TermToStream (Term t)
 
X_API void YAP_EndConsult (int sno, int *osnop, const char *full)
 
X_API Term YAP_Read (FILE *f)
 read a Prolog term from an operating system stream $s$ More...
 
X_API Term YAP_ReadFromStream (int sno)
 read a Prolog term from a Prolog opened stream $s$ More...
 
X_API Term YAP_ReadClauseFromStream (int sno, Term vs, Term pos)
 
X_API void YAP_Write (Term t, FILE *f, int flags)
 
X_API YAP_Term YAP_CopyTerm (Term t)
 
X_API char * YAP_WriteBuffer (Term t, char *buf, size_t sze, int flags)
 
X_API char * YAP_WriteDynamicBuffer (YAP_Term t, 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 bool YAP_CompileClause (Term t)
 
X_API void YAP_PutValue (YAP_Atom at, Term t)
 
X_API Term YAP_GetValue (YAP_Atom at)
 
X_API int YAP_CompareTerms (Term t1, Term t2)
 
X_API int YAP_Reset (yap_reset_t mode, bool reset_global)
 
X_API void YAP_Exit (int retval)
 
X_API int YAP_InitSocks (const char *host, long port)
 
X_API void YAP_SetOutputMessage (void)
 
X_API int YAP_StreamToFileNo (Term t)
 
X_API void * YAP_RepStreamFromId (int sno)
 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_Throw (Term t)
 
X_API void YAP_AsyncThrow (Term t)
 
X_API void YAP_Halt (int i)
 
X_API CELL * YAP_TopOfLocalStack (void)
 
X_API void * YAP_Predicate (YAP_Atom a, UInt arity, Term m)
 
X_API void YAP_PredicateInfo (void *p, YAP_Atom *a, UInt *arity, Term *m)
 
X_API void YAP_UserCPredicate (const char *name, YAP_UserCPred def, YAP_Arity arity)
 
X_API void YAP_UserBackCPredicate_ (const char *name, YAP_UserCPred init, YAP_UserCPred cont, YAP_Arity arity, YAP_Arity extra)
 
X_API void YAP_UserBackCutCPredicate (const char *name, YAP_UserCPred init, YAP_UserCPred cont, YAP_UserCPred cut, YAP_Arity arity, YAP_Arity extra)
 
X_API void YAP_UserBackCPredicate (const char *name, YAP_UserCPred init, YAP_UserCPred cont, arity_t arity, arity_t extra)
 
X_API void YAP_UserCPredicateWithArgs (const char *a, YAP_UserCPred f, arity_t arity, Term mod)
 
X_API Term YAP_CurrentModule (void)
 
X_API Term YAP_SetCurrentModule (Term new)
 
X_API Term YAP_CreateModule (YAP_Atom at)
 
X_API Term YAP_StripModule (Term t, Term *modp)
 
X_API int YAP_ThreadSelf (void)
 
X_API int YAP_ThreadCreateEngine (struct YAP_thread_attr_struct *attr)
 
X_API int YAP_ThreadAttachEngine (int wid)
 
X_API int YAP_ThreadDetachEngine (int wid)
 
X_API int YAP_ThreadDestroyEngine (int wid)
 
X_API Term YAP_TermNil (void)
 
X_API int YAP_IsTermNil (Term t)
 
X_API int YAP_AtomGetHold (YAP_Atom at)
 
X_API int YAP_AtomReleaseHold (YAP_Atom at)
 
X_API YAP_agc_hook YAP_AGCRegisterHook (YAP_agc_hook hook)
 
X_API int YAP_HaltRegisterHook (HaltHookFunc hook, void *closure)
 
X_API char * YAP_cwd (void)
 
X_API Term YAP_FloatsToList (double *dblp, size_t sz)
 
X_API Int YAP_ListToFloats (Term t, double *dblp, size_t sz)
 
X_API Term YAP_IntsToList (Int *dblp, size_t sz)
 
X_API Int YAP_ListToInts (Term t, Int *dblp, size_t sz)
 
X_API Term YAP_OpenList (int n)
 
X_API Term YAP_ExtendList (Term t0, Term inp)
 
X_API int YAP_CloseList (Term t0, Term tail)
 
X_API int YAP_IsAttVar (Term t)
 
X_API Term YAP_AttsOfVar (Term t)
 
X_API int YAP_FileNoFromStream (Term t)
 
X_API void * YAP_FileDescriptorFromStream (Term t)
 
X_API void * YAP_Record (Term t)
 
X_API Term YAP_Recorded (void *handle)
 
X_API int YAP_Erase (void *handle)
 
X_API void YAP_SlotsToArgs (int n, yhandle_t slot)
 
X_API void YAP_signal (int sig)
 
X_API int YAP_SetYAPFlag (Term flag, Term val)
 
X_API yhandle_t YAP_VarSlotToNumber (yhandle_t s)
 
X_API Term YAP_ModuleUser (void)
 
X_API YAP_handle_t YAP_NumberOfClausesForPredicate (YAP_PredEntryPtr ape)
 
X_API int YAP_MaxOpPriority (YAP_Atom at, Term module)
 
X_API int YAP_OpInfo (YAP_Atom at, Term module, int opkind, int *yap_type, int *prio)
 
X_API int YAP_Argv (char ***argvp)
 
X_API YAP_tag_t YAP_TagOfTerm (Term t)
 
X_API void * YAP_PointerOfTerm (Term t)
 
X_API size_t YAP_UTF8_TextLength (Term t)
 Output the number of bytes needed to represent a string in UTF-8 Note that the terminating zero is not included. More...
 
X_API Int YAP_ListLength (Term t)
 
X_API Int YAP_NumberVars (Term t, Int nbv)
 
X_API Term YAP_UnNumberVars (Term t)
 
X_API int YAP_IsNumberedVariable (Term t)
 
X_API size_t YAP_ExportTerm (Term inp, char *buf, size_t len)
 
X_API Term YAP_ImportTerm (char *buf)
 
X_API size_t YAP_SizeOfExportedTerm (char *buf)
 
X_API Term YAP_ImportTfunnumberm (char *buf)
 
X_API int YAP_RequiresExtraStack (size_t sz)
 
X_API Int YAP_AtomToInt (YAP_Atom At)
 
X_API YAP_Atom YAP_IntToAtom (Int i)
 
X_API Int YAP_FunctorToInt (YAP_Functor f)
 
X_API void * YAP_foreign_stream (int sno)
 
X_API YAP_Functor YAP_IntToFunctor (Int i)
 
X_API YAP_PredEntryPtr YAP_TopGoal (void)
 
void yap_init (void)
 

Variables

int YAP_BPROLOG_exception
 
Term YAP_BPROLOG_curr_toam_status
 
atom_t * TR_Atoms
 
functor_t * TR_Functors
 
size_t AtomTranslations
 
size_t MaxAtomTranslations
 
size_t FunctorTranslations
 
size_t MaxFunctorTranslations