2002-09-09 18:45:51 +01:00
|
|
|
/*************************************************************************
|
2017-04-07 23:10:59 +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 *
|
|
|
|
* *
|
|
|
|
**************************************************************************
|
|
|
|
* *
|
|
|
|
* File: YapInterface.h *
|
|
|
|
* Last rev: 19/2/88 *
|
|
|
|
* mods: *
|
|
|
|
* comments: c_interface header file for YAP *
|
|
|
|
* *
|
|
|
|
*************************************************************************/
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-09-11 20:06:57 +01:00
|
|
|
/**
|
|
|
|
|
2017-04-07 23:10:59 +01:00
|
|
|
@file YapInterface.h
|
2014-09-11 20:06:57 +01:00
|
|
|
|
2017-04-13 21:42:34 +01:00
|
|
|
@addtogroup ChYInterface
|
2017-04-07 23:10:59 +01:00
|
|
|
@{
|
|
|
|
|
2017-04-13 21:42:34 +01:00
|
|
|
\
|
2017-04-07 23:10:59 +01:00
|
|
|
@brief Core interface to YAP.
|
|
|
|
|
|
|
|
@toc
|
2014-12-24 15:32:29 +00:00
|
|
|
|
2014-09-11 20:06:57 +01:00
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
|
2014-07-27 01:14:15 +01:00
|
|
|
#ifndef YAPVERSION
|
2016-01-31 10:35:53 +00:00
|
|
|
#define YAPVERSION 60000
|
2014-07-27 01:14:15 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "YapDefs.h"
|
|
|
|
|
|
|
|
#if HAVE_STDARG_H
|
|
|
|
#include <stdarg.h>
|
|
|
|
#endif
|
|
|
|
|
2016-01-31 10:35:53 +00:00
|
|
|
#if HAVE_STDBOOL_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#endif
|
|
|
|
|
2014-07-27 01:14:15 +01:00
|
|
|
#include <wchar.h>
|
|
|
|
|
2016-01-31 10:35:53 +00: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
|
2016-04-05 02:28:56 +01:00
|
|
|
#define __BEGIN_DECLS extern "C" {
|
|
|
|
#define __END_DECLS }
|
2016-01-31 10:35:53 +00:00
|
|
|
#else
|
2016-04-05 02:28:56 +01:00
|
|
|
#define __BEGIN_DECLS /* empty */
|
|
|
|
#define __END_DECLS /* empty */
|
|
|
|
#endif /* _cplusplus */
|
2016-01-31 10:35:53 +00:00
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
/**
|
|
|
|
* X_API macro
|
2016-01-31 10:35:53 +00:00
|
|
|
*
|
|
|
|
* brif
|
2016-04-05 02:28:56 +01:00
|
|
|
*
|
|
|
|
* @param _WIN32
|
|
|
|
*
|
|
|
|
* @return
|
2016-01-31 10:35:53 +00:00
|
|
|
*/
|
2016-07-31 15:55:50 +01:00
|
|
|
|
2017-02-20 15:28:46 +00:00
|
|
|
#include "YapFormat.h"
|
2016-07-31 15:55:50 +01:00
|
|
|
|
2016-01-31 10:35:53 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* Primitive Functions */
|
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
#define YAP_Deref(t) (t)
|
2011-02-10 00:01:19 +00:00
|
|
|
|
2016-01-31 10:35:53 +00:00
|
|
|
X_API
|
|
|
|
extern YAP_Term YAP_A(int);
|
2016-04-05 02:28:56 +01:00
|
|
|
#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)
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Bool IsVarTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsVarTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Bool IsNonVarTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsNonVarTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Term MkVarTerm() */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_MkVarTerm(void);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Bool IsIntTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsIntTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2009-11-23 18:46:57 +00:00
|
|
|
/* YAP_Bool IsLongIntTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsLongIntTerm(YAP_Term);
|
2009-11-23 18:46:57 +00:00
|
|
|
|
2004-05-14 18:11:32 +01:00
|
|
|
/* YAP_Bool IsBigNumTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsBigNumTerm(YAP_Term);
|
2004-05-14 18:11:32 +01:00
|
|
|
|
2011-02-27 10:13:25 +00:00
|
|
|
/* YAP_Bool IsRationalTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsRationalTerm(YAP_Term);
|
2011-02-27 10:13:25 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Bool IsFloatTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsFloatTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-11-02 22:52:52 +00:00
|
|
|
/* YAP_Bool IsNumberTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsNumberTerm(YAP_Term);
|
2011-11-02 22:52:52 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Bool IsDbRefTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsDbRefTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Bool IsAtomTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsAtomTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2017-02-20 15:28:46 +00:00
|
|
|
/* YAP_Bool IsAtomTerm(YAP_Term) */
|
|
|
|
extern X_API YAP_Bool YAP_IsStringTerm(YAP_Term);
|
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Bool IsPairTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsPairTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Bool IsApplTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsApplTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-11-02 22:52:52 +00:00
|
|
|
/* YAP_Bool IsCompoundTerm(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsCompoundTerm(YAP_Term);
|
2011-11-02 22:52:52 +00:00
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* Term MkIntTerm(YAP_Int) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_MkIntTerm(YAP_Int);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2017-02-20 15:28:46 +00:00
|
|
|
/* Term MkIntTerm(YAP_Int) */
|
|
|
|
extern X_API YAP_Term YAP_MkStringTerm(const char *);
|
|
|
|
|
|
|
|
/* Term MkIntTerm(YAP_Int) */
|
|
|
|
extern X_API YAP_Term YAP_MkUnsignedStringTerm(const unsigned char *);
|
|
|
|
|
2004-05-14 18:11:32 +01:00
|
|
|
/* Term MkBigNumTerm(void *) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_MkBigNumTerm(void *);
|
2004-05-14 18:11:32 +01:00
|
|
|
|
2011-02-27 10:13:25 +00:00
|
|
|
/* Term MkRationalTerm(void *) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_MkRationalTerm(void *);
|
2011-02-27 10:13:25 +00:00
|
|
|
|
2017-02-20 15:28:46 +00:00
|
|
|
/* YAP_Int IntOfTerm(Term) */
|
|
|
|
extern X_API const unsigned char *YAP_UnsignedStringOfTerm(YAP_Term);
|
|
|
|
|
|
|
|
/* YAP_Int StribgOfTerm(Term) */
|
|
|
|
extern X_API const char *YAP_StringOfTerm(YAP_Term);
|
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* YAP_Int IntOfTerm(Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Int YAP_IntOfTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* void * BigNumOfTerm(Term) */
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Bool YAP_BigNumOfTerm(YAP_Term t, void *b);
|
2004-05-14 18:11:32 +01:00
|
|
|
|
2011-02-27 10:13:25 +00:00
|
|
|
/* void * RationalOfTerm(Term) */
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Bool YAP_RationalOfTerm(YAP_Term, void *);
|
2011-02-27 10:13:25 +00:00
|
|
|
|
2005-05-25 19:18:02 +01:00
|
|
|
/* Term MkFloatTerm(YAP_Float) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term 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) */
|
2014-07-27 01:14:15 +01:00
|
|
|
// extract a floating point number for a term t. The type `flt` is a typedef for
|
|
|
|
// the appropriate C floating point type,
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Float YAP_FloatOfTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* Term MkAtomTerm(Atom) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_MkAtomTerm(YAP_Atom);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Atom AtomOfTerm(Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Atom YAP_AtomOfTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Atom YAP_LookupAtom(const char *c);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Atom YAP_LookupWideAtom(const wchar_t *c);
|
2007-09-04 11:34:55 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Atom YAP_FullLookupAtom(const char *c);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2007-09-04 11:34:55 +01:00
|
|
|
/* int AtomNameLength(Atom) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API size_t YAP_AtomNameLength(YAP_Atom);
|
2007-09-04 11:34:55 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsWideAtom(YAP_Atom a);
|
2007-09-04 11:34:55 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API const char *YAP_AtomName(YAP_Atom a);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API const wchar_t *YAP_WideAtomName(YAP_Atom a);
|
2007-09-04 11:34:55 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term MkPairTerm(YAP_Term Head, YAP_Term Tail) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_MkPairTerm(YAP_Term, YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_MkListFromTerms(YAP_Term *, YAP_Int);
|
2011-11-18 16:26:11 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term MkNewPairTerm(void) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_MkNewPairTerm(void);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* Term HeadOfTerm(Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_HeadOfTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* Term TailOfTerm(Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_TailOfTerm(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-02-10 00:01:19 +00:00
|
|
|
/* Int AddressOfTailOfTerm(Term *, Term **) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Int 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) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_TermNil(void);
|
2006-12-13 16:10:26 +00:00
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API int YAP_IsTermNil(YAP_Term);
|
2011-10-24 22:46:16 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_MkApplTerm(YAP_Functor functor, YAP_UInt arity,
|
|
|
|
YAP_Term args[]);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_MkNewApplTerm(YAP_Functor f, YAP_UInt arity);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Functor YAP_FunctorOfTerm(YAP_Term t);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_ArgOfTerm(YAP_UInt n, YAP_Term t);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term *YAP_ArgsOfTerm(YAP_Term t);
|
2007-06-04 13:28:02 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Functor YAP_MkFunctor(YAP_Atom a, YAP_UInt n);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Atom YAP_NameOfFunctor(YAP_Functor g);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_UInt YAP_ArityOfFunctor(YAP_Functor f);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void ExtraSpace(void) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void *YAP_ExtraSpace(void);
|
|
|
|
extern X_API void *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())
|
2016-04-05 02:28:56 +01:00
|
|
|
#define YAP_PRESERVED_DATA_CUT(ptr, type) (ptr = (type *)YAP_ExtraSpaceCut())
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Bool YAP_Unify(YAP_Term t1, YAP_Term t2);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void YAP_UserCPredicate(const char *, YAP_UserCPred,
|
|
|
|
YAP_Arity arity);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
/* void UserCPredicateWithArgs(const char *name, int *fn(), unsigned int arity)
|
|
|
|
*/
|
|
|
|
extern X_API void YAP_UserCPredicateWithArgs(const char *, YAP_UserCPred,
|
|
|
|
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) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void YAP_UserBackCPredicate(const char *, YAP_UserCPred,
|
|
|
|
YAP_UserCPred, YAP_Arity, YAP_Arity);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-11-02 22:52:52 +00:00
|
|
|
/* YAP_Int YAP_ListLength(YAP_Term t) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Int YAP_ListLength(YAP_Term);
|
2011-11-02 22:52:52 +00:00
|
|
|
|
2015-11-05 19:33:38 +00:00
|
|
|
extern X_API size_t YAP_UTF8_TextLength(YAP_Term t);
|
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
/* void UserBackCPredicate(char *name, int *init(), int *cont(), int *cut(),
|
|
|
|
int
|
2005-11-18 18:52:41 +00:00
|
|
|
arity, int extra) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void YAP_UserBackCutCPredicate(const char *, YAP_UserCPred,
|
|
|
|
YAP_UserCPred, YAP_UserCPred,
|
|
|
|
YAP_Arity, YAP_Arity);
|
2005-11-18 18:52:41 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* void CallProlog(YAP_Term t) */
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Int YAP_CallProlog(YAP_Term t);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void cut_fail(void) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_cut_up(void);
|
2005-10-21 17:09:03 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
#define YAP_cut_succeed() \
|
|
|
|
do { \
|
|
|
|
YAP_cut_up(); \
|
|
|
|
return TRUE; \
|
|
|
|
} while (0)
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +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) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void *YAP_AllocSpaceFromYap(size_t);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2009-11-19 21:09:22 +00:00
|
|
|
/* void *ReallocSpaceFromYAP_(void*,int) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void *YAP_ReallocSpaceFromYap(void *, size_t);
|
2009-11-19 21:09:22 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* void FreeSpaceFromYAP_(void *) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_FreeSpaceFromYap(void *);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* int YAP_RunGoal(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Int YAP_RunGoal(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
// extern X_API YAP_Int YAP_RunPredicate(YAP_PredEntryPtr, YAP_Term *);
|
2013-02-05 14:22:17 +00:00
|
|
|
|
2008-06-04 14:58:42 +01:00
|
|
|
/* int YAP_RunGoalOnce(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Int YAP_RunGoalOnce(YAP_Term);
|
2008-06-04 14:58:42 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int YAP_RestartGoal(void) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_RestartGoal(void);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2007-05-15 12:33:51 +01:00
|
|
|
/* int YAP_ShutdownGoal(int) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_ShutdownGoal(int);
|
2007-05-14 17:44:12 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int YAP_ContinueGoal(void) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_ContinueGoal(void);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void YAP_PruneGoal(void) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_PruneGoal(YAP_dogoalinfo *);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2007-06-04 13:28:02 +01:00
|
|
|
/* int YAP_FunctorToPred(struct pred_entry *, YAP_Term *) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_PredEntryPtr YAP_FunctorToPred(YAP_Functor);
|
2007-06-04 13:28:02 +01:00
|
|
|
|
|
|
|
/* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_PredEntryPtr YAP_AtomToPred(YAP_Atom);
|
2007-06-04 13:28:02 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_PredEntryPtr YAP_FunctorToPredInModule(YAP_Functor,
|
|
|
|
YAP_Module);
|
2012-07-13 20:57:12 +01:00
|
|
|
|
|
|
|
/* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_PredEntryPtr YAP_AtomToPredInModule(YAP_Atom, YAP_Module);
|
2012-07-13 20:57:12 +01:00
|
|
|
|
2007-06-04 13:28:02 +01:00
|
|
|
/* int YAP_EnterGoal(void) */
|
2016-09-21 04:53:33 +01:00
|
|
|
extern X_API YAP_Bool YAP_EnterGoal(YAP_PredEntryPtr, YAP_Term *,
|
2016-04-05 02:28:56 +01:00
|
|
|
YAP_dogoalinfo *);
|
2007-06-04 13:28:02 +01:00
|
|
|
|
|
|
|
/* int YAP_RetryGoal(void) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_RetryGoal(YAP_dogoalinfo *);
|
2007-06-04 13:28:02 +01:00
|
|
|
|
|
|
|
/* int YAP_LeaveGoal(void) */
|
2016-09-21 04:53:33 +01:00
|
|
|
extern X_API YAP_Bool YAP_LeaveGoal(bool, YAP_dogoalinfo *);
|
2007-06-04 13:28:02 +01:00
|
|
|
|
2005-08-17 14:35:52 +01:00
|
|
|
/* int YAP_GoalHasException(YAP_Term *) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_GoalHasException(YAP_Term *);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-08-17 14:35:52 +01:00
|
|
|
/* void YAP_ClearExceptions(void) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_ClearExceptions(void);
|
2005-08-17 14:35:52 +01:00
|
|
|
|
2014-09-22 18:13:35 +01:00
|
|
|
extern X_API int YAP_Reset(yap_reset_t reset);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API void YAP_Error(int myerrno, YAP_Term t, const char *buf, ...);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-22 18:19:58 +01:00
|
|
|
extern X_API char *YAP_WriteBuffer(YAP_Term, char *, size_t, int);
|
2004-05-14 18:56:47 +01:00
|
|
|
|
2016-04-22 18:19:58 +01:00
|
|
|
extern X_API int YAP_WriteDynamicBuffer(YAP_Term t, char *buf, size_t sze,
|
|
|
|
size_t *lengthp, YAP_encoding_t enc,
|
|
|
|
int flags);
|
2012-10-02 08:48:35 +01:00
|
|
|
|
2007-05-14 17:44:12 +01:00
|
|
|
/* void YAP_Term(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_CopyTerm(YAP_Term);
|
2007-05-14 17:44:12 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* char *YAP_CompileClause(YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API char *YAP_CompileClause(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_NewExo(YAP_PredEntryPtr ap, size_t data, void *user_di);
|
2014-10-26 01:50:18 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_AssertTuples(YAP_PredEntryPtr pred, const YAP_Term *ts,
|
|
|
|
size_t offset, size_t sz);
|
2014-10-26 01:50:18 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int YAP_Init(YAP_init_args *) */
|
2016-07-31 15:55:50 +01:00
|
|
|
extern X_API YAP_file_type_t YAP_Init(YAP_init_args *);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2005-11-05 01:28:28 +00:00
|
|
|
/* int YAP_FastInit(const char *) */
|
2016-07-31 15:55:50 +01:00
|
|
|
extern X_API YAP_file_type_t YAP_FastInit(char saved_state[], int argc,
|
|
|
|
char *argv[]);
|
2014-05-25 20:48:06 +01:00
|
|
|
|
|
|
|
#ifndef _PL_STREAM_H
|
2016-04-05 02:28:56 +01:00
|
|
|
// if we don't know what a stream is, just don't assume nothing about the
|
|
|
|
// pointer
|
2014-05-25 20:48:06 +01:00
|
|
|
#define IOSTREAM void
|
|
|
|
#endif /* FPL_STREAM_H */
|
|
|
|
|
2016-02-21 19:06:25 +00:00
|
|
|
/// read a Prolog term from an operating system stream $s$.
|
2015-06-19 01:30:13 +01:00
|
|
|
extern X_API YAP_Term YAP_Read(FILE *s);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
/// read a Prolog term from a Prolog opened stream $s$. Check YAP_OpenStream()
|
|
|
|
/// for how to open
|
2016-02-21 19:06:25 +00:00
|
|
|
/// Prolog streams in `C`.
|
|
|
|
extern X_API YAP_Term YAP_ReadFromStream(int s);
|
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
/// read a Prolog clause from a Prolog opened stream $s$. Similar to
|
|
|
|
/// YAP_ReadFromStream() but takes /// default options from read_clause/3.
|
2015-06-19 01:30:13 +01:00
|
|
|
extern X_API YAP_Term YAP_ReadFromStream(int s);
|
2011-05-25 13:10:39 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void YAP_Write(YAP_Term t, FILE *s, int);
|
2014-05-25 20:48:06 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API FILE *YAP_TermToStream(YAP_Term t);
|
2014-05-25 20:48:06 +01:00
|
|
|
|
2016-05-10 08:33:44 +01:00
|
|
|
extern X_API int YAP_InitConsult(int mode, const char *filename, char *buf,
|
2016-04-05 02:28:56 +01:00
|
|
|
int *previous_sno);
|
2015-06-19 01:30:13 +01:00
|
|
|
|
2015-09-29 23:43:02 +01:00
|
|
|
extern X_API void YAP_EndConsult(int s, int *previous_sno);
|
2014-05-25 20:48:06 +01:00
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_Exit(int);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* void YAP_PutValue(YAP_Atom, YAP_Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_PutValue(YAP_Atom, YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Term YAP_GetValue(YAP_Atom) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_GetValue(YAP_Atom);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_FloatsToList(YAP_Float *, size_t);
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Int YAP_ListToFloats(YAP_Term, YAP_Float *, size_t);
|
2012-03-14 11:08:28 +00:00
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_IntsToList(YAP_Int *, size_t);
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Int 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) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API char *YAP_StringToBuffer(YAP_Term, char *, unsigned int);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_BufferToString(const char *s);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_NBufferToString(const char *s, size_t len);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
|
|
|
/* int BufferToString(const char *) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_WideBufferToString(const wchar_t *);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_NWideBufferToString(const wchar_t *s, size_t len);
|
2004-05-14 17:33:47 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_BufferToAtomList(const char *s);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_NBufferToAtomList(const char *s, size_t len);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_WideBufferToAtomList(const wchar_t *s);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_NWideBufferToAtomList(const wchar_t *s, size_t len);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_NWideBufferToAtomDiffList(const wchar_t *s,
|
|
|
|
YAP_Term t0, size_t len);
|
2008-12-17 14:47:05 +00:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_BufferToDiffList(const char *s, YAP_Term t0);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_NBufferToDiffList(const char *s, YAP_Term t0,
|
|
|
|
size_t len);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_WideBufferToDiffList(const wchar_t *s, YAP_Term t0);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_NWideBufferToDiffList(const wchar_t *s, YAP_Term t0,
|
|
|
|
size_t len);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_ReadBuffer(const char *s, YAP_Term *tp);
|
2008-07-24 17:02:04 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_InitSocks(const char *host, long port);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
#ifdef SFUNC
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
#define SFArity 0
|
2002-09-09 18:45:51 +01:00
|
|
|
extern X_API YAP_Term *ArgsOfSFTerm();
|
|
|
|
|
|
|
|
extern X_API YAP_Term MkSFTerm();
|
|
|
|
|
|
|
|
#endif /* SFUNC */
|
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_SetOutputMessage(void);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API int YAP_StreamToFileNo(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_CloseAllOpenStreams(void);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_FlushAllStreams(void);
|
2008-07-11 18:02:10 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term *YAP_NewSlots() */
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API YAP_handle_t YAP_NewSlots(int);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2010-05-10 10:22:18 +01:00
|
|
|
/* YAP_Int YAP_CurrentSlot() */
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API YAP_handle_t YAP_CurrentSlot(void);
|
2007-05-14 17:44:12 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term *YAP_InitSlot() */
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API YAP_handle_t YAP_InitSlot(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* YAP_Term YAP_GetFromSlots(t) */
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API YAP_Term YAP_GetFromSlot(YAP_handle_t);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-02-10 00:01:19 +00:00
|
|
|
/* YAP_Term *YAP_AddressFromSlots(t) */
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API YAP_Term *YAP_AddressFromSlot(YAP_handle_t);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-02-10 00:01:19 +00:00
|
|
|
/* YAP_Term *YAP_AddressOfTermInSlot(t) */
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API YAP_Term *YAP_AddressOfTermInSlot(YAP_handle_t);
|
2011-02-10 00:01:19 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* YAP_Term YAP_PutInSlots(t) */
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API void YAP_PutInSlot(YAP_handle_t, YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API int YAP_RecoverSlots(int n, YAP_handle_t top_slot);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API YAP_handle_t YAP_ArgsToSlots(int);
|
2010-08-04 17:36:20 +01:00
|
|
|
|
2014-06-11 19:36:50 +01:00
|
|
|
extern X_API void YAP_SlotsToArgs(int, YAP_handle_t);
|
2010-08-04 17:36:20 +01:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* void YAP_Throw() */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_Throw(YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2010-12-04 19:05:13 +00:00
|
|
|
/* void YAP_AsyncThrow() */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API void YAP_AsyncThrow(YAP_Term);
|
2010-12-04 19:05:13 +00:00
|
|
|
|
2002-09-09 18:45:51 +01:00
|
|
|
/* int YAP_LookupModule() */
|
2016-04-05 02:28:56 +01: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() */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void YAP_Halt(int);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* int YAP_TopOfLocalStack() */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term *YAP_TopOfLocalStack(void);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* int YAP_Predicate() */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void *YAP_Predicate(YAP_Atom, YAP_Arity, YAP_Term);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
/* int YAP_Predicate() */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void 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() */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Module YAP_CurrentModule(void);
|
2002-09-09 18:45:51 +01:00
|
|
|
|
2011-02-14 22:13:45 +00:00
|
|
|
/* int YAP_SetCurrentModule() */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Module YAP_SetCurrentModule(YAP_Module);
|
2011-02-14 22:13:45 +00:00
|
|
|
|
|
|
|
/* int YAP_CreateModule() */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Module YAP_CreateModule(YAP_Atom);
|
2004-08-11 17:14:55 +01:00
|
|
|
|
2008-08-01 22:44:25 +01:00
|
|
|
/* int YAP_StripModule() */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_StripModule(YAP_Term, YAP_Module *);
|
2008-08-01 22:44:25 +01:00
|
|
|
|
2007-12-05 12:17:25 +00:00
|
|
|
/* int YAP_AtomGetHold(YAP_Atom) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_AtomGetHold(YAP_Atom);
|
2007-12-05 12:17:25 +00:00
|
|
|
|
|
|
|
/* int YAP_AtomReleaseHold(YAP_Atom) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_AtomReleaseHold(YAP_Atom);
|
2007-12-05 12:17:25 +00:00
|
|
|
|
|
|
|
/* void YAP_AtomReleaseHold(YAP_Atom) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_agc_hook YAP_AGCRegisterHook(YAP_agc_hook hook);
|
2007-12-05 12:17:25 +00:00
|
|
|
|
2010-09-24 14:00:53 +01:00
|
|
|
/* void YAP_AtomReleaseHold(YAP_Atom) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_HaltRegisterHook(YAP_halt_hook, void *);
|
2010-09-24 14:00:53 +01:00
|
|
|
|
2008-12-13 16:07:55 +00:00
|
|
|
/* char *YAP_cwd(void) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API char *YAP_cwd(void);
|
2008-12-13 16:07:55 +00:00
|
|
|
|
2004-08-11 17:14:55 +01:00
|
|
|
/* thread stuff */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API int YAP_ThreadSelf(void);
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API int YAP_ThreadCreateEngine(YAP_thread_attr *attr);
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API int YAP_ThreadAttachEngine(int);
|
|
|
|
extern X_API int YAP_ThreadDetachEngine(int);
|
|
|
|
extern X_API int YAP_ThreadDestroyEngine(int);
|
2004-08-11 17:14:55 +01:00
|
|
|
|
2006-12-13 16:10:26 +00:00
|
|
|
/* blob stuff */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_MkBlobTerm(unsigned int);
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void *YAP_BlobOfTerm(YAP_Term);
|
2006-05-16 19:37:31 +01:00
|
|
|
|
2004-08-11 17:14:55 +01:00
|
|
|
/* term comparison */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_CompareTerms(YAP_Term, YAP_Term);
|
2004-07-22 22:32:23 +01:00
|
|
|
|
2008-12-22 13:49:44 +00:00
|
|
|
/* list construction */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_OpenList(int);
|
|
|
|
extern X_API YAP_Term YAP_ExtendList(YAP_Term, YAP_Term);
|
|
|
|
extern X_API int YAP_CloseList(YAP_Term, YAP_Term);
|
2008-12-22 13:49:44 +00:00
|
|
|
|
2009-02-09 22:45:50 +00:00
|
|
|
/* attributed variables */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_IsAttVar(YAP_Term);
|
|
|
|
extern X_API YAP_Term YAP_AttsOfVar(YAP_Term);
|
2009-02-09 22:45:50 +00:00
|
|
|
|
2009-04-22 22:41:41 +01:00
|
|
|
/* stream info */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void *YAP_FileDescriptorFromStream(YAP_Term);
|
|
|
|
extern X_API int YAP_FileNoFromStream(YAP_Term);
|
2009-04-22 22:41:41 +01:00
|
|
|
|
2010-08-02 19:48:17 +01:00
|
|
|
/* store and recover terms */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void *YAP_Record(YAP_Term);
|
|
|
|
extern X_API YAP_Term YAP_Recorded(void *);
|
|
|
|
extern X_API int YAP_Erase(void *);
|
2010-08-02 19:48:17 +01:00
|
|
|
|
|
|
|
/* term utilities */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_Variant(YAP_Term, YAP_Term);
|
|
|
|
extern X_API YAP_Int YAP_NumberVars(YAP_Term, YAP_Int);
|
|
|
|
extern X_API YAP_Term YAP_UnNumberVars(YAP_Term);
|
|
|
|
extern X_API int YAP_IsNumberedVariable(YAP_Term);
|
|
|
|
extern X_API int YAP_Unifiable(YAP_Term, YAP_Term);
|
|
|
|
extern X_API int YAP_ExactlyEqual(YAP_Term, YAP_Term);
|
|
|
|
extern X_API YAP_Int YAP_TermHash(YAP_Term, YAP_Int, YAP_Int, int);
|
2010-08-02 19:48:17 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API void YAP_signal(int);
|
2011-02-03 11:23:12 +00:00
|
|
|
|
2010-08-31 04:25:56 +01:00
|
|
|
/* stack expansion control */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_GetYAPFlag(YAP_Term flag);
|
|
|
|
extern X_API int YAP_SetYAPFlag(YAP_Term flag, YAP_Term set);
|
2010-08-31 04:25:56 +01:00
|
|
|
|
2011-02-10 00:01:19 +00:00
|
|
|
/* void *YAP_GlobalBase(Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Int YAP_VarSlotToNumber(YAP_Int);
|
2011-02-10 00:01:19 +00:00
|
|
|
|
|
|
|
/* Term YAP_ModuleUser() */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Term YAP_ModuleUser(void);
|
2011-02-10 00:01:19 +00:00
|
|
|
|
|
|
|
/* Int YAP_NumberOfClausesForPredicate() */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Int YAP_NumberOfClausesForPredicate(YAP_PredEntryPtr);
|
2011-02-10 00:01:19 +00:00
|
|
|
|
2011-02-10 21:14:38 +00:00
|
|
|
/* int YAP_MaxOpPriority(Atom, Term) */
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API int YAP_MaxOpPriority(YAP_Atom, YAP_Term);
|
2011-02-10 21:14:38 +00:00
|
|
|
|
|
|
|
/* int YAP_OpInfo(Atom, Term, int, int *, int *) */
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_OpInfo(YAP_Atom, YAP_Term, int, int *, int *);
|
2011-02-10 21:14:38 +00:00
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsExternalDataInStackTerm(YAP_Term);
|
2011-07-21 14:32:49 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_AllocExternalDataInStack(size_t bytes);
|
|
|
|
|
|
|
|
extern X_API void *YAP_ExternalDataInStackFromTerm(YAP_Term t);
|
|
|
|
|
|
|
|
extern X_API YAP_Bool YAP_IsExternalDataInStackTerm(YAP_Term t);
|
2011-07-21 14:32:49 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_opaque_tag_t
|
|
|
|
YAP_NewOpaqueType(struct YAP_opaque_handler_struct *f);
|
2011-07-22 12:09:33 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Bool YAP_IsOpaqueObjectTerm(YAP_Term t, YAP_opaque_tag_t tag);
|
2011-07-22 12:09:33 +01:00
|
|
|
|
2014-05-25 20:48:06 +01:00
|
|
|
extern X_API YAP_Term YAP_NewOpaqueObject(YAP_opaque_tag_t tag, size_t bytes);
|
|
|
|
|
|
|
|
extern X_API void *YAP_OpaqueObjectFromTerm(YAP_Term t);
|
|
|
|
|
|
|
|
extern X_API YAP_CELL *YAP_HeapStoreOpaqueTerm(YAP_Term t);
|
2011-07-21 14:32:49 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_Argv(char ***);
|
2011-10-13 16:46:39 +01:00
|
|
|
|
2016-07-31 15:55:50 +01:00
|
|
|
extern X_API bool YAP_DelayInit(YAP_ModInit_t f, const char s[]);
|
|
|
|
|
2014-04-28 11:54:47 +01:00
|
|
|
extern X_API YAP_tag_t YAP_TagOfTerm(YAP_Term);
|
2011-10-27 11:35:07 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API size_t YAP_ExportTerm(YAP_Term, char *, size_t);
|
2012-02-01 19:26:28 +00:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API size_t YAP_SizeOfExportedTerm(char *);
|
2012-02-03 16:31:49 +00:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API YAP_Term YAP_ImportTerm(char *);
|
2012-02-01 19:26:28 +00:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
extern X_API int YAP_RequiresExtraStack(size_t);
|
2012-03-30 09:49:36 +01:00
|
|
|
|
2016-04-05 02:28:56 +01:00
|
|
|
/**
|
2016-01-31 10:35:53 +00:00
|
|
|
* YAP_parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
2016-04-05 02:28:56 +01:00
|
|
|
*
|
|
|
|
* @param [in] argc the number of arguments to YAP
|
|
|
|
* @param [in] argv the array of arguments to YAP
|
|
|
|
* @param [in,out] argc the array with processed settings YAP
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/ /*
|
|
|
|
* proccess command line arguments: valid switches are:
|
|
|
|
* -b boot file
|
|
|
|
* -l load file
|
|
|
|
* -L load file, followed by exit.
|
|
|
|
* -s stack area size (K)
|
|
|
|
* -h heap area size
|
|
|
|
* -a aux stack size
|
|
|
|
* -e emacs_mode -m
|
|
|
|
* -DVar=Value
|
|
|
|
* reserved memory for alloc IF DEBUG
|
|
|
|
* -P only in development versions
|
|
|
|
*/
|
2016-05-10 08:33:44 +01:00
|
|
|
extern X_API YAP_file_type_t YAP_parse_yap_arguments(int argc, char *argv[],
|
2016-07-31 15:55:50 +01:00
|
|
|
YAP_init_args *iap);
|
2016-04-05 02:28:56 +01:00
|
|
|
|
|
|
|
extern X_API YAP_Int YAP_AtomToInt(YAP_Atom At);
|
|
|
|
|
|
|
|
extern X_API YAP_Atom YAP_IntToAtom(YAP_Int i);
|
|
|
|
|
|
|
|
extern X_API YAP_Int YAP_FunctorToInt(YAP_Functor At);
|
|
|
|
|
|
|
|
extern X_API YAP_Functor YAP_IntToFunctor(YAP_Int i);
|
|
|
|
|
|
|
|
#define YAP_InitCPred(N, A, F) YAP_UserCPredicate(N, F, A)
|
2002-09-09 18:45:51 +01:00
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif
|
2014-12-24 15:32:29 +00:00
|
|
|
|
|
|
|
/// @}
|