2002-09-09 18:45:51 +01:00
|
|
|
/*************************************************************************
|
|
|
|
* *
|
|
|
|
* YAP Prolog @(#)c_interface.h 2.2 *
|
|
|
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
|
|
|
* *
|
|
|
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
|
|
|
* *
|
|
|
|
**************************************************************************
|
|
|
|
* *
|
2003-01-29 14:47:17 +00:00
|
|
|
* File: YapInterface.h *
|
2002-09-09 18:45:51 +01:00
|
|
|
* Last rev: 19/2/88 *
|
|
|
|
* mods: *
|
|
|
|
* comments: c_interface header file for YAP *
|
|
|
|
* *
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
/******************* IMPORTANT ********************
|
|
|
|
Due to a limitation of the DecStation loader any function (including
|
|
|
|
library functions) which is linked to yap can not be called directly
|
|
|
|
from C code loaded dynamically.
|
|
|
|
To go around this problem we adopted the solution of calling such
|
|
|
|
functions indirectly
|
|
|
|
****************************************************/
|
|
|
|
|
2005-10-21 17:09:03 +01:00
|
|
|
#ifndef _yap_c_interface_h
|
|
|
|
|
|
|
|
#define _yap_c_interface_h 1
|
|
|
|
|
2007-10-09 12:43:44 +01:00
|
|
|
#define __YAP_PROLOG__ 1
|
|
|
|
|
2009-10-21 00:20:18 +01:00
|
|
|
#ifndef YAPVERSION
|
|
|
|
#define YAPVERSION 60000
|
|
|
|
#endif
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
#include "yap_structs.h"
|
|
|
|
|
2005-03-02 18:35:49 +00:00
|
|
|
#if HAVE_STDARG_H
|
|
|
|
#include <stdarg.h>
|
|
|
|
#endif
|
|
|
|
|
2007-09-04 11:34:55 +01:00
|
|
|
#include <wchar.h>
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/*
|
|
|
|
__BEGIN_DECLS should be used at the beginning of the C declarations,
|
|
|
|
so that C++ compilers don't mangle their names. __END_DECLS is used
|
|
|
|
at the end of C declarations.
|
|
|
|
*/
|
|
|
|
#undef __BEGIN_DECLS
|
|
|
|
#undef __END_DECLS
|
|
|
|
#ifdef __cplusplus
|
|
|
|
# define __BEGIN_DECLS extern "C" {
|
|
|
|
# define __END_DECLS }
|
|
|
|
#else
|
|
|
|
# define __BEGIN_DECLS /* empty */
|
|
|
|
# define __END_DECLS /* empty */
|
|
|
|
#endif /* _cplusplus */
|
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
#if defined(_MSC_VER) && defined(YAP_EXPORTS)
|
|
|
|
#define X_API __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define X_API
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Primitive Functions */
|
|
|
|
|
|
|
|
#define YAP_Deref(t) (t)
|
2011-02-10 00:01:19 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
extern X_API YAP_Term PROTO(YAP_A,(int));
|
|
|
|
#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)
|
|
|
|
|
|
|
|
/* YAP_Bool IsVarTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsVarTerm,(YAP_Term));
|
|
|
|
|
|
|
|
/* YAP_Bool IsNonVarTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsNonVarTerm,(YAP_Term));
|
|
|
|
|
|
|
|
/* YAP_Term MkVarTerm() */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkVarTerm,(void));
|
|
|
|
|
|
|
|
/* YAP_Bool IsIntTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsIntTerm,(YAP_Term));
|
|
|
|
|
2009-11-23 18:46:57 +00:00
|
|
|
/* YAP_Bool IsLongIntTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsLongIntTerm,(YAP_Term));
|
|
|
|
|
2004-05-14 18:11:32 +01:00
|
|
|
/* YAP_Bool IsBigNumTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsBigNumTerm,(YAP_Term));
|
|
|
|
|
2011-02-27 10:13:25 +00:00
|
|
|
/* YAP_Bool IsRationalTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsRationalTerm,(YAP_Term));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Bool IsFloatTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsFloatTerm,(YAP_Term));
|
|
|
|
|
2011-11-02 22:52:52 +00:00
|
|
|
/* YAP_Bool IsNumberTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsNumberTerm,(YAP_Term));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Bool IsDbRefTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsDbRefTerm,(YAP_Term));
|
|
|
|
|
|
|
|
/* YAP_Bool IsAtomTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsAtomTerm,(YAP_Term));
|
|
|
|
|
|
|
|
/* YAP_Bool IsPairTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsPairTerm,(YAP_Term));
|
|
|
|
|
|
|
|
/* YAP_Bool IsApplTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsApplTerm,(YAP_Term));
|
|
|
|
|
2011-11-02 22:52:52 +00:00
|
|
|
/* YAP_Bool IsCompoundTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsCompoundTerm,(YAP_Term));
|
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* Term MkIntTerm(YAP_Int) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkIntTerm,(YAP_Int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2004-05-14 18:11:32 +01:00
|
|
|
/* Term MkBigNumTerm(void *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkBigNumTerm,(void *));
|
|
|
|
|
2011-02-27 10:13:25 +00:00
|
|
|
/* Term MkRationalTerm(void *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkRationalTerm,(void *));
|
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* YAP_Int IntOfTerm(Term) */
|
|
|
|
extern X_API YAP_Int PROTO(YAP_IntOfTerm,(YAP_Term));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* void * BigNumOfTerm(Term) */
|
2006-01-02 03:35:45 +00:00
|
|
|
extern X_API void *PROTO(YAP_BigNumOfTerm,(YAP_Term, void *));
|
2004-05-14 18:11:32 +01:00
|
|
|
|
2011-02-27 10:13:25 +00:00
|
|
|
/* void * RationalOfTerm(Term) */
|
|
|
|
extern X_API void *PROTO(YAP_RationalOfTerm,(YAP_Term, void *));
|
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* Term MkFloatTerm(YAP_Float) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkFloatTerm,(YAP_Float));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* YAP_Float FloatOfTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Float PROTO(YAP_FloatOfTerm,(YAP_Term));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* Term MkAtomTerm(Atom) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkAtomTerm,(YAP_Atom));
|
|
|
|
|
|
|
|
/* YAP_Atom AtomOfTerm(Term) */
|
|
|
|
extern X_API YAP_Atom PROTO(YAP_AtomOfTerm,(YAP_Term));
|
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* YAP_Atom LookupAtom(const char *) */
|
|
|
|
extern X_API YAP_Atom PROTO(YAP_LookupAtom,(CONST char *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2007-09-04 11:34:55 +01:00
|
|
|
/* YAP_Atom LookupWideAtom(const wchar_t *) */
|
|
|
|
extern X_API YAP_Atom PROTO(YAP_LookupWideAtom,(CONST wchar_t *));
|
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* YAP_Atom FullLookupAtom(const char *) */
|
|
|
|
extern X_API YAP_Atom PROTO(YAP_FullLookupAtom,(CONST char *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2007-09-04 11:34:55 +01:00
|
|
|
/* int AtomNameLength(Atom) */
|
2011-02-10 00:01:19 +00:00
|
|
|
extern X_API size_t PROTO(YAP_AtomNameLength,(YAP_Atom));
|
2007-09-04 11:34:55 +01:00
|
|
|
|
|
|
|
/* const char* IsWideAtom(YAP_Atom) */
|
|
|
|
extern X_API int *PROTO(YAP_IsWideAtom,(YAP_Atom));
|
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* const char* AtomName(YAP_Atom) */
|
|
|
|
extern X_API CONST char *PROTO(YAP_AtomName,(YAP_Atom));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2007-09-04 11:34:55 +01:00
|
|
|
/* const wchar_t* AtomWideName(YAP_Atom) */
|
|
|
|
extern X_API CONST wchar_t *PROTO(YAP_WideAtomName,(YAP_Atom));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term MkPairTerm(YAP_Term Head, YAP_Term Tail) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkPairTerm,(YAP_Term,YAP_Term));
|
|
|
|
|
2011-11-18 16:26:11 +00:00
|
|
|
extern X_API YAP_Term PROTO(YAP_MkListFromTerms,(YAP_Term *,YAP_Int));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term MkNewPairTerm(void) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkNewPairTerm,(void));
|
|
|
|
|
|
|
|
/* Term HeadOfTerm(Term) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_HeadOfTerm,(YAP_Term));
|
|
|
|
|
|
|
|
/* Term TailOfTerm(Term) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_TailOfTerm,(YAP_Term));
|
|
|
|
|
2011-02-10 00:01:19 +00:00
|
|
|
/* Int AddressOfTailOfTerm(Term *, Term **) */
|
2012-01-09 23:29:31 +00:00
|
|
|
extern X_API YAP_Int PROTO(YAP_SkipList,(YAP_Term *, YAP_Term **));
|
2011-02-10 00:01:19 +00:00
|
|
|
|
2006-12-13 16:10:26 +00:00
|
|
|
/* Term TailOfTerm(Term) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_TermNil,(void));
|
|
|
|
|
2011-10-24 22:46:16 +01:00
|
|
|
extern X_API int PROTO(YAP_IsTermNil,(YAP_Term));
|
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* YAP_Term MkApplTerm(YAP_Functor f, unsigned int n, YAP_Term[] args) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkApplTerm,(YAP_Functor,unsigned int,YAP_Term *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* YAP_Term MkNewApplTerm(YAP_Functor f, unsigned int n) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkNewApplTerm,(YAP_Functor,unsigned int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Functor YAP_FunctorOfTerm(Term) */
|
|
|
|
extern X_API YAP_Functor PROTO(YAP_FunctorOfTerm,(YAP_Term));
|
|
|
|
|
|
|
|
/* YAP_Term ArgOfTerm(unsigned int argno,YAP_Term t) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_ArgOfTerm,(unsigned int,YAP_Term));
|
|
|
|
|
2007-06-04 13:28:02 +01:00
|
|
|
/* YAP_Term *ArgsOfTerm(YAP_Term t) */
|
|
|
|
extern X_API YAP_Term *PROTO(YAP_ArgsOfTerm,(YAP_Term));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Functor MkFunctor(YAP_Atom a,int arity) */
|
2005-05-25 19:18:02 +01:00
|
|
|
extern X_API YAP_Functor PROTO(YAP_MkFunctor,(YAP_Atom,unsigned int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Atom NameOfFunctor(Functor) */
|
|
|
|
extern X_API YAP_Atom PROTO(YAP_NameOfFunctor,(YAP_Functor));
|
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* unsigned unsigned int YAP_ArityOfFunctor(Functor) */
|
|
|
|
extern X_API unsigned int PROTO(YAP_ArityOfFunctor,(YAP_Functor));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void ExtraSpace(void) */
|
|
|
|
extern X_API void *PROTO(YAP_ExtraSpace,(void));
|
2005-11-18 18:52:41 +00:00
|
|
|
extern X_API void *PROTO(YAP_ExtraSpaceCut,(void));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
#define YAP_PRESERVE_DATA(ptr, type) (ptr = (type *)YAP_ExtraSpace())
|
|
|
|
#define YAP_PRESERVED_DATA(ptr, type) (ptr = (type *)YAP_ExtraSpace())
|
2005-11-18 18:52:41 +00:00
|
|
|
#define YAP_PRESERVED_DATA_CUT(ptr,type) (ptr = (type *)YAP_ExtraSpaceCut())
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Bool unify(YAP_Term a, YAP_Term b) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_Unify,(YAP_Term, YAP_Term));
|
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* void UserCPredicate(const char *name, int *fn(), int arity) */
|
|
|
|
extern X_API void PROTO(YAP_UserCPredicate,(CONST char *, YAP_Bool (*)(void), unsigned int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* void UserCPredicateWithArgs(const char *name, int *fn(), unsigned int arity) */
|
2010-05-10 10:22:18 +01:00
|
|
|
extern X_API void PROTO(YAP_UserCPredicateWithArgs,(CONST char *, YAP_Bool (*)(void), YAP_Arity, YAP_Term));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* void UserBackCPredicate(const char *name, int *init(), int *cont(), int
|
2002-09-09 18:45:51 +01:00
|
|
|
arity, int extra) */
|
2010-05-10 10:22:18 +01:00
|
|
|
extern X_API void PROTO(YAP_UserBackCPredicate,(CONST char *, YAP_Bool (*)(void), YAP_Bool (*)(void), YAP_Arity, unsigned int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-11-02 22:52:52 +00:00
|
|
|
/* YAP_Int YAP_ListLength(YAP_Term t) */
|
|
|
|
extern X_API YAP_Int PROTO(YAP_ListLength,(YAP_Term));
|
|
|
|
|
2005-11-18 18:52:41 +00:00
|
|
|
/* void UserBackCPredicate(char *name, int *init(), int *cont(), int *cut(), int
|
|
|
|
arity, int extra) */
|
2011-07-25 08:57:35 +01:00
|
|
|
extern X_API void PROTO(YAP_UserBackCutCPredicate,(CONST char *, YAP_Bool (*)(void), YAP_Bool (*)(void), YAP_Bool (*)(void), YAP_Arity, unsigned int));
|
2005-11-18 18:52:41 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* void CallProlog(YAP_Term t) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_CallProlog,(YAP_Term t));
|
|
|
|
|
|
|
|
/* void cut_fail(void) */
|
2005-10-21 17:09:03 +01:00
|
|
|
extern X_API void PROTO(YAP_cut_up,(void));
|
|
|
|
|
2011-07-21 12:18:35 +01:00
|
|
|
#define YAP_cut_succeed() do { YAP_cut_up(); return TRUE; } while(0)
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-07-21 12:18:35 +01:00
|
|
|
#define YAP_cut_fail() do { YAP_cut_up(); return FALSE; } while(0)
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void *AllocSpaceFromYAP_(int) */
|
|
|
|
extern X_API void *PROTO(YAP_AllocSpaceFromYap,(unsigned int));
|
|
|
|
|
2009-11-19 21:09:22 +00:00
|
|
|
/* void *ReallocSpaceFromYAP_(void*,int) */
|
|
|
|
extern X_API void *PROTO(YAP_ReallocSpaceFromYap,(void*,unsigned int));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* void FreeSpaceFromYAP_(void *) */
|
|
|
|
extern X_API void PROTO(YAP_FreeSpaceFromYap,(void *));
|
|
|
|
|
|
|
|
/* int YAP_RunGoal(YAP_Term) */
|
2011-12-13 23:09:05 +00:00
|
|
|
extern X_API YAP_Int PROTO(YAP_RunGoal,(YAP_Term));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2008-06-04 14:58:42 +01:00
|
|
|
/* int YAP_RunGoalOnce(YAP_Term) */
|
2011-12-13 23:09:05 +00:00
|
|
|
extern X_API YAP_Int PROTO(YAP_RunGoalOnce,(YAP_Term));
|
2008-06-04 14:58:42 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int YAP_RestartGoal(void) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_RestartGoal,(void));
|
|
|
|
|
2007-05-15 12:33:51 +01:00
|
|
|
/* int YAP_ShutdownGoal(int) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_ShutdownGoal,(int));
|
2007-05-14 17:44:12 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int YAP_ContinueGoal(void) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_ContinueGoal,(void));
|
|
|
|
|
2007-06-04 13:28:02 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* void YAP_PruneGoal(void) */
|
|
|
|
extern X_API void PROTO(YAP_PruneGoal,(void));
|
|
|
|
|
2007-06-04 13:28:02 +01:00
|
|
|
/* int YAP_FunctorToPred(struct pred_entry *, YAP_Term *) */
|
|
|
|
extern X_API YAP_PredEntryPtr PROTO(YAP_FunctorToPred,(YAP_Functor));
|
|
|
|
|
|
|
|
/* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */
|
|
|
|
extern X_API YAP_PredEntryPtr PROTO(YAP_AtomToPred,(YAP_Atom));
|
|
|
|
|
|
|
|
/* int YAP_EnterGoal(void) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_EnterGoal,(YAP_PredEntryPtr, YAP_Term *, YAP_dogoalinfo *));
|
|
|
|
|
|
|
|
/* int YAP_RetryGoal(void) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_RetryGoal,(YAP_dogoalinfo *));
|
|
|
|
|
|
|
|
/* int YAP_LeaveGoal(void) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_LeaveGoal,(int, YAP_dogoalinfo *));
|
|
|
|
|
2005-08-17 14:35:52 +01:00
|
|
|
/* int YAP_GoalHasException(YAP_Term *) */
|
2002-09-09 18:45:51 +01:00
|
|
|
extern X_API YAP_Bool PROTO(YAP_GoalHasException,(YAP_Term *));
|
|
|
|
|
2005-08-17 14:35:52 +01:00
|
|
|
/* void YAP_ClearExceptions(void) */
|
|
|
|
extern X_API void PROTO(YAP_ClearExceptions,(void));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int YAP_Reset(void) */
|
|
|
|
extern X_API void PROTO(YAP_Reset,(void));
|
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* void YAP_Error(int, YAP_Term, const char *,...) */
|
|
|
|
extern X_API void PROTO(YAP_Error,(int, YAP_Term, CONST char *, ...));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-02-15 07:39:27 +00:00
|
|
|
/* YAP_Term YAP_Read(void *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_Read,(void *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void YAP_Write(YAP_Term,void (*)(int),int) */
|
2011-11-02 22:52:52 +00:00
|
|
|
extern X_API void PROTO(YAP_Write,(YAP_Term,void *,int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2008-07-24 17:02:04 +01:00
|
|
|
/* void YAP_WriteBufffer(YAP_Term,char *,unsgined int,int) */
|
2004-05-14 18:56:47 +01:00
|
|
|
extern X_API void PROTO(YAP_WriteBuffer,(YAP_Term,char *,unsigned int,int));
|
|
|
|
|
2007-05-14 17:44:12 +01:00
|
|
|
/* void YAP_Term(YAP_Term) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_CopyTerm,(YAP_Term));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* char *YAP_CompileClause(YAP_Term) */
|
|
|
|
extern X_API char *PROTO(YAP_CompileClause,(YAP_Term));
|
|
|
|
|
|
|
|
/* int YAP_Init(YAP_init_args *) */
|
|
|
|
extern X_API int PROTO(YAP_Init,(YAP_init_args *));
|
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* int YAP_FastInit(const char *) */
|
|
|
|
extern X_API int PROTO(YAP_FastInit,(CONST char *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-05-25 13:10:39 +01:00
|
|
|
/* void * YAP_TermToStream(YAP_Term) */
|
|
|
|
extern X_API void * PROTO(YAP_TermToStream,(YAP_Term));
|
|
|
|
|
2011-02-15 07:39:27 +00:00
|
|
|
/* void * YAP_InitConsult(int, const char *) */
|
|
|
|
extern X_API void * PROTO(YAP_InitConsult,(int, CONST char *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* int YAP_EndConsult(void) */
|
2011-02-15 07:39:27 +00:00
|
|
|
extern X_API int PROTO(YAP_EndConsult,(void *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void YAP_Exit(int) */
|
|
|
|
extern X_API void PROTO(YAP_Exit,(int));
|
|
|
|
|
|
|
|
/* void YAP_PutValue(YAP_Atom, YAP_Term) */
|
|
|
|
extern X_API void PROTO(YAP_PutValue,(YAP_Atom, YAP_Term));
|
|
|
|
|
|
|
|
/* YAP_Term YAP_GetValue(YAP_Atom) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_GetValue,(YAP_Atom));
|
|
|
|
|
2011-12-30 16:04:16 +00:00
|
|
|
extern X_API YAP_Term PROTO(YAP_FloatsToList,(YAP_Float *, size_t));
|
2012-03-14 11:08:28 +00:00
|
|
|
extern X_API YAP_Int PROTO(YAP_ListToFloats,(YAP_Term, YAP_Float *, size_t));
|
|
|
|
|
|
|
|
extern X_API YAP_Term PROTO(YAP_IntsToList,(YAP_Int *, size_t));
|
|
|
|
extern X_API YAP_Int PROTO(YAP_ListToInts,(YAP_Term, YAP_Int *, size_t));
|
2011-12-30 16:04:16 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int StringToBuffer(YAP_Term,char *,unsigned int) */
|
|
|
|
extern X_API int PROTO(YAP_StringToBuffer,(YAP_Term,char *,unsigned int));
|
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* int BufferToString(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_BufferToString,(CONST char *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2008-07-24 17:02:04 +01:00
|
|
|
/* int BufferToString(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_NBufferToString,(CONST char *, size_t len));
|
|
|
|
|
|
|
|
/* int BufferToString(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_WideBufferToString,(CONST wchar_t *));
|
|
|
|
|
|
|
|
/* int BufferToString(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_NWideBufferToString,(CONST wchar_t *, size_t len));
|
2004-05-14 17:33:47 +01:00
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* int BufferToAtomList(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_BufferToAtomList,(CONST char *));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2008-07-24 17:02:04 +01:00
|
|
|
/* int BufferToAtomList(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_NBufferToAtomList,(CONST char *, size_t len));
|
|
|
|
|
|
|
|
/* int BufferToAtomList(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_WideBufferToAtomList,(CONST wchar_t *));
|
|
|
|
|
|
|
|
/* int BufferToAtomList(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_NWideBufferToAtomList,(CONST wchar_t *, size_t len));
|
|
|
|
|
2008-12-17 14:47:05 +00:00
|
|
|
/* int BufferToDiffList(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_NWideBufferToAtomDiffList,(CONST wchar_t *, YAP_Term, size_t len));
|
|
|
|
|
2008-07-24 17:02:04 +01:00
|
|
|
/* int BufferToDiffList(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_BufferToDiffList,(CONST char *));
|
|
|
|
|
|
|
|
/* int BufferToDiffList(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_NBufferToDiffList,(CONST char *, size_t len));
|
|
|
|
|
|
|
|
/* int BufferToDiffList(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_WideBufferToDiffList,(CONST wchar_t *));
|
|
|
|
|
|
|
|
/* int BufferToDiffList(const char *) */
|
2008-12-17 14:47:05 +00:00
|
|
|
extern X_API YAP_Term PROTO(YAP_NWideBufferToDiffList,(CONST wchar_t *, YAP_Term, size_t len));
|
2008-07-24 17:02:04 +01:00
|
|
|
|
|
|
|
/* YAP_Term BufferToTerm(const char *) */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_ReadBuffer,(CONST char *,YAP_Term *));
|
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* void YAP_InitSocks(const char *,long) */
|
|
|
|
extern X_API int PROTO(YAP_InitSocks,(CONST char *,long));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
#ifdef SFUNC
|
|
|
|
|
|
|
|
#define SFArity 0
|
|
|
|
extern X_API YAP_Term *ArgsOfSFTerm();
|
|
|
|
|
|
|
|
extern X_API YAP_Term MkSFTerm();
|
|
|
|
|
|
|
|
#endif /* SFUNC */
|
|
|
|
|
2008-07-11 18:02:10 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
extern X_API void PROTO(YAP_SetOutputMessage,(void));
|
|
|
|
|
|
|
|
extern X_API int PROTO(YAP_StreamToFileNo,(YAP_Term));
|
|
|
|
|
|
|
|
extern X_API void PROTO(YAP_CloseAllOpenStreams,(void));
|
|
|
|
|
2008-07-11 18:02:10 +01:00
|
|
|
extern X_API void PROTO(YAP_FlushAllStreams,(void));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
#define YAP_INPUT_STREAM 0x01
|
|
|
|
#define YAP_OUTPUT_STREAM 0x02
|
|
|
|
#define YAP_APPEND_STREAM 0x04
|
|
|
|
#define YAP_PIPE_STREAM 0x08
|
|
|
|
#define YAP_TTY_STREAM 0x10
|
|
|
|
#define YAP_POPEN_STREAM 0x20
|
|
|
|
#define YAP_BINARY_STREAM 0x40
|
|
|
|
#define YAP_SEEKABLE_STREAM 0x80
|
|
|
|
|
|
|
|
/* YAP_Term *YAP_NewSlots() */
|
2010-05-10 10:22:18 +01:00
|
|
|
extern X_API YAP_Int PROTO(YAP_NewSlots,(int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2010-05-10 10:22:18 +01:00
|
|
|
/* YAP_Int YAP_CurrentSlot() */
|
|
|
|
extern X_API YAP_Int PROTO(YAP_CurrentSlot,(void));
|
2007-05-14 17:44:12 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term *YAP_InitSlot() */
|
2010-05-10 10:22:18 +01:00
|
|
|
extern X_API YAP_Int PROTO(YAP_InitSlot,(YAP_Term));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Term YAP_GetFromSlots(t) */
|
2010-05-10 22:14:08 +01:00
|
|
|
extern X_API YAP_Term PROTO(YAP_GetFromSlot,(YAP_Int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-02-10 00:01:19 +00:00
|
|
|
/* YAP_Term *YAP_AddressFromSlots(t) */
|
2010-05-10 22:14:08 +01:00
|
|
|
extern X_API YAP_Term *PROTO(YAP_AddressFromSlot,(YAP_Int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-02-10 00:01:19 +00:00
|
|
|
/* YAP_Term *YAP_AddressOfTermInSlot(t) */
|
|
|
|
extern X_API YAP_Term *PROTO(YAP_AddressOfTermInSlot,(YAP_Int));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term YAP_PutInSlots(t) */
|
2010-05-10 22:14:08 +01:00
|
|
|
extern X_API void PROTO(YAP_PutInSlot,(YAP_Int, YAP_Term));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void YAP_RecoverSlots() */
|
2008-06-17 14:37:51 +01:00
|
|
|
extern X_API int PROTO(YAP_RecoverSlots,(int));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2010-08-04 17:36:20 +01:00
|
|
|
/* void YAP_RecoverSlots() */
|
|
|
|
extern X_API YAP_Int PROTO(YAP_ArgsToSlots,(int));
|
|
|
|
|
|
|
|
/* void YAP_RecoverSlots() */
|
|
|
|
extern X_API void PROTO(YAP_SlotsToArgs,(int, YAP_Int));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* void YAP_Throw() */
|
|
|
|
extern X_API void PROTO(YAP_Throw,(YAP_Term));
|
|
|
|
|
2010-12-04 19:05:13 +00:00
|
|
|
/* void YAP_AsyncThrow() */
|
|
|
|
extern X_API void PROTO(YAP_AsyncThrow,(YAP_Term));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int YAP_LookupModule() */
|
2004-02-12 12:37:12 +00:00
|
|
|
#define YAP_LookupModule(T) (T)
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2004-05-17 22:42:12 +01:00
|
|
|
#define YAP_ModuleName(mod) (mod)
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* int YAP_Halt() */
|
|
|
|
extern X_API int PROTO(YAP_Halt,(int));
|
|
|
|
|
|
|
|
/* int YAP_TopOfLocalStack() */
|
|
|
|
extern X_API YAP_Term *PROTO(YAP_TopOfLocalStack,(void));
|
|
|
|
|
|
|
|
/* int YAP_Predicate() */
|
2010-05-10 10:22:18 +01:00
|
|
|
extern X_API void *PROTO(YAP_Predicate,(YAP_Atom,YAP_Arity,YAP_Term));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* int YAP_Predicate() */
|
2010-05-10 10:22:18 +01:00
|
|
|
extern X_API void PROTO(YAP_PredicateInfo,(void *,YAP_Atom *,YAP_Arity*,YAP_Module*));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2004-07-22 22:32:23 +01:00
|
|
|
/* int YAP_CurrentModule() */
|
2004-08-11 17:14:55 +01:00
|
|
|
extern X_API YAP_Module PROTO(YAP_CurrentModule,(void));
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-02-14 22:13:45 +00:00
|
|
|
/* int YAP_SetCurrentModule() */
|
|
|
|
extern X_API YAP_Module PROTO(YAP_SetCurrentModule,(YAP_Module));
|
|
|
|
|
|
|
|
/* int YAP_CreateModule() */
|
2004-08-11 17:14:55 +01:00
|
|
|
extern X_API YAP_Module PROTO(YAP_CreateModule,(YAP_Atom));
|
|
|
|
|
2008-08-01 22:44:25 +01:00
|
|
|
/* int YAP_StripModule() */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_StripModule,(YAP_Term, YAP_Module *));
|
|
|
|
|
2007-12-05 12:17:25 +00:00
|
|
|
/* int YAP_AtomGetHold(YAP_Atom) */
|
|
|
|
extern X_API int PROTO(YAP_AtomGetHold,(YAP_Atom));
|
|
|
|
|
|
|
|
/* int YAP_AtomReleaseHold(YAP_Atom) */
|
|
|
|
extern X_API int PROTO(YAP_AtomReleaseHold,(YAP_Atom));
|
|
|
|
|
|
|
|
/* void YAP_AtomReleaseHold(YAP_Atom) */
|
2008-02-12 17:03:59 +00:00
|
|
|
extern X_API YAP_agc_hook PROTO(YAP_AGCRegisterHook,(YAP_agc_hook));
|
2007-12-05 12:17:25 +00:00
|
|
|
|
2010-09-24 14:00:53 +01:00
|
|
|
/* void YAP_AtomReleaseHold(YAP_Atom) */
|
|
|
|
extern X_API int PROTO(YAP_HaltRegisterHook,(YAP_halt_hook, void *));
|
|
|
|
|
2008-12-13 16:07:55 +00:00
|
|
|
/* char *YAP_cwd(void) */
|
|
|
|
extern X_API char * PROTO(YAP_cwd,(void));
|
|
|
|
|
2004-08-11 17:14:55 +01:00
|
|
|
/* thread stuff */
|
2010-07-23 15:54:13 +01:00
|
|
|
extern X_API int PROTO(YAP_ThreadSelf,(void));
|
|
|
|
extern X_API int PROTO(YAP_ThreadCreateEngine,(YAP_thread_attr *));
|
|
|
|
extern X_API int PROTO(YAP_ThreadAttachEngine,(int));
|
|
|
|
extern X_API int PROTO(YAP_ThreadDetachEngine,(int));
|
|
|
|
extern X_API int PROTO(YAP_ThreadDestroyEngine,(int));
|
2004-08-11 17:14:55 +01:00
|
|
|
|
2006-12-13 16:10:26 +00:00
|
|
|
/* blob stuff */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_MkBlobTerm,(unsigned int));
|
|
|
|
extern X_API void *PROTO(YAP_BlobOfTerm,(YAP_Term));
|
2006-05-16 19:37:31 +01:00
|
|
|
|
2004-08-11 17:14:55 +01:00
|
|
|
/* term comparison */
|
|
|
|
extern X_API int PROTO(YAP_CompareTerms,(YAP_Term, YAP_Term));
|
2004-07-22 22:32:23 +01:00
|
|
|
|
2008-12-22 13:49:44 +00:00
|
|
|
/* list construction */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_OpenList,(int));
|
|
|
|
extern X_API YAP_Term PROTO(YAP_ExtendList,(YAP_Term, YAP_Term));
|
|
|
|
extern X_API int PROTO(YAP_CloseList,(YAP_Term, YAP_Term));
|
|
|
|
|
2009-02-09 22:45:50 +00:00
|
|
|
/* attributed variables */
|
|
|
|
extern X_API int PROTO(YAP_IsAttVar,(YAP_Term));
|
|
|
|
extern X_API YAP_Term PROTO(YAP_AttsOfVar,(YAP_Term));
|
|
|
|
|
2009-04-22 22:41:41 +01:00
|
|
|
/* stream info */
|
|
|
|
extern X_API void *PROTO(YAP_FileDescriptorFromStream,(YAP_Term));
|
2009-04-23 03:42:15 +01:00
|
|
|
extern X_API int PROTO(YAP_FileNoFromStream,(YAP_Term));
|
2009-04-22 22:41:41 +01:00
|
|
|
|
2010-08-02 19:48:17 +01:00
|
|
|
/* store and recover terms */
|
|
|
|
extern X_API void *PROTO(YAP_Record,(YAP_Term));
|
|
|
|
extern X_API YAP_Term PROTO(YAP_Recorded,(void *));
|
|
|
|
extern X_API int PROTO(YAP_Erase,(void *));
|
|
|
|
|
|
|
|
/* term utilities */
|
|
|
|
extern X_API int PROTO(YAP_Variant,(YAP_Term,YAP_Term));
|
2011-11-02 22:52:52 +00:00
|
|
|
extern X_API YAP_Int PROTO(YAP_NumberVars,(YAP_Term,YAP_Int));
|
|
|
|
extern X_API YAP_Term PROTO(YAP_UnNumberVars,(YAP_Term));
|
|
|
|
extern X_API int PROTO(YAP_IsNumberedVariable,(YAP_Term));
|
2011-10-27 11:35:07 +01:00
|
|
|
extern X_API int PROTO(YAP_Unifiable,(YAP_Term,YAP_Term));
|
2010-08-02 19:48:17 +01:00
|
|
|
extern X_API int PROTO(YAP_ExactlyEqual,(YAP_Term,YAP_Term));
|
|
|
|
extern X_API YAP_Int PROTO(YAP_TermHash,(YAP_Term, YAP_Int, YAP_Int, int));
|
|
|
|
|
2011-02-03 11:23:12 +00:00
|
|
|
extern X_API void PROTO(YAP_signal,(int));
|
|
|
|
|
2010-08-31 04:25:56 +01:00
|
|
|
/* stack expansion control */
|
|
|
|
extern X_API int PROTO(YAP_SetYAPFlag,(yap_flag_t,int));
|
|
|
|
|
2011-02-10 00:01:19 +00:00
|
|
|
/* void *YAP_GlobalBase(Term) */
|
|
|
|
extern X_API YAP_Int PROTO(YAP_VarSlotToNumber,(YAP_Int));
|
|
|
|
|
|
|
|
/* Term YAP_ModuleUser() */
|
|
|
|
extern X_API YAP_Term PROTO(YAP_ModuleUser,(void));
|
|
|
|
|
|
|
|
/* Int YAP_NumberOfClausesForPredicate() */
|
|
|
|
extern X_API YAP_Int PROTO(YAP_NumberOfClausesForPredicate,(YAP_PredEntryPtr));
|
|
|
|
|
2011-02-10 21:14:38 +00:00
|
|
|
/* int YAP_MaxOpPriority(Atom, Term) */
|
|
|
|
extern X_API int PROTO(YAP_MaxOpPriority,(YAP_Atom, YAP_Term));
|
|
|
|
|
|
|
|
/* int YAP_OpInfo(Atom, Term, int, int *, int *) */
|
|
|
|
extern X_API int PROTO(YAP_OpInfo,(YAP_Atom, YAP_Term, int, int *, int *));
|
|
|
|
|
2011-07-21 14:32:49 +01:00
|
|
|
/* YAP_Bool YAP_IsExternalDataInStackTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsExternalDataInStackTerm,(YAP_Term));
|
|
|
|
|
2011-07-22 12:09:33 +01:00
|
|
|
extern X_API YAP_opaque_tag_t PROTO(YAP_NewOpaqueType,(struct YAP_opaque_handler_struct *));
|
2011-07-21 14:32:49 +01:00
|
|
|
|
2011-07-22 12:09:33 +01:00
|
|
|
extern X_API YAP_Bool PROTO(YAP_IsOpaqueObjectTerm,(YAP_Term, YAP_opaque_tag_t));
|
|
|
|
|
|
|
|
extern X_API YAP_Term PROTO(YAP_NewOpaqueObject,(YAP_opaque_tag_t, size_t));
|
|
|
|
|
|
|
|
extern X_API void *PROTO(YAP_OpaqueObjectFromTerm,(YAP_Term));
|
2011-07-21 14:32:49 +01:00
|
|
|
|
2012-02-03 16:31:49 +00:00
|
|
|
extern X_API int PROTO(YAP_Argv,(char ***));
|
2011-10-13 16:46:39 +01:00
|
|
|
|
2011-10-27 11:35:07 +01:00
|
|
|
extern X_API YAP_tag_t PROTO(YAP_TagOfTerm,(YAP_Term));
|
|
|
|
|
2012-02-02 09:58:05 +00:00
|
|
|
extern X_API size_t PROTO(YAP_ExportTerm,(YAP_Term, char *, size_t));
|
2012-02-01 19:26:28 +00:00
|
|
|
|
2012-02-03 16:31:49 +00:00
|
|
|
extern X_API size_t PROTO(YAP_SizeOfExportedTerm,(char *));
|
|
|
|
|
2012-02-01 19:26:28 +00:00
|
|
|
extern X_API YAP_Term PROTO(YAP_ImportTerm,(char *));
|
|
|
|
|
2012-03-30 09:49:36 +01:00
|
|
|
extern X_API int PROTO(YAP_RequiresExtraStack,(size_t));
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
#define YAP_InitCPred(N,A,F) YAP_UserCPredicate(N,F,A)
|
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|