indenting plus deoid

This commit is contained in:
vscosta 2016-04-05 02:28:56 +01:00
parent 562ac0251d
commit a5951daea9
3 changed files with 282 additions and 205 deletions

View File

@ -17,7 +17,6 @@
#include "YapTermConfig.h" #include "YapTermConfig.h"
#include "config.h" #include "config.h"
#if HAVE_STDINT_H #if HAVE_STDINT_H
#include <stdint.h> #include <stdint.h>
#endif #endif
@ -30,8 +29,8 @@ typedef void *Atom;
#endif #endif
#define ALIGN_BY_TYPE(X,TYPE) (((CELL)(X)+(sizeof(TYPE)-1)) & ~(sizeof(TYPE)-1)) #define ALIGN_BY_TYPE(X, TYPE) \
(((CELL)(X) + (sizeof(TYPE) - 1)) & ~(sizeof(TYPE) - 1))
#ifndef EXTERN #ifndef EXTERN
#ifdef _MSC_VER #ifdef _MSC_VER
@ -44,17 +43,23 @@ typedef void *Atom;
/* defines integer types Int and UInt (unsigned) with the same size as a ptr /* defines integer types Int and UInt (unsigned) with the same size as a ptr
** and integer types Short and UShort with half the size of a ptr */ ** and integer types Short and UShort with half the size of a ptr */
#if HAVE_INTTYPES_H
#include <inttypes.h>
#define Int_FORMAT "%" PRIdPTR
#define UInt_ANYFORMAT "%" PRIuPTR
#define UInt_FORMAT "%" PRIuPTR
typedef intptr_t Int; typedef intptr_t Int;
typedef uintptr_t UInt; typedef uintptr_t UInt;
#if SIZEOF_INT_P==4 #elif SIZEOF_INT_P == 4
#if SIZEOF_LONGINT==4 #if SIZEOF_LONGINT == 4
#define Int_FORMAT "%l" #define Int_FORMAT "%l"
#define UInt_FORMAT "%ul" #define UInt_FORMAT "%ul"
#elif SIZEOF_LONG_INT==4 #elif SIZEOF_LONG_INT == 4
/* typedef long int Int;*/ /* typedef long int Int;*/
/* typedef unsigned long int UInt; */ /* typedef unsigned long int UInt; */
@ -69,54 +74,53 @@ typedef uintptr_t UInt;
#error Yap require integer types of the same size as a pointer #error Yap require integer types of the same size as a pointer
#endif #endif
#if SIZEOF_SHORT_INT==2 #if SIZEOF_SHORT_INT == 2
/* */ typedef short int Short; /* */ typedef short int Short;
/* */ typedef unsigned short int UShort; /* */ typedef unsigned short int UShort;
#else #else
# error Yap requires integer types half the size of a pointer #error Yap requires integer types half the size of a pointer
#endif #endif
#elif SIZEOF_INT_P==8 #elif SIZEOF_INT_P == 8
#if SIZEOF_INT==8 #if SIZEOF_INT == 8
#define Int_FORMAT "%d" #define Int_FORMAT "%d"
#define UInt_FORMAT "%u" #define UInt_FORMAT "%u"
#elif SIZEOF_LONG_INT==8 #elif SIZEOF_LONG_INT == 8
#define Int_FORMAT "%ld" #define Int_FORMAT "%ld"
#define UInt_FORMAT "%lu" #define UInt_FORMAT "%lu"
# elif SIZEOF_LONG_LONG_INT==8 #elif SIZEOF_LONG_LONG_INT == 8
#define Int_FORMAT "%I64d" #define Int_FORMAT "%I64d"
#define UInt_FORMAT "%I64u" #define UInt_FORMAT "%I64u"
# else #else
# error Yap requires integer types of the same size as a pointer #error Yap requires integer types of the same size as a pointer
# endif #endif
# if SIZEOF_SHORT_INT==4 #if SIZEOF_SHORT_INT == 4
/* */ typedef short int Short; /* */ typedef short int Short;
/* */ typedef unsigned short int UShort; /* */ typedef unsigned short int UShort;
# elif SIZEOF_INT==4 #elif SIZEOF_INT == 4
/* */ typedef int Short; /* */ typedef int Short;
/* */ typedef unsigned int UShort; /* */ typedef unsigned int UShort;
# else #else
# error Yap requires integer types half the size of a pointer #error Yap requires integer types half the size of a pointer
# endif #endif
#else #else
# error Yap requires pointers of size 4 or 8 #error Yap requires pointers of size 4 or 8
#endif #endif
typedef uintptr_t CELL; typedef uintptr_t CELL;
typedef uint16_t BITS16; typedef uint16_t BITS16;
@ -131,14 +135,13 @@ typedef uint32_t BITS32;
type casting macros type casting macros
*************************************************************************************************/ *************************************************************************************************/
typedef uintptr_t Term; typedef uintptr_t Term;
typedef intptr_t yhandle_t; typedef intptr_t yhandle_t;
typedef double Float; typedef double Float;
#if SIZEOF_INT<SIZEOF_INT_P #if SIZEOF_INT < SIZEOF_INT_P
#define SHORT_INTS 1 #define SHORT_INTS 1
#else #else
#define SHORT_INTS 0 #define SHORT_INTS 0
@ -152,6 +155,5 @@ typedef long int YAP_LONG_LONG;
typedef unsigned long int YAP_ULONG_LONG; typedef unsigned long int YAP_ULONG_LONG;
#endif #endif
#define Unsigned(V) ((CELL) (V)) #define Unsigned(V) ((CELL)(V))
#define Signed(V) ((Int) (V)) #define Signed(V) ((Int)(V))

View File

@ -404,6 +404,7 @@ int Yap_signal_index(const char *);
void Yap_SetTextFile(char *); void Yap_SetTextFile(char *);
#endif #endif
#if __ANDROID__ #if __ANDROID__
#include <android/asset_manager.h>
extern AAssetManager *Yap_assetManager; extern AAssetManager *Yap_assetManager;
extern void *Yap_openAssetFile(const char *path); extern void *Yap_openAssetFile(const char *path);

View File

@ -54,11 +54,11 @@ q
#undef __BEGIN_DECLS #undef __BEGIN_DECLS
#undef __END_DECLS #undef __END_DECLS
#ifdef __cplusplus #ifdef __cplusplus
# define __BEGIN_DECLS extern "C" { #define __BEGIN_DECLS extern "C" {
# define __END_DECLS } #define __END_DECLS }
#else #else
# define __BEGIN_DECLS /* empty */ #define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */ #define __END_DECLS /* empty */
#endif /* _cplusplus */ #endif /* _cplusplus */
__BEGIN_DECLS __BEGIN_DECLS
@ -84,7 +84,15 @@ __BEGIN_DECLS
#ifndef Int_FORMAT #ifndef Int_FORMAT
#if _WIN64 #if HAVE_INTTYPES_H
#include <inttypes.h>
#define Int_FORMAT "%" PRIdPTR
#define Int_ANYFORMAT "%" PRIiPTR
#define UInt_FORMAT "%" PRIuPTR
#elif _WIN64
#define Int_FORMAT "%I64d" #define Int_FORMAT "%I64d"
#define Int_ANYFORMAT "%I64i" #define Int_ANYFORMAT "%I64i"
#define UInt_FORMAT "%I64u" #define UInt_FORMAT "%I64u"
@ -148,7 +156,8 @@ installation path you should use:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -mno-cygwin -I "c:/Yap/include" -c my_process.c gcc -mno-cygwin -I "c:/Yap/include" -c my_process.c
gcc -mno-cygwin "c:/Yap/bin/yap.dll" --shared -o my_process.dll my_process.o gcc -mno-cygwin "c:/Yap/bin/yap.dll" --shared -o my_process.dll
my_process.o
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Under WIN32 in a pure CYGWIN environment, using the standard Under WIN32 in a pure CYGWIN environment, using the standard
installation path, you should use: installation path, you should use:
@ -417,10 +426,13 @@ names
</li> </li>
</ul> </ul>
The function [YAP_LookupAtom](@ref YAP_LookupAtom) looks up an atom in the standard hash The function [YAP_LookupAtom](@ref YAP_LookupAtom) looks up an atom in the
table. The function [YAP_FullLookupAtom](@ref YAP_FullLookupAtom) will also search if the standard hash
table. The function [YAP_FullLookupAtom](@ref YAP_FullLookupAtom) will also
search if the
atom had been "hidden": this is useful for system maintenance from C atom had been "hidden": this is useful for system maintenance from C
code. The functor [YAP_AtomName](@ref YAP_AtomName) returns a pointer to the string code. The functor [YAP_AtomName](@ref YAP_AtomName) returns a pointer to the
string
for the atom. for the atom.
The following primitives handle constructing atoms from strings with The following primitives handle constructing atoms from strings with
@ -510,7 +522,8 @@ The following primitives were designed to manipulate compound terms and
functors functors
<ul> <ul>
<li>YAP_Term YAP_MkApplTerm(YAP_Functor _f_, unsigned long int _n_, YAP_Term[] _args_) <li>YAP_Term YAP_MkApplTerm(YAP_Functor _f_, unsigned long int _n_,
YAP_Term[] _args_)
</li> </li>
<li>YAP_Term YAP_MkNewApplTerm(YAP_Functor _f_, int _n_) <li>YAP_Term YAP_MkNewApplTerm(YAP_Functor _f_, int _n_)
@ -530,16 +543,19 @@ The [YAP_MkApplTerm() function constructs a new term, with functor
_f_ (of arity _n_), and using an array _args_ of _n_ _f_ (of arity _n_), and using an array _args_ of _n_
terms with _n_ equal to the arity of the terms with _n_ equal to the arity of the
functor. YAP_MkNewApplTerm() builds up a compound term whose functor. YAP_MkNewApplTerm() builds up a compound term whose
arguments are unbound variables. [YAP_ArgOfTerm](@ref YAP_ArgOfTerm) gives an argument arguments are unbound variables. [YAP_ArgOfTerm](@ref YAP_ArgOfTerm) gives an
argument
to a compound term. `argno` should be greater or equal to 1 and to a compound term. `argno` should be greater or equal to 1 and
less or equal to the arity of the functor. [YAP_ArgsOfTerm](@ref YAP_ArgsOfTerm) less or equal to the arity of the functor. [YAP_ArgsOfTerm](@ref
YAP_ArgsOfTerm)
returns a pointer to an array of arguments. returns a pointer to an array of arguments.
Notice that the compound term constructors can call the garbage Notice that the compound term constructors can call the garbage
collector if there is not enough space in the global stack. collector if there is not enough space in the global stack.
YAP allows one to manipulate the functors of compound term. The function YAP allows one to manipulate the functors of compound term. The function
[YAP_FunctorOfTerm](@ref YAP_FunctorOfTerm) allows one to obtain a variable of type [YAP_FunctorOfTerm](@ref YAP_FunctorOfTerm) allows one to obtain a variable of
type
`YAP_Functor` with the functor to a term. The following functions `YAP_Functor` with the functor to a term. The following functions
then allow one to construct functors, and to obtain their name and arity. then allow one to construct functors, and to obtain their name and arity.
@ -593,7 +609,8 @@ The YAP C-interface now includes an utility routine to copy a string
represented as a list of a character codes to a previously allocated buffer represented as a list of a character codes to a previously allocated buffer
<ul> <ul>
<li>int YAP_StringToBuffer(YAP_Term _String_, char \* _buf_, unsigned int _bufsize_) <li>int YAP_StringToBuffer(YAP_Term _String_, char \* _buf_, unsigned int
_bufsize_)
</li> </li>
</ul> </ul>
@ -679,7 +696,8 @@ The next routine can be used to ask space from the Prolog data-base:
The routine returns a pointer to a buffer allocated from the code area, The routine returns a pointer to a buffer allocated from the code area,
or `NULL` if sufficient space was not available. or `NULL` if sufficient space was not available.
The space allocated with [YAP_AllocSpaceFromYAP](@ref YAP_AllocSpaceFromYAP) can be released The space allocated with [YAP_AllocSpaceFromYAP](@ref YAP_AllocSpaceFromYAP) can
be released
back to YAP by using: back to YAP by using:
<ul> <ul>
@ -735,7 +753,8 @@ routine receives as arguments a file descriptor, the true file name as a
string, an atom with the user name, and a set of flags: string, an atom with the user name, and a set of flags:
<ul> <ul>
<li>void YAP_OpenStream(void \* _FD_, char \* _name_, YAP_Term _t_, int _flags_) <li>void YAP_OpenStream(void \* _FD_, char \* _name_, YAP_Term _t_, int
_flags_)
</li> </li>
</ul> </ul>
@ -832,7 +851,8 @@ The second function computes a hash function for a term, as in
`term_hash/4`. `term_hash/4`.
<ul> <ul>
<li>YAP_Int YAP_TermHash(YAP_Term t, YAP_Int range, YAP_Int depth, int ignore_variables)); <li>YAP_Int YAP_TermHash(YAP_Term t, YAP_Int range, YAP_Int depth, int
ignore_variables));
</li> </li>
</ul> </ul>
@ -958,10 +978,12 @@ a solution was found.
Notice that you cannot create new slots if an YAP_ExnterGoal goal is open. Notice that you cannot create new slots if an YAP_ExnterGoal goal is open.
</li> </li>
<li>`YAP_Bool` YAP_RetryGoal(`YAP_dogoalinfo \*` _infop_) @anchor YAP_RetryGoal <li>`YAP_Bool` YAP_RetryGoal(`YAP_dogoalinfo \*` _infop_) @anchor
YAP_RetryGoal
Backtrack to a query created by [YAP_EnterGoal](@ref YAP_EnterGoal). The query is Backtrack to a query created by [YAP_EnterGoal](@ref YAP_EnterGoal). The query
is
given by the handle _infop_. Returns whether a new solution could given by the handle _infop_. Returns whether a new solution could
be be found. be be found.
@ -1064,7 +1086,8 @@ collector, the second does the same for the atom garbage collector.`
</li> </li>
<li>`void \*` YAP_ExternalDataInStackFromTerm(`YAP_Term t`) <li>`void \*` YAP_ExternalDataInStackFromTerm(`YAP_Term t`)
</li> </li>
<li>`YAP_Bool` YAP_IsExternalDataInStackTerm(`YAP_Term t`) @anchor YAP_AllocExternalDataInStack <li>`YAP_Bool` YAP_IsExternalDataInStackTerm(`YAP_Term t`) @anchor
YAP_AllocExternalDataInStack
The next routines allow one to store external data in the Prolog The next routines allow one to store external data in the Prolog
@ -1079,7 +1102,8 @@ so it should not be used to store Prolog terms. On the other hand, it
may be useful to store arrays in a compact way, or pointers to external objects. may be useful to store arrays in a compact way, or pointers to external objects.
</li> </li>
<li>`int` YAP_HaltRegisterHook(`YAP_halt_hook f, void \*closure`) @anchor YAP_HaltRegisterHook <li>`int` YAP_HaltRegisterHook(`YAP_halt_hook f, void \*closure`) @anchor
YAP_HaltRegisterHook
Register the function _f_ to be called if YAP is halted. The Register the function _f_ to be called if YAP is halted. The
@ -1091,7 +1115,8 @@ the closure argument _closure_.
</li> </li>
<li>`int` YAP_Argv(`char \*\*\*argvp`) @anchor YAP_Argv <li>`int` YAP_Argv(`char \*\*\*argvp`) @anchor YAP_Argv
Return the number of arguments to YAP and instantiate argvp to point to the list of such arguments. Return the number of arguments to YAP and instantiate argvp to point to the list
of such arguments.
</li> </li>
</ul> </ul>
@ -1115,7 +1140,8 @@ non-zero value otherwise. The predicate should be declared to
YAP, in the initialization routine, with a call to YAP, in the initialization routine, with a call to
<ul> <ul>
<li>void YAP_UserCPredicate(char \* _name_, YAP_Bool \* _fn_(), unsigned long int _arity_); <li>void YAP_UserCPredicate(char \* _name_, YAP_Bool \* _fn_(), unsigned long
int _arity_);
where _name_ is a string with the name of the predicate, _init_, where _name_ is a string with the name of the predicate, _init_,
_cont_, _cut_ are the C functions used to start, continue and _cont_, _cut_ are the C functions used to start, continue and
when pruning the execution of the predicate, _arity_ is the when pruning the execution of the predicate, _arity_ is the
@ -1143,14 +1169,18 @@ described above.
The interface works as follows: The interface works as follows:
<ul> <ul>
<li>void YAP_UserBackCutCPredicate(char \* _name_, int \* _init_(), int \* _cont_(), int \* _cut_(), unsigned long int _arity_, unsigned int _sizeof_) @anchor YAP_UserBackCutCPredicate <li>void YAP_UserBackCutCPredicate(char \* _name_, int \* _init_(), int \*
_cont_(), int \* _cut_(), unsigned long int _arity_, unsigned int _sizeof_)
@anchor YAP_UserBackCutCPredicate
describes a new predicate where _name_ is the name of the predicate, describes a new predicate where _name_ is the name of the predicate,
_init_, _cont_, and _cut_ are the C functions that implement _init_, _cont_, and _cut_ are the C functions that implement
the predicate and _arity_ is the predicate's arity. the predicate and _arity_ is the predicate's arity.
</li> </li>
<li>void YAP_UserBackCPredicate(char \* _name_, int \* _init_(), int \* _cont_(), unsigned long int _arity_, unsigned int _sizeof_) @anchor YAP_UserBackCPredicate <li>void YAP_UserBackCPredicate(char \* _name_, int \* _init_(), int \*
_cont_(), unsigned long int _arity_, unsigned int _sizeof_) @anchor
YAP_UserBackCPredicate
describes a new predicate where _name_ is the name of the predicate, describes a new predicate where _name_ is the name of the predicate,
_init_, and _cont_ are the C functions that implement the _init_, and _cont_ are the C functions that implement the
@ -1165,7 +1195,8 @@ predicate and _arity_ is the predicate's arity.
</li> </li>
<li>void YAP_PRESERVED_DATA_CUT( _ptr_, _type_); @anchor YAP_PRESERVED_DATA_CUT <li>void YAP_PRESERVED_DATA_CUT( _ptr_, _type_); @anchor
YAP_PRESERVED_DATA_CUT
</li> </li>
@ -1223,10 +1254,12 @@ static int start_n100(void)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The routine starts by getting the dereference value of the argument. The routine starts by getting the dereference value of the argument.
The call to [YAP_PRESERVE_DATA](@ref YAP_PRESERVE_DATA) is used to initialize the memory The call to [YAP_PRESERVE_DATA](@ref YAP_PRESERVE_DATA) is used to initialize
the memory
which will hold the information to be preserved across which will hold the information to be preserved across
backtracking. The first argument is the variable we shall use, and the backtracking. The first argument is the variable we shall use, and the
second its type. Note that we can only use [YAP_PRESERVE_DATA](@ref YAP_PRESERVE_DATA) second its type. Note that we can only use [YAP_PRESERVE_DATA](@ref
YAP_PRESERVE_DATA)
once, so often we will want the variable to be a structure. This data once, so often we will want the variable to be a structure. This data
is visible to the garbage collector, so it should consist of Prolog is visible to the garbage collector, so it should consist of Prolog
terms, as in the example. It is also correct to store pointers to terms, as in the example. It is also correct to store pointers to
@ -1240,11 +1273,14 @@ required to provide the next solution, and exits by calling
If the argument was not a variable, the routine then checks if it was an If the argument was not a variable, the routine then checks if it was an
integer, and if so, if its value is positive and less than 100. In that integer, and if so, if its value is positive and less than 100. In that
case it exits, denoting success, with [YAP_cut_succeed](@ref YAP_cut_succeed), or case it exits, denoting success, with [YAP_cut_succeed](@ref YAP_cut_succeed),
or
otherwise exits with [YAP_cut_fail](@ref YAP_cut_fail) denoting failure. otherwise exits with [YAP_cut_fail](@ref YAP_cut_fail) denoting failure.
The reason for using for using the functions [YAP_cut_succeed](@ref YAP_cut_succeed) and The reason for using for using the functions [YAP_cut_succeed](@ref
[YAP_cut_fail](@ref YAP_cut_fail) instead of just returning a non-zero value in the YAP_cut_succeed) and
[YAP_cut_fail](@ref YAP_cut_fail) instead of just returning a non-zero value in
the
first case, and zero in the second case, is that otherwise, if first case, and zero in the second case, is that otherwise, if
backtracking occurred later, the routine `continue_n100` would be backtracking occurred later, the routine `continue_n100` would be
called to provide additional solutions. called to provide additional solutions.
@ -1272,10 +1308,12 @@ static int continue_n100(void)
} }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note that again the macro [YAP_PRESERVED_DATA](@ref YAP_PRESERVED_DATA) is used at the Note that again the macro [YAP_PRESERVED_DATA](@ref YAP_PRESERVED_DATA) is used
at the
beginning of the function to access the data preserved from the previous beginning of the function to access the data preserved from the previous
solution. Then it checks if the last solution was found and in that solution. Then it checks if the last solution was found and in that
case exits with [YAP_cut_succeed](@ref YAP_cut_succeed) in order to cut any further case exits with [YAP_cut_succeed](@ref YAP_cut_succeed) in order to cut any
further
backtracking. If this is not the last solution then we save the value backtracking. If this is not the last solution then we save the value
for the next solution in the data structure and exit normally with 1 for the next solution in the data structure and exit normally with 1
denoting success. Note also that in any of the two cases we use the denoting success. Note also that in any of the two cases we use the
@ -1315,11 +1353,13 @@ static int cut_n100(void)
{ {
YAP_PRESERVED_DATA_CUT(n100_data,n100_data_type*); YAP_PRESERVED_DATA_CUT(n100_data,n100_data_type*);
fprintf("n100 cut with counter %ld\n", YAP_IntOfTerm(n100_data->next_solution)); fprintf("n100 cut with counter %ld\n",
YAP_IntOfTerm(n100_data->next_solution));
return TRUE; return TRUE;
} }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notice that we have to use [YAP_PRESERVED_DATA_CUT](@ref YAP_PRESERVED_DATA_CUT): this is Notice that we have to use [YAP_PRESERVED_DATA_CUT](@ref
YAP_PRESERVED_DATA_CUT): this is
because the Prolog engine is at a different state during cut. because the Prolog engine is at a different state during cut.
If no work is required at cut, we can use: If no work is required at cut, we can use:
@ -1414,8 +1454,8 @@ The next program shows how to use this system. We assume the saved
program contains two facts for the procedure <tt>b</tt>: program contains two facts for the procedure <tt>b</tt>:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <stdio.h>
#include "YAP/YAPInterface.h" #include "YAP/YAPInterface.h"
#include <stdio.h>
int int
main(int argc, char *argv[]) { main(int argc, char *argv[]) {
@ -1457,14 +1497,16 @@ Predicate _pred_ is an exo-predicate that needs _sz_ bytes of
contiguous storage. If _uid_ is non-null associate user-defined contiguous storage. If _uid_ is non-null associate user-defined
code with _pred_. code with _pred_.
+ YAP_AssertTuples(`YAP_PredEntryPtr` pred, `const YAP_Term *` _Facts_, `size_t` nb) + YAP_AssertTuples(`YAP_PredEntryPtr` pred, `const YAP_Term *` _Facts_,
`size_t` nb)
Add the array of _nb_ Prolog term `Facts` to the table Add the array of _nb_ Prolog term `Facts` to the table
`Predicate`. `Predicate`.
+ `int` YAP_ContinueGoal(`void`) + `int` YAP_ContinueGoal(`void`)
Continue execution from the point where it stopped. Continue execution from the point where it stopped.
+ `void` YAP_Error(`int` _ID_,`YAP_Term` _Cause_,`char \*` _error_description_) + `void` YAP_Error(`int` _ID_,`YAP_Term` _Cause_,`char \*`
_error_description_)
Generate an YAP System Error with description given by the string Generate an YAP System Error with description given by the string
_error_description_. _ID_ is the error ID, if known, or _error_description_. _ID_ is the error ID, if known, or
`0`. _Cause_ is the term that caused the crash. `0`. _Cause_ is the term that caused the crash.
@ -1539,7 +1581,8 @@ characters. The term is written according to a mask of the following
flags in the `flag` argument: `YAP_WRITE_QUOTED`, flags in the `flag` argument: `YAP_WRITE_QUOTED`,
`YAP_WRITE_HANDLE_VARS`, `YAP_WRITE_USE_PORTRAY`, and `YAP_WRITE_IGNORE_OPS`. `YAP_WRITE_HANDLE_VARS`, `YAP_WRITE_USE_PORTRAY`, and `YAP_WRITE_IGNORE_OPS`.
+ `int` YAP_WriteBuffer(`YAP_Term` _t_, `char \*` _buff_, `size_t` _size_, `int` _flags_) + `int` YAP_WriteBuffer(`YAP_Term` _t_, `char \*` _buff_, `size_t`
_size_, `int` _flags_)
Write a YAP_Term _t_ to buffer _buff_ with size Write a YAP_Term _t_ to buffer _buff_ with size
_size_. The term is written _size_. The term is written
according to a mask of the following flags in the `flag` according to a mask of the following flags in the `flag`
@ -1547,12 +1590,14 @@ argument: `YAP_WRITE_QUOTED`, `YAP_WRITE_HANDLE_VARS`,
`YAP_WRITE_USE_PORTRAY`, and `YAP_WRITE_IGNORE_OPS`. The `YAP_WRITE_USE_PORTRAY`, and `YAP_WRITE_IGNORE_OPS`. The
function will fail if it does not have enough space in the buffer. function will fail if it does not have enough space in the buffer.
+ `char \*` YAP_WriteDynamicBuffer(`YAP_Term` _t_, `char \*` _buff_, `size_t` _size_, `size_t` _\*lengthp_, `size_t` _\*encodingp_, `int` _flags_) + `char \*` YAP_WriteDynamicBuffer(`YAP_Term` _t_, `char \*` _buff_,
`size_t` _size_, `size_t` _\*lengthp_, `size_t` _\*encodingp_, `int` _flags_)
Write a YAP_Term _t_ to buffer _buff_ with size Write a YAP_Term _t_ to buffer _buff_ with size
_size_. The code will allocate an extra buffer if _buff_ is _size_. The code will allocate an extra buffer if _buff_ is
`NULL` or if `buffer` does not have enough room. The `NULL` or if `buffer` does not have enough room. The
variable `lengthp` is assigned the size of the resulting buffer, variable `lengthp` is assigned the size of the resulting buffer,
and `encodingp` will receive the type of encoding (currently only `PL_ENC_ISO_LATIN_1` and `PL_ENC_WCHAR` are supported) and `encodingp` will receive the type of encoding (currently only
`PL_ENC_ISO_LATIN_1` and `PL_ENC_WCHAR` are supported)
+ `void` YAP_InitConsult(`int` _mode_, `char \*` _filename_) + `void` YAP_InitConsult(`int` _mode_, `char \*` _filename_)
Enter consult mode on file _filename_. This mode maintains a few Enter consult mode on file _filename_. This mode maintains a few
@ -1705,9 +1750,9 @@ extern X_API const char *YAP_AtomName(YAP_Atom a);
extern X_API const wchar_t *YAP_WideAtomName(YAP_Atom a); extern X_API const wchar_t *YAP_WideAtomName(YAP_Atom a);
/* YAP_Term MkPairTerm(YAP_Term Head, YAP_Term Tail) */ /* YAP_Term MkPairTerm(YAP_Term Head, YAP_Term Tail) */
extern X_API YAP_Term YAP_MkPairTerm(YAP_Term,YAP_Term); extern X_API YAP_Term YAP_MkPairTerm(YAP_Term, YAP_Term);
extern X_API YAP_Term YAP_MkListFromTerms(YAP_Term *,YAP_Int); extern X_API YAP_Term YAP_MkListFromTerms(YAP_Term *, YAP_Int);
/* YAP_Term MkNewPairTerm(void) */ /* YAP_Term MkNewPairTerm(void) */
extern X_API YAP_Term YAP_MkNewPairTerm(void); extern X_API YAP_Term YAP_MkNewPairTerm(void);
@ -1726,9 +1771,10 @@ extern X_API YAP_Term YAP_TermNil(void);
extern X_API int YAP_IsTermNil(YAP_Term); extern X_API int YAP_IsTermNil(YAP_Term);
extern X_API YAP_Term YAP_MkApplTerm(YAP_Functor functor, YAP_UInt arity,YAP_Term args[]); extern X_API YAP_Term YAP_MkApplTerm(YAP_Functor functor, YAP_UInt arity,
YAP_Term args[]);
extern X_API YAP_Term YAP_MkNewApplTerm( YAP_Functor f, YAP_UInt arity); extern X_API YAP_Term YAP_MkNewApplTerm(YAP_Functor f, YAP_UInt arity);
extern X_API YAP_Functor YAP_FunctorOfTerm(YAP_Term t); extern X_API YAP_Functor YAP_FunctorOfTerm(YAP_Term t);
@ -1748,28 +1794,35 @@ extern X_API void *YAP_ExtraSpaceCut(void);
#define YAP_PRESERVE_DATA(ptr, type) (ptr = (type *)YAP_ExtraSpace()) #define YAP_PRESERVE_DATA(ptr, type) (ptr = (type *)YAP_ExtraSpace())
#define YAP_PRESERVED_DATA(ptr, type) (ptr = (type *)YAP_ExtraSpace()) #define YAP_PRESERVED_DATA(ptr, type) (ptr = (type *)YAP_ExtraSpace())
#define YAP_PRESERVED_DATA_CUT(ptr,type) (ptr = (type *)YAP_ExtraSpaceCut()) #define YAP_PRESERVED_DATA_CUT(ptr, type) (ptr = (type *)YAP_ExtraSpaceCut())
extern X_API YAP_Bool YAP_Unify(YAP_Term t1, YAP_Term t2); extern X_API YAP_Bool YAP_Unify(YAP_Term t1, YAP_Term t2);
/* void UserCPredicate(const char *name, int *fn(), int arity) */ /* void UserCPredicate(const char *name, int *fn(), int arity) */
extern X_API void YAP_UserCPredicate(const char *, YAP_UserCPred, YAP_Arity arity); extern X_API void YAP_UserCPredicate(const char *, YAP_UserCPred,
YAP_Arity arity);
/* void UserCPredicateWithArgs(const char *name, int *fn(), unsigned int arity) */ /* void UserCPredicateWithArgs(const char *name, int *fn(), unsigned int arity)
extern X_API void YAP_UserCPredicateWithArgs(const char *, YAP_UserCPred, YAP_Arity, YAP_Term); */
extern X_API void YAP_UserCPredicateWithArgs(const char *, YAP_UserCPred,
YAP_Arity, YAP_Term);
/* void UserBackCPredicate(const char *name, int *init(), int *cont(), int /* void UserBackCPredicate(const char *name, int *init(), int *cont(), int
arity, int extra) */ arity, int extra) */
extern X_API void YAP_UserBackCPredicate(const char *, YAP_UserCPred, YAP_UserCPred, YAP_Arity, YAP_Arity); extern X_API void YAP_UserBackCPredicate(const char *, YAP_UserCPred,
YAP_UserCPred, YAP_Arity, YAP_Arity);
/* YAP_Int YAP_ListLength(YAP_Term t) */ /* YAP_Int YAP_ListLength(YAP_Term t) */
extern X_API YAP_Int YAP_ListLength(YAP_Term); extern X_API YAP_Int YAP_ListLength(YAP_Term);
extern X_API size_t YAP_UTF8_TextLength(YAP_Term t); extern X_API size_t YAP_UTF8_TextLength(YAP_Term t);
/* void UserBackCPredicate(char *name, int *init(), int *cont(), int *cut(), int /* void UserBackCPredicate(char *name, int *init(), int *cont(), int *cut(),
int
arity, int extra) */ arity, int extra) */
extern X_API void YAP_UserBackCutCPredicate(const char *, YAP_UserCPred, YAP_UserCPred, YAP_UserCPred, YAP_Arity, YAP_Arity); extern X_API void YAP_UserBackCutCPredicate(const char *, YAP_UserCPred,
YAP_UserCPred, YAP_UserCPred,
YAP_Arity, YAP_Arity);
/* void CallProlog(YAP_Term t) */ /* void CallProlog(YAP_Term t) */
extern X_API YAP_Int YAP_CallProlog(YAP_Term t); extern X_API YAP_Int YAP_CallProlog(YAP_Term t);
@ -1777,15 +1830,23 @@ extern X_API YAP_Int YAP_CallProlog(YAP_Term t);
/* void cut_fail(void) */ /* void cut_fail(void) */
extern X_API void YAP_cut_up(void); extern X_API void YAP_cut_up(void);
#define YAP_cut_succeed() do { YAP_cut_up(); return TRUE; } while(0) #define YAP_cut_succeed() \
do { \
YAP_cut_up(); \
return TRUE; \
} while (0)
#define YAP_cut_fail() do { YAP_cut_up(); return FALSE; } while(0) #define YAP_cut_fail() \
do { \
YAP_cut_up(); \
return FALSE; \
} while (0)
/* void *AllocSpaceFromYAP_(int) */ /* void *AllocSpaceFromYAP_(int) */
extern X_API void *YAP_AllocSpaceFromYap(size_t); extern X_API void *YAP_AllocSpaceFromYap(size_t);
/* void *ReallocSpaceFromYAP_(void*,int) */ /* void *ReallocSpaceFromYAP_(void*,int) */
extern X_API void *YAP_ReallocSpaceFromYap(void*,size_t); extern X_API void *YAP_ReallocSpaceFromYap(void *, size_t);
/* void FreeSpaceFromYAP_(void *) */ /* void FreeSpaceFromYAP_(void *) */
extern X_API void YAP_FreeSpaceFromYap(void *); extern X_API void YAP_FreeSpaceFromYap(void *);
@ -1793,7 +1854,7 @@ extern X_API void YAP_FreeSpaceFromYap(void *);
/* int YAP_RunGoal(YAP_Term) */ /* int YAP_RunGoal(YAP_Term) */
extern X_API YAP_Int YAP_RunGoal(YAP_Term); extern X_API YAP_Int YAP_RunGoal(YAP_Term);
//extern X_API YAP_Int YAP_RunPredicate(YAP_PredEntryPtr, YAP_Term *); // extern X_API YAP_Int YAP_RunPredicate(YAP_PredEntryPtr, YAP_Term *);
/* int YAP_RunGoalOnce(YAP_Term) */ /* int YAP_RunGoalOnce(YAP_Term) */
extern X_API YAP_Int YAP_RunGoalOnce(YAP_Term); extern X_API YAP_Int YAP_RunGoalOnce(YAP_Term);
@ -1807,7 +1868,6 @@ extern X_API YAP_Bool YAP_ShutdownGoal(int);
/* int YAP_ContinueGoal(void) */ /* int YAP_ContinueGoal(void) */
extern X_API YAP_Bool YAP_ContinueGoal(void); extern X_API YAP_Bool YAP_ContinueGoal(void);
/* void YAP_PruneGoal(void) */ /* void YAP_PruneGoal(void) */
extern X_API void YAP_PruneGoal(YAP_dogoalinfo *); extern X_API void YAP_PruneGoal(YAP_dogoalinfo *);
@ -1817,13 +1877,15 @@ extern X_API YAP_PredEntryPtr YAP_FunctorToPred(YAP_Functor);
/* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */ /* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */
extern X_API YAP_PredEntryPtr YAP_AtomToPred(YAP_Atom); extern X_API YAP_PredEntryPtr YAP_AtomToPred(YAP_Atom);
extern X_API YAP_PredEntryPtr YAP_FunctorToPredInModule(YAP_Functor, YAP_Module); extern X_API YAP_PredEntryPtr YAP_FunctorToPredInModule(YAP_Functor,
YAP_Module);
/* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */ /* int YAP_AtomToPred(struct pred_entry *, YAP_Term *) */
extern X_API YAP_PredEntryPtr YAP_AtomToPredInModule(YAP_Atom, YAP_Module); extern X_API YAP_PredEntryPtr YAP_AtomToPredInModule(YAP_Atom, YAP_Module);
/* int YAP_EnterGoal(void) */ /* int YAP_EnterGoal(void) */
extern X_API YAP_Bool YAP_EnterGoal(YAP_PredEntryPtr, YAP_handle_t, YAP_dogoalinfo *); extern X_API YAP_Bool YAP_EnterGoal(YAP_PredEntryPtr, YAP_handle_t,
YAP_dogoalinfo *);
/* int YAP_RetryGoal(void) */ /* int YAP_RetryGoal(void) */
extern X_API YAP_Bool YAP_RetryGoal(YAP_dogoalinfo *); extern X_API YAP_Bool YAP_RetryGoal(YAP_dogoalinfo *);
@ -1841,9 +1903,11 @@ extern X_API int YAP_Reset(yap_reset_t reset);
extern X_API void YAP_Error(int myerrno, YAP_Term t, const char *buf, ...); extern X_API void YAP_Error(int myerrno, YAP_Term t, const char *buf, ...);
extern X_API int YAP_WriteBuffer(YAP_Term,char *,size_t,int); extern X_API int YAP_WriteBuffer(YAP_Term, char *, size_t, int);
extern X_API char* YAP_WriteDynamicBuffer(YAP_Term t,char *buf,size_t sze, size_t *lengthp, YAP_encoding_t *encp, int flags); extern X_API char *YAP_WriteDynamicBuffer(YAP_Term t, char *buf, size_t sze,
size_t *lengthp, YAP_encoding_t *encp,
int flags);
/* void YAP_Term(YAP_Term) */ /* void YAP_Term(YAP_Term) */
extern X_API YAP_Term YAP_CopyTerm(YAP_Term); extern X_API YAP_Term YAP_CopyTerm(YAP_Term);
@ -1851,9 +1915,10 @@ extern X_API YAP_Term YAP_CopyTerm(YAP_Term);
/* char *YAP_CompileClause(YAP_Term) */ /* char *YAP_CompileClause(YAP_Term) */
extern X_API char *YAP_CompileClause(YAP_Term); extern X_API char *YAP_CompileClause(YAP_Term);
extern X_API int YAP_NewExo( YAP_PredEntryPtr ap, size_t data, void *user_di); extern X_API int YAP_NewExo(YAP_PredEntryPtr ap, size_t data, void *user_di);
extern X_API int YAP_AssertTuples( YAP_PredEntryPtr pred, const YAP_Term *ts, size_t offset, size_t sz); extern X_API int YAP_AssertTuples(YAP_PredEntryPtr pred, const YAP_Term *ts,
size_t offset, size_t sz);
/* int YAP_Init(YAP_init_args *) */ /* int YAP_Init(YAP_init_args *) */
extern X_API YAP_Int YAP_Init(YAP_init_args *); extern X_API YAP_Int YAP_Init(YAP_init_args *);
@ -1862,25 +1927,29 @@ extern X_API YAP_Int YAP_Init(YAP_init_args *);
extern X_API YAP_Int YAP_FastInit(char saved_state[]); extern X_API YAP_Int YAP_FastInit(char saved_state[]);
#ifndef _PL_STREAM_H #ifndef _PL_STREAM_H
// if we don't know what a stream is, just don't assume nothing about the pointer // if we don't know what a stream is, just don't assume nothing about the
// pointer
#define IOSTREAM void #define IOSTREAM void
#endif /* FPL_STREAM_H */ #endif /* FPL_STREAM_H */
/// read a Prolog term from an operating system stream $s$. /// read a Prolog term from an operating system stream $s$.
extern X_API YAP_Term YAP_Read(FILE *s); extern X_API YAP_Term YAP_Read(FILE *s);
/// read a Prolog term from a Prolog opened stream $s$. Check YAP_OpenStream() for how to open /// read a Prolog term from a Prolog opened stream $s$. Check YAP_OpenStream()
/// for how to open
/// Prolog streams in `C`. /// Prolog streams in `C`.
extern X_API YAP_Term YAP_ReadFromStream(int s); extern X_API YAP_Term YAP_ReadFromStream(int s);
/// read a Prolog clause from a Prolog opened stream $s$. Similar to YAP_ReadFromStream() but takes /// default options from read_clause/3. /// read a Prolog clause from a Prolog opened stream $s$. Similar to
/// YAP_ReadFromStream() but takes /// default options from read_clause/3.
extern X_API YAP_Term YAP_ReadFromStream(int s); extern X_API YAP_Term YAP_ReadFromStream(int s);
extern X_API void YAP_Write(YAP_Term t,FILE *s,int); extern X_API void YAP_Write(YAP_Term t, FILE *s, int);
extern X_API FILE * YAP_TermToStream(YAP_Term t); extern X_API FILE *YAP_TermToStream(YAP_Term t);
extern X_API int YAP_InitConsult(int mode, const char *filename, int *previous_sno); extern X_API int YAP_InitConsult(int mode, const char *filename,
int *previous_sno);
extern X_API void YAP_EndConsult(int s, int *previous_sno); extern X_API void YAP_EndConsult(int s, int *previous_sno);
@ -1899,7 +1968,7 @@ extern X_API YAP_Term YAP_IntsToList(YAP_Int *, size_t);
extern X_API YAP_Int YAP_ListToInts(YAP_Term, YAP_Int *, size_t); extern X_API YAP_Int YAP_ListToInts(YAP_Term, YAP_Int *, size_t);
/* int StringToBuffer(YAP_Term,char *,unsigned int) */ /* int StringToBuffer(YAP_Term,char *,unsigned int) */
extern X_API char *YAP_StringToBuffer(YAP_Term,char *,unsigned int); extern X_API char *YAP_StringToBuffer(YAP_Term, char *, unsigned int);
extern X_API YAP_Term YAP_BufferToString(const char *s); extern X_API YAP_Term YAP_BufferToString(const char *s);
@ -1918,19 +1987,22 @@ extern X_API YAP_Term YAP_WideBufferToAtomList(const wchar_t *s);
extern X_API YAP_Term YAP_NWideBufferToAtomList(const wchar_t *s, size_t len); extern X_API YAP_Term YAP_NWideBufferToAtomList(const wchar_t *s, size_t len);
extern X_API YAP_Term YAP_NWideBufferToAtomDiffList(const wchar_t *s, YAP_Term t0, size_t len); extern X_API YAP_Term YAP_NWideBufferToAtomDiffList(const wchar_t *s,
YAP_Term t0, size_t len);
extern X_API YAP_Term YAP_BufferToDiffList(const char *s, YAP_Term t0); extern X_API YAP_Term YAP_BufferToDiffList(const char *s, YAP_Term t0);
extern X_API YAP_Term YAP_NBufferToDiffList(const char *s, YAP_Term t0, size_t len); extern X_API YAP_Term YAP_NBufferToDiffList(const char *s, YAP_Term t0,
size_t len);
extern X_API YAP_Term YAP_WideBufferToDiffList(const wchar_t *s, YAP_Term t0); extern X_API YAP_Term YAP_WideBufferToDiffList(const wchar_t *s, YAP_Term t0);
extern X_API YAP_Term YAP_NWideBufferToDiffList(const wchar_t *s, YAP_Term t0, size_t len); extern X_API YAP_Term YAP_NWideBufferToDiffList(const wchar_t *s, YAP_Term t0,
size_t len);
extern X_API YAP_Term YAP_ReadBuffer(const char *s,YAP_Term *tp); extern X_API YAP_Term YAP_ReadBuffer(const char *s, YAP_Term *tp);
extern X_API int YAP_InitSocks(const char *host,long port); extern X_API int YAP_InitSocks(const char *host, long port);
#ifdef SFUNC #ifdef SFUNC
@ -1941,7 +2013,6 @@ extern X_API YAP_Term MkSFTerm();
#endif /* SFUNC */ #endif /* SFUNC */
extern X_API void YAP_SetOutputMessage(void); extern X_API void YAP_SetOutputMessage(void);
extern X_API int YAP_StreamToFileNo(YAP_Term); extern X_API int YAP_StreamToFileNo(YAP_Term);
@ -1995,10 +2066,11 @@ extern X_API void YAP_Halt(int);
extern X_API YAP_Term *YAP_TopOfLocalStack(void); extern X_API YAP_Term *YAP_TopOfLocalStack(void);
/* int YAP_Predicate() */ /* int YAP_Predicate() */
extern X_API void *YAP_Predicate(YAP_Atom,YAP_Arity,YAP_Term); extern X_API void *YAP_Predicate(YAP_Atom, YAP_Arity, YAP_Term);
/* int YAP_Predicate() */ /* int YAP_Predicate() */
extern X_API void YAP_PredicateInfo(void *,YAP_Atom *,YAP_Arity*,YAP_Module*); extern X_API void YAP_PredicateInfo(void *, YAP_Atom *, YAP_Arity *,
YAP_Module *);
/* int YAP_CurrentModule() */ /* int YAP_CurrentModule() */
extern X_API YAP_Module YAP_CurrentModule(void); extern X_API YAP_Module YAP_CurrentModule(void);
@ -2025,7 +2097,7 @@ extern X_API YAP_agc_hook YAP_AGCRegisterHook(YAP_agc_hook hook);
extern X_API int YAP_HaltRegisterHook(YAP_halt_hook, void *); extern X_API int YAP_HaltRegisterHook(YAP_halt_hook, void *);
/* char *YAP_cwd(void) */ /* char *YAP_cwd(void) */
extern X_API char * YAP_cwd(void); extern X_API char *YAP_cwd(void);
/* thread stuff */ /* thread stuff */
extern X_API int YAP_ThreadSelf(void); extern X_API int YAP_ThreadSelf(void);
@ -2060,12 +2132,12 @@ extern X_API YAP_Term YAP_Recorded(void *);
extern X_API int YAP_Erase(void *); extern X_API int YAP_Erase(void *);
/* term utilities */ /* term utilities */
extern X_API int YAP_Variant(YAP_Term,YAP_Term); 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_Int YAP_NumberVars(YAP_Term, YAP_Int);
extern X_API YAP_Term YAP_UnNumberVars(YAP_Term); extern X_API YAP_Term YAP_UnNumberVars(YAP_Term);
extern X_API int YAP_IsNumberedVariable(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_Unifiable(YAP_Term, YAP_Term);
extern X_API int YAP_ExactlyEqual(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); extern X_API YAP_Int YAP_TermHash(YAP_Term, YAP_Int, YAP_Int, int);
extern X_API void YAP_signal(int); extern X_API void YAP_signal(int);
@ -2097,7 +2169,8 @@ extern X_API void *YAP_ExternalDataInStackFromTerm(YAP_Term t);
extern X_API YAP_Bool YAP_IsExternalDataInStackTerm(YAP_Term t); extern X_API YAP_Bool YAP_IsExternalDataInStackTerm(YAP_Term t);
extern X_API YAP_opaque_tag_t YAP_NewOpaqueType(struct YAP_opaque_handler_struct *f); extern X_API YAP_opaque_tag_t
YAP_NewOpaqueType(struct YAP_opaque_handler_struct *f);
extern X_API YAP_Bool YAP_IsOpaqueObjectTerm(YAP_Term t, YAP_opaque_tag_t tag); extern X_API YAP_Bool YAP_IsOpaqueObjectTerm(YAP_Term t, YAP_opaque_tag_t tag);
@ -2127,7 +2200,7 @@ extern X_API int YAP_RequiresExtraStack(size_t);
* @param [in,out] argc the array with processed settings YAP * @param [in,out] argc the array with processed settings YAP
* *
* @return * @return
*//* */ /*
* proccess command line arguments: valid switches are: * proccess command line arguments: valid switches are:
* -b boot file * -b boot file
* -l load file * -l load file
@ -2140,7 +2213,8 @@ extern X_API int YAP_RequiresExtraStack(size_t);
* reserved memory for alloc IF DEBUG * reserved memory for alloc IF DEBUG
* -P only in development versions * -P only in development versions
*/ */
extern X_API int YAP_parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap); extern X_API int YAP_parse_yap_arguments(int argc, char *argv[],
YAP_init_args *iap);
extern X_API YAP_Int YAP_AtomToInt(YAP_Atom At); extern X_API YAP_Int YAP_AtomToInt(YAP_Atom At);
@ -2150,7 +2224,7 @@ extern X_API YAP_Int YAP_FunctorToInt(YAP_Functor At);
extern X_API YAP_Functor YAP_IntToFunctor(YAP_Int i); extern X_API YAP_Functor YAP_IntToFunctor(YAP_Int i);
#define YAP_InitCPred(N,A,F) YAP_UserCPredicate(N,F,A) #define YAP_InitCPred(N, A, F) YAP_UserCPredicate(N, F, A)
__END_DECLS __END_DECLS