From cf39051162767a36567cffefa4a6e121e3518b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Fri, 2 May 2014 01:44:07 +0100 Subject: [PATCH 01/22] fix gcc complaint. --- H/amiops.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/H/amiops.h b/H/amiops.h index 4ebf11302..4486529d0 100644 --- a/H/amiops.h +++ b/H/amiops.h @@ -373,21 +373,21 @@ Yap_unify_constant(register Term a, register Term cons) return(FALSE); if (IsExtensionFunctor(f)) { switch((CELL)f) { - case (CELL)FunctorDBRef: + case db_ref_e: return(a == cons); - case (CELL)FunctorLongInt: + case long_int_e: { CELL d0 = RepAppl(a)[1]; CELL d1 = RepAppl(cons)[1]; return d0 == d1; } - case (CELL)FunctorDouble: + case double_e: { Float d0 = FloatOfTerm(a); Float d1 = FloatOfTerm(cons); return d0 == d1; } - case (CELL)FunctorBigInt: + case big_int_e: #ifdef USE_GMP return (Yap_gmp_tcmp_big_big(a, cons) == 0); #endif /* USE_GMP */ From 6738682c26ddda8563207753096f0c62eb4f889f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 22:26:53 +0100 Subject: [PATCH 02/22] handle int64 in 32 bits no gmp as floats.. --- C/pl-yap.c | 11 +- library/dialect/swi/fli/swi.c | 594 +++++++++++++++++++++------------- 2 files changed, 382 insertions(+), 223 deletions(-) diff --git a/C/pl-yap.c b/C/pl-yap.c index 563934770..41d5db518 100755 --- a/C/pl-yap.c +++ b/C/pl-yap.c @@ -1146,8 +1146,15 @@ X_API int PL_unify_int64__LD(term_t t, int64_t n ARG_LD) #else if ((long)n == n) return PL_unify_integer(t, n); - fprintf(stderr,"Error in PL_unify_int64: please install GMP\n"); - return FALSE; + // use a double, but will mess up writing. +else { + union { + int64_t i; + double d; + } udi_; + udi_.i = n; + return PL_unify_float(t, udi_.d); +} #endif } diff --git a/library/dialect/swi/fli/swi.c b/library/dialect/swi/fli/swi.c index 023631e11..492436427 100755 --- a/library/dialect/swi/fli/swi.c +++ b/library/dialect/swi/fli/swi.c @@ -9,6 +9,27 @@ */ +/** + * + * @defgroup swi-c-interface SWI-Prolog Foreign Language Interface. + * + * + * @tableofcontents + * + * A reimplementation of Jan Wielemaker's SWI-Prolog C-language interface, it supports + * most of the functionality in the original implementation. It allows for: + * + * - Term Construction, Access, and Unification + * - Manipulation of Atoms, Strings, Lists of Codes and Lists of Atoms + * - Query evaluation + * - Thread and Prolog engine management + * - Data-Base Access + * + * In this interface, all Prolog data known by C is referenced through term references (term_t), hence + * Prolog has all the information necessary to perform its memory management without special precautions + * from the C programmer. + */ + #define PL_KERNEL 1 //=== includes =============================================================== @@ -34,6 +55,10 @@ #include #endif +#if !HAVE_SNPRINTF +#define snprintf(X,Y,Z,A) sprintf(X,Z,A) +#endif + #define PL_KERNEL 1 #include @@ -127,16 +152,25 @@ UserCPredicate(char *a, CPredicate def, unsigned long int arity, Term mod, int f CurrentModule = cm; } -/* SWI: void PL_agc_hook(void) */ +/** @defgroup swi-ATOMS Atom Construction + * @ingroup swi-c-interface + * @{ + * */ + +/* SWI: void PL_agc_hook(void) */ +/** @brief Atom garbage collection hook + * + */ X_API PL_agc_hook_t PL_agc_hook(PL_agc_hook_t entry) { return (PL_agc_hook_t)YAP_AGCRegisterHook((YAP_agc_hook)entry); } -/* SWI: char* PL_atom_chars(atom_t atom) - YAP: char* AtomName(Atom) */ +/** @brief extract the text representation from atom + * + */ X_API char* PL_atom_chars(atom_t a) /* SAM check type */ { Atom at = SWIAtomToAtom(a); @@ -145,8 +179,9 @@ X_API char* PL_atom_chars(atom_t a) /* SAM check type */ return RepAtom(at)->StrOfAE; } -/* SWI: char* PL_atom_chars(atom_t atom) - YAP: char* AtomName(Atom) */ +/** @brief extract the text representation from atom, including its length + * + */ X_API char* PL_atom_nchars(atom_t a, size_t *len) /* SAM check type */ { char *s = RepAtom(SWIAtomToAtom(a))->StrOfAE; @@ -154,15 +189,25 @@ X_API char* PL_atom_nchars(atom_t a, size_t *len) /* SAM check type */ return s; } -/* SWI: term_t PL_copy_term_ref(term_t from) - YAP: NO EQUIVALENT */ -/* SAM TO DO */ +/** @} + * + * @defgroup swi-term_references Term References + * @ingroup swi-c-interface + * @{ + * */ + +/** @brief duplicate a term reference + * + */ X_API term_t PL_copy_term_ref(term_t from) { CACHE_REGS return Yap_InitSlot(Yap_GetFromSlot(from PASS_REGS) PASS_REGS); } +/** @brief create a new term reference + * + */ X_API term_t PL_new_term_ref(void) { @@ -171,6 +216,10 @@ X_API term_t PL_new_term_ref(void) return to; } +/** @brief create several new term references + * + * @par n is the number of references + */ X_API term_t PL_new_term_refs(int n) { CACHE_REGS @@ -178,6 +227,9 @@ X_API term_t PL_new_term_refs(int n) return to; } +/** @brief dispose of all term references created since after + * + */ X_API void PL_reset_term_refs(term_t after) { CACHE_REGS @@ -185,10 +237,50 @@ X_API void PL_reset_term_refs(term_t after) Yap_RecoverSlots(after-new PASS_REGS); } -/* begin PL_get_* functions =============================*/ +/** @} + * @defgroup swi-term_manipulation Term Manipulation + * @ingroup swi-c-interface + * */ -/* SWI: int PL_get_arg(int index, term_t t, term_t a) - YAP: YAP_Term YAP_ArgOfTerm(int argno, YAP_Term t)*/ +/** + * @defgroup swi-get-operations Reading Terms + * @ingroup swi-term_manipulation + * @{ + * */ + +/** @brief *name is assigned the name and *arity the arity if term ts, or the operaton fails. + * + */ +X_API int PL_get_name_arity(term_t ts, atom_t *name, int *arity) +{ + CACHE_REGS + YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); + if (IsAtomTerm(t)) { + *name = AtomToSWIAtom(AtomOfTerm(t)); + *arity = 0; + return 1; + } + if (YAP_IsApplTerm(t)) { + Functor f = FunctorOfTerm(t); + if (IsExtensionFunctor(f)) { + return 0; + } + *name = AtomToSWIAtom(NameOfFunctor(f)); + *arity = ArityOfFunctor(f); + return 1; + } + if (YAP_IsPairTerm(t)) { + *name = AtomToSWIAtom(AtomDot); + *arity = 2; + return 1; + } + return 0; +} + + +/** @brief a is assigned the argument index from term ts + * + */ X_API int PL_get_arg(int index, term_t ts, term_t a) { CACHE_REGS @@ -211,8 +303,9 @@ X_API int PL_get_arg(int index, term_t ts, term_t a) return 1; } -/* SWI: int PL_get_arg(int index, term_t t, term_t a) - YAP: YAP_Term YAP_ArgOfTerm(int argno, YAP_Term t)*/ +/** @brief *ap is assigned the name and *ip the arity from term ts + * + */ X_API int PL_get_compound_name_arity(term_t ts, atom_t *ap, int *ip) { CACHE_REGS @@ -237,6 +330,158 @@ X_API int PL_get_compound_name_arity(term_t ts, atom_t *ap, int *ip) } } + + +/** @brief *a is assigned the atom in term ts, or the operation fails + * + */ +X_API int PL_get_atom(term_t ts, atom_t *a) +{ + CACHE_REGS + YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); + if ( !IsAtomTerm(t)) + return 0; + *a = AtomToSWIAtom(AtomOfTerm(t)); + return 1; +} + +/** @brief *i is assigned the int in term ts, or the operation fails + * + */ +/* SWI: int PL_get_integer(term_t t, int *i) + YAP: long int YAP_IntOfTerm(Term) */ +X_API int PL_get_integer(term_t ts, int *i) +{ + CACHE_REGS + YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); + if (IsVarTerm(t) || !IsIntegerTerm(t) ) + return 0; + *i = (int)IntegerOfTerm(t); + return 1; +} + +/** @brief *i is assigned the boolean atom `true` or `false` in term ts, or the operation fails + * + */ +X_API int PL_get_long(term_t ts, long *i) +{ + CACHE_REGS + YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); + if (!YAP_IsIntTerm(t) ) { + if (YAP_IsFloatTerm(t)) { + double dbl = YAP_FloatOfTerm(t); + if (dbl - (long)dbl == 0.0) { + *i = (long)dbl; + return 1; + } + } + return 0; + } + *i = YAP_IntOfTerm(t); + return 1; +} + +/* SWI: int PL_get_bool(term_t t, int *i) + YAP: long int YAP_AtomOfTerm(Term) */ +X_API int PL_get_bool(term_t ts, int *i) +{ + CACHE_REGS + YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); + Atom at; + + if (!IsAtomTerm(t) ) + return 0; + at = AtomOfTerm(t); + if (at == AtomTrue) { + *i = TRUE; + return 1; + } + if (at == AtomFalse) { + *i = FALSE; + return 1; + } + return 0; +} + +/** @brief *a is assigned the int64 in term ts, or the operation fails + * + */ +X_API int PL_get_int64(term_t ts, int64_t *i) +{ + CACHE_REGS + YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); + if (!YAP_IsIntTerm(t) ) { + if (YAP_IsFloatTerm(t)) { + double dbl = YAP_FloatOfTerm(t); + if (dbl - (int64_t)dbl == 0.0) { + *i = (int64_t)dbl; + return 1; + } +#if SIZEOF_INT_P==4 && !USE_GMP + { + union { + double d; + int64_t i; + } udbi_; + udbi_.d = YAP_FloatOfTerm(t); + *i = udbi_.i; + return 1; + } +#endif + return 0; + } +#if USE_GMP + else if (YAP_IsBigNumTerm(t)) { + MP_INT g; + char s[64]; + YAP_BigNumOfTerm(t, (void *)&g); + if (mpz_sizeinbase(&g,2) > 64) { + return 0; + } + mpz_get_str (s, 10, &g); +#ifdef _WIN32 + sscanf(s, "%I64d", (long long int *)i); +#else + sscanf(s, "%lld", (long long int *)i); +#endif + return 1; + } +#endif + return 0; + } + *i = YAP_IntOfTerm(t); + return 1; +} + +/** @brief *a is assigned the intptr_t in term ts, or the operation fails + * + */ +X_API int PL_get_intptr(term_t ts, intptr_t *a) +{ + CACHE_REGS + Term t = Yap_GetFromSlot(ts PASS_REGS); + if ( !IsIntegerTerm(t) ) + return 0; + *a = (intptr_t)(IntegerOfTerm(t)); + return 1; +} + +/** @brief *a is assigned the uintptr_t in term ts, or the operation fails + * + */ +X_API int PL_get_uintptr(term_t ts, uintptr_t *a) +{ + CACHE_REGS + Term t = Yap_GetFromSlot(ts PASS_REGS); + if ( !IsIntegerTerm(t) ) + return 0; + *a = (uintptr_t)(IntegerOfTerm(t)); + return 1; +} + +/** @brief a is assigned the argument index from term ts + * + */ X_API int _PL_get_arg(int index, term_t ts, term_t a) { CACHE_REGS @@ -256,47 +501,11 @@ X_API int _PL_get_arg(int index, term_t ts, term_t a) Yap_PutInSlot(a,ArgOfTerm(index, t) PASS_REGS); return 1; } - - -/* SWI: int PL_get_atom(term_t t, YAP_Atom *a) - YAP: YAP_Atom YAP_AtomOfTerm(Term) */ -X_API int PL_get_atom(term_t ts, atom_t *a) -{ - CACHE_REGS - YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); - if ( !IsAtomTerm(t)) - return 0; - *a = AtomToSWIAtom(AtomOfTerm(t)); - return 1; -} -/* SWI: int PL_get_atom(term_t t, YAP_Atom *a) - YAP: YAP_Atom YAP_AtomOfTerm(Term) */ -X_API int PL_get_intptr(term_t ts, intptr_t *a) -{ - CACHE_REGS - Term t = Yap_GetFromSlot(ts PASS_REGS); - if ( !IsIntegerTerm(t) ) - return 0; - *a = (intptr_t)(IntegerOfTerm(t)); - return 1; -} - -/* SWI: int PL_get_atom(term_t t, YAP_Atom *a) - YAP: YAP_Atom YAP_AtomOfTerm(Term) */ -X_API int PL_get_uintptr(term_t ts, uintptr_t *a) -{ - CACHE_REGS - Term t = Yap_GetFromSlot(ts PASS_REGS); - if ( !IsIntegerTerm(t) ) - return 0; - *a = (uintptr_t)(IntegerOfTerm(t)); - return 1; -} - -/* SWI: int PL_get_atom_chars(term_t t, char **s) - YAP: char* AtomName(Atom) */ +/** @brief *a is assigned the string representation of the atom in term ts, or the operation fails + * + */ X_API int PL_get_atom_chars(term_t ts, char **a) /* SAM check type */ { CACHE_REGS @@ -307,8 +516,9 @@ X_API int PL_get_atom_chars(term_t ts, char **a) /* SAM check type */ return 1; } -/* SWI: int PL_get_atom_chars(term_t t, char **s) - YAP: char* AtomName(Atom) */ +/** @brief *a is assigned the string representation of the atom in term ts, and *len its size, or the operation fails + * + */ X_API int PL_get_atom_nchars(term_t ts, size_t *len, char **s) /* SAM check type */ { CACHE_REGS @@ -320,38 +530,38 @@ X_API int PL_get_atom_nchars(term_t ts, size_t *len, char **s) /* SAM check typ return 1; } -/* - int PL_get_chars(term_t +t, char **s, unsigned flags) Convert the - argument term t to a 0-terminated C-string. flags is a bitwise - disjunction from two groups of constants. The first specifies which - term-types should converted and the second how the argument is - stored. Below is a specification of these constants. BUF_RING - implies, if the data is not static (as from an atom), the data is - copied to the next buffer from a ring of sixteen (16) buffers. This is a - convenient way of converting multiple arguments passed to a foreign - predicate to C-strings. If BUF_MALLOC is used, the data must be - freed using free() when not needed any longer. +/** PL_get_chars converts a term t to a string. + * + * From the SWI manual: + * + * int PL_get_chars(term_t +t, char **s, unsigned flags) Convert the + * argument term t to a 0-terminated C-string. flags is a bitwise + * disjunction from two groups of constants. The first specifies which + * term-types should converted and the second how the argument is + * stored. Below is a specification of these constants. BUF_RING + * implies, if the data is not static (as from an atom), the data is + * copied to the next buffer from a ring of sixteen (16) buffers. This is a + * convenient way of converting multiple arguments passed to a foreign + * predicate to C-strings. If BUF_MALLOC is used, the data must be + * freed using free() when not needed any longer. - CVT_ATOM Convert if term is an atom - CVT_STRING Convert if term is a string - CVT_LIST Convert if term is a list of integers between 1 and 255 - CVT_INTEGER Convert if term is an integer (using %d) - CVT_FLOAT Convert if term is a float (using %f) - CVT_NUMBER Convert if term is a integer or float - CVT_ATOMIC Convert if term is atomic - CVT_VARIABLE Convert variable to print-name - CVT_ALL Convert if term is any of the above, except for variables - BUF_DISCARDABLE Data must copied immediately - BUF_RING Data is stored in a ring of buffers - BUF_MALLOC Data is copied to a new buffer returned by malloc(3) + - CVT_ATOM Convert if term is an atom + - CVT_STRING Convert if term is a string + - CVT_LIST Convert if term is a list of integers between 1 and 255 + - CVT_INTEGER Convert if term is an integer (using %d) + - CVT_FLOAT Convert if term is a float (using %f) + - CVT_NUMBER Convert if term is a integer or float + - CVT_ATOMIC Convert if term is atomic + - CVT_VARIABLE Convert variable to print-name + - CVT_ALL Convert if term is any of the above, except for variables + - BUF_DISCARDABLE Data must copied immediately + - BUF_RING Data is stored in a ring of buffers + - BUF_MALLOC Data is copied to a new buffer returned by malloc(3) */ -#if !HAVE_SNPRINTF -#define snprintf(X,Y,Z,A) sprintf(X,Z,A) -#endif - -/* SWI: int PL_get_functor(term_t t, functor_t *f) - YAP: YAP_Functor YAP_FunctorOfTerm(Term) */ +/** @brief *f is assigned the functor of term ts, or the operation fails + * + */ X_API int PL_get_functor(term_t ts, functor_t *f) { CACHE_REGS @@ -364,10 +574,11 @@ X_API int PL_get_functor(term_t ts, functor_t *f) return 1; } -/* SWI: int PL_get_float(term_t t, double *f) - YAP: double YAP_FloatOfTerm(Term) */ +/** @brief *f is assigned the floating point number of term ts, or the operation fails + * + */ X_API int PL_get_float(term_t ts, double *f) /* SAM type check*/ -{ +{ CACHE_REGS YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); if ( IsFloatTerm(t)) { @@ -384,6 +595,9 @@ X_API int PL_get_float(term_t ts, double *f) /* SAM type check*/ return 1; } +/** @brief *s is assigned the string representation of the string in term ts, and *len its size, or the operation fails + * + */ X_API int PL_get_string_chars(term_t t, char **s, size_t *len) { CACHE_REGS @@ -396,7 +610,26 @@ X_API int PL_get_string_chars(term_t t, char **s, size_t *len) return TRUE; } +/** @brief h is assigned the head of the pair term ts, and tl its tail, or the operation fails + * + */ +X_API int PL_get_list(term_t ts, term_t h, term_t tl) +{ + CACHE_REGS + YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); + if (IsVarTerm(t) || !IsPairTerm(t) ) { + return 0; + } + Yap_PutInSlot(h,HeadOfTerm(t) PASS_REGS); + Yap_PutInSlot(tl,TailOfTerm(t) PASS_REGS); + return 1; +} + + +/** @brief h is assigned the head of the pair term ts, or the operation fails + * + */ X_API int PL_get_head(term_t ts, term_t h) { CACHE_REGS @@ -408,102 +641,28 @@ X_API int PL_get_head(term_t ts, term_t h) return 1; } +/** @brief *s is assigned the string representation of the term ts, and *len its size, or the operation fails + * + */ X_API int PL_get_string(term_t t, char **s, size_t *len) { return PL_get_string_chars(t, s, len); } -/* SWI: int PL_get_integer(term_t t, int *i) - YAP: long int YAP_IntOfTerm(Term) */ -X_API int PL_get_integer(term_t ts, int *i) -{ - CACHE_REGS - YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); - if (IsVarTerm(t) || !IsIntegerTerm(t) ) - return 0; - *i = (int)IntegerOfTerm(t); - return 1; -} +/** + * @} + * */ -/* SWI: int PL_get_bool(term_t t, int *i) - YAP: long int YAP_AtomOfTerm(Term) */ -X_API int PL_get_bool(term_t ts, int *i) -{ - CACHE_REGS - YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); - Atom at; - - if (!IsAtomTerm(t) ) - return 0; - at = AtomOfTerm(t); - if (at == AtomTrue) { - *i = TRUE; - return 1; - } - if (at == AtomFalse) { - *i = FALSE; - return 1; - } - return 0; -} - -X_API int PL_get_long(term_t ts, long *i) -{ - CACHE_REGS - YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); - if (!YAP_IsIntTerm(t) ) { - if (YAP_IsFloatTerm(t)) { - double dbl = YAP_FloatOfTerm(t); - if (dbl - (long)dbl == 0.0) { - *i = (long)dbl; - return 1; - } - } - return 0; - } - *i = YAP_IntOfTerm(t); - return 1; -} +/** + * @defgroup swi-unify-operations Unifying Terms + * @ingroup swi-term_manipulation + * @{ + * */ -X_API int PL_get_int64(term_t ts, int64_t *i) -{ -#if SIZE_OF_INT_P==8 - return PL_get_long(ts, (long *)i); -#else - CACHE_REGS - YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); - if (!YAP_IsIntTerm(t) ) { - if (YAP_IsFloatTerm(t)) { - double dbl = YAP_FloatOfTerm(t); - if (dbl - (int64_t)dbl == 0.0) { - *i = (int64_t)dbl; - return 1; - } -#if USE_GMP - } else if (YAP_IsBigNumTerm(t)) { - MP_INT g; - char s[64]; - YAP_BigNumOfTerm(t, (void *)&g); - if (mpz_sizeinbase(&g,2) > 64) { - return 0; - } - mpz_get_str (s, 10, &g); -#ifdef _WIN32 - sscanf(s, "%I64d", (long long int *)i); -#else - sscanf(s, "%lld", (long long int *)i); -#endif - return 1; -#endif - } - return 0; - } - *i = YAP_IntOfTerm(t); - return 1; -#endif -} - +/** @brief t unifies with the true/false value in a. + * + */ X_API int PL_unify_bool(term_t t, int a) { CACHE_REGS @@ -550,18 +709,6 @@ X_API int PL_unify_mpq(term_t t, mpq_t mpq) #endif -X_API int PL_get_list(term_t ts, term_t h, term_t tl) -{ - CACHE_REGS - YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); - if (IsVarTerm(t) || !IsPairTerm(t) ) { - return 0; - } - Yap_PutInSlot(h,HeadOfTerm(t) PASS_REGS); - Yap_PutInSlot(tl,TailOfTerm(t) PASS_REGS); - return 1; -} - /* SWI: int PL_get_module(term_t t, module_t *m) */ X_API int PL_get_module(term_t ts, module_t *m) { @@ -585,34 +732,6 @@ X_API module_t PL_new_module(atom_t swiat) return Yap_GetModuleEntry(t); } -/* SWI: int PL_get_atom(term_t t, YAP_Atom *a) - YAP: YAP_Atom YAP_AtomOfTerm(Term) */ -X_API int PL_get_name_arity(term_t ts, atom_t *name, int *arity) -{ - CACHE_REGS - YAP_Term t = Yap_GetFromSlot(ts PASS_REGS); - if (IsAtomTerm(t)) { - *name = AtomToSWIAtom(AtomOfTerm(t)); - *arity = 0; - return 1; - } - if (YAP_IsApplTerm(t)) { - Functor f = FunctorOfTerm(t); - if (IsExtensionFunctor(f)) { - return 0; - } - *name = AtomToSWIAtom(NameOfFunctor(f)); - *arity = ArityOfFunctor(f); - return 1; - } - if (YAP_IsPairTerm(t)) { - *name = AtomToSWIAtom(AtomDot); - *arity = 2; - return 1; - } - return 0; -} - /* SWI: int PL_get_atom(term_t t, YAP_Atom *a) YAP: YAP_Atom YAP_AtomOfTerm(Term) */ X_API int PL_get_nil(term_t ts) @@ -913,7 +1032,18 @@ X_API int PL_put_int64(term_t t, int64_t n) Yap_PutInSlot(t,YAP_MkBigNumTerm((void *)&rop) PASS_REGS); return TRUE; #else - return FALSE; + // use a double, but will mess up writing. + Int x = n; + if (x == n) + return PL_put_integer(t, x); + else { + union { + int64_t i; + double d; + } udi_; + udi_.i = n; + return PL_put_float(t, udi_.d); + } #endif } @@ -1134,8 +1264,15 @@ X_API int PL_unify_int64(term_t t, int64_t n) #else if ((long)n == n) return PL_unify_integer(t, n); - fprintf(stderr,"Error in PL_unify_int64: please install GMP\n"); - return FALSE; + // use a double, but will mess up writing. + else { + union { + int64_t i; + double d; + } udi_; + udi_.i = n; + return PL_unify_float(t, udi_.d); + } #endif } @@ -1492,8 +1629,21 @@ int PL_unify_termv(term_t l, va_list ap) *pt++ = YAP_MkBigNumTerm((void *)&rop); } #else - fprintf(stderr, "PL_unify_term: PL_int64 not supported\n"); - exit(1); + { + int64_t i = (Int)va_arg(ap, int64_t); + intptr_t x = i; + if (x == i) + *pt++ = MkIntegerTerm( x ); + else { + // use a double, but will mess up writing. + union { + int64_t i; + double d; + } udi_; + udi_.i = i; + *pt++ = MkFloatTerm(udi_.d); + } + } #endif break; case PL_FUNCTOR: @@ -2406,13 +2556,15 @@ X_API int PL_is_inf(term_t st) { CACHE_REGS Term t = Deref(Yap_GetFromSlot(st PASS_REGS)); - Float fl; if (IsVarTerm(t)) return FALSE; if (!IsFloatTerm(t)) return FALSE; - fl = FloatOfTerm(t); #if HAVE_ISINF + Float fl; + fl = FloatOfTerm(t); return isinf(fl); #elif HAVE_FPCLASS + Float fl; + fl = FloatOfTerm(t); return (fpclass(fl) == FP_NINF || fpclass(fl) == FP_PINF); #else return FALSE; From f8ab2d093e5327f8d6ba38ca397d399b6f49b8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 22:29:23 +0100 Subject: [PATCH 03/22] work-around android bug. --- os/pl-text.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/os/pl-text.c b/os/pl-text.c index 4cc14f321..77d6de178 100644 --- a/os/pl-text.c +++ b/os/pl-text.c @@ -717,12 +717,21 @@ represented. static int wctobuffer(wchar_t c, mbstate_t *mbs, Buffer buf) -{ char b[PL_MB_LEN_MAX]; +{ +#if __ANDROID__ + // wcrtomb & friends seems broken in android, just copy + if ( c < 256 ) { + addBuffer(buf, c, char); + return TRUE; + } else { + return FALSE; + } +#else + char b[PL_MB_LEN_MAX]; size_t n; if ( (n=wcrtomb(b, c, mbs)) != (size_t)-1 ) { size_t i; - for(i=0; i Date: Sun, 4 May 2014 22:30:33 +0100 Subject: [PATCH 04/22] fix documenttion (small stuff). --- docs/yap.tex | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/docs/yap.tex b/docs/yap.tex index e9022daa9..3f5f1d08b 100644 --- a/docs/yap.tex +++ b/docs/yap.tex @@ -8804,8 +8804,7 @@ show the debugger commands. @item ! Query execute a query. YAP will not show the result of the query. @item b - break -break active execution and launch a break level. This is the same as @code{! -break}. +break active execution and launch a break level. This is the same as @code{!break}. @item + - spy this goal start spying the active goal. The same as @code{! spy G} where @var{G} is the active goal. @@ -8997,10 +8996,22 @@ type_of_verb(rest,passive). @node C-Interface,YAPLibrary,Efficiency,Top @chapter C Language interface to YAP -YAP provides the user with the necessary facilities for writing -predicates in a language other than Prolog. Since, under Unix systems, -most language implementations are link-able to C, we will describe here -only the YAP interface to the C language. +YAP provides the user with three facilities for writing +predicates in a language other than Prolog. Under Unix systems, +most language implementations were linkable to @code{C}, and the first interface exported the YAP machinery to the C language. YAP also implements most of the SWI-Prolog foreign language interface. +This gives portability with a number of SWI-Prolog packages. Last, a new C++ based interface is +being designed to work with the swig (@url(www.swig.org}) interface compiler. + +@ifplaintext +
    +
  • The original YAP C-interface exports the YAP engine. +
  • +
  • The @subpage swi-c-interface emulates Jan Wielemaker's SWI foreign language interface. +
  • +
  • The @subpage yap-cplus-interface is desiged to interface with Object-Oriented systems. +
  • +
+@end ifplaintext Before describing in full detail how to interface to C code, we will examine a brief example. @@ -10110,8 +10121,8 @@ such references. If the argument of the predicate is a variable, the routine initializes the structure to be preserved across backtracking with the information -required to provide the next solution, and exits by calling @code{ -continue_n100} to provide that solution. +required to provide the next solution, and exits by calling +@code{continue_n100} to provide that solution. 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 @@ -10785,8 +10796,9 @@ succeed. On backtracking, the system will retry generating integers for ever. Immediate semantics were used in C-Prolog. With logical update semantics, any additions or deletions of clauses -for a goal @emph{will not affect previous activations of the -goal}. In the example, the call to @code{assertz/1} will not see the +for a goal +@emph{will not affect previous activations of the goal}. In the example, +the call to @code{assertz/1} will not see the update performed by the @code{assertz/1}, and the query will have a single solution. @@ -10858,9 +10870,10 @@ database, and not "logical update semantics", as per the standard, Calling @code{set_prolog_flag(update_semantics,logical)} will switch YAP to use logical update semantics. -@item By default, YAP implements the @code{atom_chars/2} -(@pxref{Testing Terms}), and @code{number_chars/2}, (@pxref{Testing -Terms}), built-ins as per the original Quintus Prolog definition, and +@item By default, YAP implements the +@code{atom_chars/2}(@pxref{Testing Terms}), and +@code{number_chars/2}, (@pxref{Testing Terms}), +built-ins as per the original Quintus Prolog definition, and not as per the ISO definition. Calling @code{set_prolog_flag(to_chars_mode,iso)} will switch From a2e141482cdfacfc9b13206e048634aa6335db17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 22:31:22 +0100 Subject: [PATCH 05/22] keep working on C++ interface. --- CXX/yapi.cpp | 530 +++++++++++++++++++++++++-------------------------- CXX/yapi.hh | 485 +++++++++++++++++++++++++++------------------- 2 files changed, 549 insertions(+), 466 deletions(-) diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index 2dceaa440..6d0cfa0f1 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -4,411 +4,411 @@ #include "yapi.hh" YAPAtomTerm::YAPAtomTerm(char *s) { // build string - BACKUP_H(); + BACKUP_H(); - CACHE_REGS - seq_tv_t inp, out; - inp.val.c = s; - inp.type = YAP_STRING_CHARS; - out.type = YAP_STRING_ATOM; - if (Yap_CVT_Text(&inp, &out PASS_REGS)) - t = MkAtomTerm(out.val.a); - else t = 0L; - RECOVER_H(); + CACHE_REGS + seq_tv_t inp, out; + inp.val.c = s; + inp.type = YAP_STRING_CHARS; + out.type = YAP_STRING_ATOM; + if (Yap_CVT_Text(&inp, &out PASS_REGS)) + t = MkAtomTerm(out.val.a); + else t = 0L; + RECOVER_H(); } YAPAtomTerm::YAPAtomTerm(char *s, size_t len) { // build string - BACKUP_H(); + BACKUP_H(); - CACHE_REGS - seq_tv_t inp, out; - inp.val.c = s; - inp.type = YAP_STRING_CHARS; - out.type = YAP_STRING_ATOM|YAP_STRING_NCHARS|YAP_STRING_TRUNC; - out.sz = len; - out.max = len; - if (Yap_CVT_Text(&inp, &out PASS_REGS)) - t = MkAtomTerm(out.val.a); - else t = 0L; - RECOVER_H(); + CACHE_REGS + seq_tv_t inp, out; + inp.val.c = s; + inp.type = YAP_STRING_CHARS; + out.type = YAP_STRING_ATOM|YAP_STRING_NCHARS|YAP_STRING_TRUNC; + out.sz = len; + out.max = len; + if (Yap_CVT_Text(&inp, &out PASS_REGS)) + t = MkAtomTerm(out.val.a); + else t = 0L; + RECOVER_H(); } YAPAtomTerm::YAPAtomTerm(wchar_t *s): YAPTerm() { // build string - BACKUP_H(); + BACKUP_H(); - CACHE_REGS - seq_tv_t inp, out; - inp.val.w = s; - inp.type = YAP_STRING_WCHARS; - out.type = YAP_STRING_ATOM; - if (Yap_CVT_Text(&inp, &out PASS_REGS)) - t = MkAtomTerm(out.val.a); - else t = 0L; - RECOVER_H(); + CACHE_REGS + seq_tv_t inp, out; + inp.val.w = s; + inp.type = YAP_STRING_WCHARS; + out.type = YAP_STRING_ATOM; + if (Yap_CVT_Text(&inp, &out PASS_REGS)) + t = MkAtomTerm(out.val.a); + else t = 0L; + RECOVER_H(); } YAPAtomTerm::YAPAtomTerm(wchar_t *s, size_t len) : YAPTerm() { // build string - BACKUP_H(); + BACKUP_H(); - CACHE_REGS - seq_tv_t inp, out; - inp.val.w = s; - inp.type = YAP_STRING_WCHARS; - out.type = YAP_STRING_ATOM|YAP_STRING_NCHARS|YAP_STRING_TRUNC; - out.sz = len; - out.max = len; - if (Yap_CVT_Text(&inp, &out PASS_REGS)) - t = MkAtomTerm(out.val.a); - else t = 0L; - RECOVER_H(); + CACHE_REGS + seq_tv_t inp, out; + inp.val.w = s; + inp.type = YAP_STRING_WCHARS; + out.type = YAP_STRING_ATOM|YAP_STRING_NCHARS|YAP_STRING_TRUNC; + out.sz = len; + out.max = len; + if (Yap_CVT_Text(&inp, &out PASS_REGS)) + t = MkAtomTerm(out.val.a); + else t = 0L; + RECOVER_H(); } YAPStringTerm::YAPStringTerm(char *s) { // build string - BACKUP_H(); + BACKUP_H(); - CACHE_REGS - seq_tv_t inp, out; - inp.val.c = s; - inp.type = YAP_STRING_CHARS; - out.type = YAP_STRING_STRING; - if (Yap_CVT_Text(&inp, &out PASS_REGS)) - t = out.val.t; - else t = 0L; - RECOVER_H(); + CACHE_REGS + seq_tv_t inp, out; + inp.val.c = s; + inp.type = YAP_STRING_CHARS; + out.type = YAP_STRING_STRING; + if (Yap_CVT_Text(&inp, &out PASS_REGS)) + t = out.val.t; + else t = 0L; + RECOVER_H(); } YAPStringTerm::YAPStringTerm(char *s, size_t len) { // build string - BACKUP_H(); + BACKUP_H(); - CACHE_REGS - seq_tv_t inp, out; - inp.val.c = s; - inp.type = YAP_STRING_CHARS; - out.type = YAP_STRING_STRING|YAP_STRING_NCHARS|YAP_STRING_TRUNC; - out.sz = len; - out.max = len; - if (Yap_CVT_Text(&inp, &out PASS_REGS)) - t = out.val.t; - else t = 0L; - RECOVER_H(); + CACHE_REGS + seq_tv_t inp, out; + inp.val.c = s; + inp.type = YAP_STRING_CHARS; + out.type = YAP_STRING_STRING|YAP_STRING_NCHARS|YAP_STRING_TRUNC; + out.sz = len; + out.max = len; + if (Yap_CVT_Text(&inp, &out PASS_REGS)) + t = out.val.t; + else t = 0L; + RECOVER_H(); } YAPStringTerm::YAPStringTerm(wchar_t *s): YAPTerm() { // build string - BACKUP_H(); + BACKUP_H(); - CACHE_REGS - seq_tv_t inp, out; - inp.val.w = s; - inp.type = YAP_STRING_WCHARS; - out.type = YAP_STRING_STRING; - if (Yap_CVT_Text(&inp, &out PASS_REGS)) - t = out.val.t; - else t = 0L; - RECOVER_H(); + CACHE_REGS + seq_tv_t inp, out; + inp.val.w = s; + inp.type = YAP_STRING_WCHARS; + out.type = YAP_STRING_STRING; + if (Yap_CVT_Text(&inp, &out PASS_REGS)) + t = out.val.t; + else t = 0L; + RECOVER_H(); } YAPStringTerm::YAPStringTerm(wchar_t *s, size_t len) : YAPTerm() { // build string - BACKUP_H(); + BACKUP_H(); - CACHE_REGS - seq_tv_t inp, out; - inp.val.w = s; - inp.type = YAP_STRING_WCHARS; - out.type = YAP_STRING_STRING|YAP_STRING_NCHARS|YAP_STRING_TRUNC; - out.sz = len; - out.max = len; - if (Yap_CVT_Text(&inp, &out PASS_REGS)) - t = out.val.t; - else t = 0L; - RECOVER_H(); + CACHE_REGS + seq_tv_t inp, out; + inp.val.w = s; + inp.type = YAP_STRING_WCHARS; + out.type = YAP_STRING_STRING|YAP_STRING_NCHARS|YAP_STRING_TRUNC; + out.sz = len; + out.max = len; + if (Yap_CVT_Text(&inp, &out PASS_REGS)) + t = out.val.t; + else t = 0L; + RECOVER_H(); } YAPApplTerm::YAPApplTerm(YAPFunctor f, YAPTerm ts[]) : YAPTerm() { - UInt arity = ArityOfFunctor(f.f); - t = Yap_MkApplTerm( f.f, arity, (Term *)ts); + UInt arity = ArityOfFunctor(f.f); + t = Yap_MkApplTerm( f.f, arity, (Term *)ts); } YAPApplTerm::YAPApplTerm(YAPFunctor f) : YAPTerm() { - UInt arity = ArityOfFunctor(f.f); - t = Yap_MkNewApplTerm( f.f, arity); + UInt arity = ArityOfFunctor(f.f); + t = Yap_MkNewApplTerm( f.f, arity); } YAPTerm YAPApplTerm::getArg(unsigned int arg) { - return YAPTerm( ArgOfTerm(arg, t) ); + return YAPTerm( ArgOfTerm(arg, t) ); } YAPFunctor YAPApplTerm::getFunctor() { - return YAPFunctor( FunctorOfTerm(t) ); + return YAPFunctor( FunctorOfTerm(t) ); } YAPPairTerm::YAPPairTerm(YAPTerm th, YAPTerm tl) : YAPTerm() { - CACHE_REGS - t = MkPairTerm( th.t, tl.t); + CACHE_REGS + t = MkPairTerm( th.t, tl.t); } YAPPairTerm::YAPPairTerm() : YAPTerm() { - t = Yap_MkNewPairTerm( ); + t = Yap_MkNewPairTerm( ); } YAP_tag_t YAPTerm::tag() { - if (IsVarTerm(t)) { - CELL *pt = VarOfTerm(t); - if (IsUnboundVar(pt)) { - CACHE_REGS - if (IsAttVar(pt)) - return YAP_TAG_ATT; - return YAP_TAG_UNBOUND; - } - return YAP_TAG_REF; - } - if (IsPairTerm(t)) - return YAP_TAG_PAIR; - if (IsAtomOrIntTerm(t)) { - if (IsAtomTerm(t)) - return YAP_TAG_ATOM; - return YAP_TAG_INT; - } else { - Functor f = FunctorOfTerm(t); - - if (IsExtensionFunctor(f)) { - if (f == FunctorDBRef) { - return YAP_TAG_DBREF; - } - if (f == FunctorLongInt) { - return YAP_TAG_LONG_INT; - } - if (f == FunctorBigInt) { - big_blob_type bt = (big_blob_type)RepAppl(t)[1]; - switch (bt) { - case BIG_INT: - return YAP_TAG_BIG_INT; - case BIG_RATIONAL: - return YAP_TAG_RATIONAL; - default: - return YAP_TAG_OPAQUE; + if (IsVarTerm(t)) { + CELL *pt = VarOfTerm(t); + if (IsUnboundVar(pt)) { + CACHE_REGS + if (IsAttVar(pt)) + return YAP_TAG_ATT; + return YAP_TAG_UNBOUND; + } + return YAP_TAG_REF; + } + if (IsPairTerm(t)) + return YAP_TAG_PAIR; + if (IsAtomOrIntTerm(t)) { + if (IsAtomTerm(t)) + return YAP_TAG_ATOM; + return YAP_TAG_INT; + } else { + Functor f = FunctorOfTerm(t); + + if (IsExtensionFunctor(f)) { + if (f == FunctorDBRef) { + return YAP_TAG_DBREF; + } + if (f == FunctorLongInt) { + return YAP_TAG_LONG_INT; + } + if (f == FunctorBigInt) { + big_blob_type bt = (big_blob_type)RepAppl(t)[1]; + switch (bt) { + case BIG_INT: + return YAP_TAG_BIG_INT; + case BIG_RATIONAL: + return YAP_TAG_RATIONAL; + default: + return YAP_TAG_OPAQUE; + } + } + } + return YAP_TAG_APPL; } - } - } - return YAP_TAG_APPL; - } } YAPTerm YAPTerm::deepCopy() { - Term tn; - BACKUP_MACHINE_REGS(); + Term tn; + BACKUP_MACHINE_REGS(); - tn = Yap_CopyTerm(t); + tn = Yap_CopyTerm(t); - RECOVER_MACHINE_REGS(); - return new YAPTerm( tn ); + RECOVER_MACHINE_REGS(); + return new YAPTerm( tn ); } bool YAPTerm::exactlyEqual(YAPTerm t1) { - int out; - BACKUP_MACHINE_REGS(); + int out; + BACKUP_MACHINE_REGS(); - out = Yap_eq(Deref(t), Deref(t1.t)); - - RECOVER_MACHINE_REGS(); - return out; + out = Yap_eq(Deref(t), Deref(t1.t)); + + RECOVER_MACHINE_REGS(); + return out; } - + bool YAPTerm::unify(YAPTerm t1) { - int out; - BACKUP_MACHINE_REGS(); + int out; + BACKUP_MACHINE_REGS(); - out = Yap_unify(Deref(t), Deref(t1.t)); + out = Yap_unify(Deref(t), Deref(t1.t)); - RECOVER_MACHINE_REGS(); - return out; + RECOVER_MACHINE_REGS(); + return out; } bool YAPTerm::unifiable(YAPTerm t1) { - int out; - BACKUP_MACHINE_REGS(); + int out; + BACKUP_MACHINE_REGS(); - out = Yap_Unifiable(Deref(t), Deref(t1.t)); + out = Yap_Unifiable(Deref(t), Deref(t1.t)); - RECOVER_MACHINE_REGS(); - return out; + RECOVER_MACHINE_REGS(); + return out; } bool YAPTerm::variant(YAPTerm t1) { - int out; - BACKUP_MACHINE_REGS(); + int out; + BACKUP_MACHINE_REGS(); - out = Yap_Variant(Deref(t), Deref(t1.t)); + out = Yap_Variant(Deref(t), Deref(t1.t)); - RECOVER_MACHINE_REGS(); - return out; + RECOVER_MACHINE_REGS(); + return out; } intptr_t YAPTerm::hash(size_t sz, size_t depth, bool variant) { - Int out; + Int out; - BACKUP_MACHINE_REGS(); + BACKUP_MACHINE_REGS(); - out = Yap_TermHash(t, sz, depth, variant); + out = Yap_TermHash(t, sz, depth, variant); - RECOVER_MACHINE_REGS(); - return out; + RECOVER_MACHINE_REGS(); + return out; } char *YAPAtom::name(void) { - if (IsWideAtom(a)) { - // return an UTF-8 version - size_t sz = 512; - wchar_t * ptr = a->WStrOfAE; - int ch = -1; - char *s = new char[sz], *op = s; - while (ch) { - ch = *ptr++; - utf8_put_char( op, ch ); - } - sz = strlen(s)+1; - char *os = new char[sz]; - memcpy(os, s, sz); - delete s; - return os; - } else if (IsBlob(a)) { - PL_blob_t *type = RepBlobProp(a->PropsOfAE)->blob_t; - size_t sz = 512; + if (IsWideAtom(a)) { + // return an UTF-8 version + size_t sz = 512; + wchar_t * ptr = a->WStrOfAE; + int ch = -1; + char *s = new char[sz], *op = s; + while (ch) { + ch = *ptr++; + utf8_put_char( op, ch ); + } + sz = strlen(s)+1; + char *os = new char[sz]; + memcpy(os, s, sz); + delete s; + return os; + } else if (IsBlob(a)) { + PL_blob_t *type = RepBlobProp(a->PropsOfAE)->blob_t; + size_t sz = 512; - if (type->write) { - char *s = new char[sz]; - IOSTREAM *stream = Sopenmem(&s, &sz, "w"); - stream->encoding = ENC_UTF8; - atom_t at = YAP_SWIAtomFromAtom(AbsAtom(a)); - type->write(stream, at, 0); - Sclose(stream); - popOutputContext(); - sz = strlen(s)+1; - char *os = new char[sz]; - memcpy(os, s, sz); - delete s; - return os; - } else { - char *s = new char[sz]; + if (type->write) { + char *s = new char[sz]; + IOSTREAM *stream = Sopenmem(&s, &sz, "w"); + stream->encoding = ENC_UTF8; + atom_t at = YAP_SWIAtomFromAtom(AbsAtom(a)); + type->write(stream, at, 0); + Sclose(stream); + popOutputContext(); + sz = strlen(s)+1; + char *os = new char[sz]; + memcpy(os, s, sz); + delete s; + return os; + } else { + char *s = new char[sz]; #if defined(__linux__) || defined(__APPLE__) - snprintf(s, sz, "'%s'(%p)", AtomSWIStream->StrOfAE, a); + snprintf(s, sz, "'%s'(%p)", AtomSWIStream->StrOfAE, a); #else - snprintf(s, sz, "'%s'(0x%p)", AtomSWIStream->StrOfAE, a); + snprintf(s, sz, "'%s'(0x%p)", AtomSWIStream->StrOfAE, a); #endif - char *os = new char[sz]; - memcpy(os, s, sz); - delete s; - return os; - } - } else { - return a->StrOfAE; - } + char *os = new char[sz]; + memcpy(os, s, sz); + delete s; + return os; + } + } else { + return a->StrOfAE; + } } void YAPQuery::initQuery( Term *t ) { - CACHE_REGS + CACHE_REGS - this->oq = (YAPQuery *)LOCAL_execution; - LOCAL_execution = (struct open_query_struct *)this; - this->q_open=1; - this->q_state=0; - this->q_flags = 0; - this->q_g = t; + this->oq = (YAPQuery *)LOCAL_execution; + LOCAL_execution = (struct open_query_struct *)this; + this->q_open=1; + this->q_state=0; + this->q_flags = 0; + this->q_g = t; } YAPQuery::YAPQuery(YAPFunctor f, YAPTerm mod, YAPTerm t[]): YAPPredicate(f, mod) { - /* ignore flags for now */ - initQuery( (Term *)t ); + /* ignore flags for now */ + initQuery( (Term *)t ); } YAPQuery::YAPQuery(YAPFunctor f, YAPTerm t[]): YAPPredicate(f) { - /* ignore flags for now */ - initQuery( (Term *)t ); + /* ignore flags for now */ + initQuery( (Term *)t ); } YAPQuery::YAPQuery(YAPPredicate p, YAPTerm t[]): YAPPredicate(p.ap) { - initQuery( (Term *)t ); + initQuery( (Term *)t ); } YAPQuery::YAPQuery(char *s): YAPPredicate(s, &this->q_g) { - Term *t = this->q_g; + Term *t = this->q_g; - initQuery( t ); + initQuery( t ); } int YAPQuery::next() { - CACHE_REGS - int result; - if (this->q_open != 1) return 0; - if (setjmp(((YAPQuery *)LOCAL_execution)->q_env)) - return 0; - // don't forget, on success these guys must create slots - if (this->q_state == 0) { - result = YAP_EnterGoal((YAP_PredEntryPtr)this->ap, this->q_g, &this->q_h); - } else { - LOCAL_AllowRestart = this->q_open; - result = YAP_RetryGoal(&this->q_h); - } - this->q_state = 1; - if (result == 0) { - YAP_LeaveGoal(FALSE, &this->q_h); - this->q_open = 0; - } - return result; + CACHE_REGS + int result; + if (this->q_open != 1) return 0; + if (setjmp(((YAPQuery *)LOCAL_execution)->q_env)) + return 0; + // don't forget, on success these guys must create slots + if (this->q_state == 0) { + result = YAP_EnterGoal((YAP_PredEntryPtr)this->ap, this->q_g, &this->q_h); + } else { + LOCAL_AllowRestart = this->q_open; + result = YAP_RetryGoal(&this->q_h); + } + this->q_state = 1; + if (result == 0) { + YAP_LeaveGoal(FALSE, &this->q_h); + this->q_open = 0; + } + return result; } void YAPQuery::cut() { - CACHE_REGS + CACHE_REGS - if (this->q_open != 1 || this->q_state == 0) return; - YAP_LeaveGoal(FALSE, &this->q_h); - this->q_open = 0; - LOCAL_execution = (struct open_query_struct *)this->oq; + if (this->q_open != 1 || this->q_state == 0) return; + YAP_LeaveGoal(FALSE, &this->q_h); + this->q_open = 0; + LOCAL_execution = (struct open_query_struct *)this->oq; } void YAPQuery::close() { - CACHE_REGS + CACHE_REGS - if (EX && !(this->q_flags & (PL_Q_CATCH_EXCEPTION))) { - EX = NULL; - } - /* need to implement backtracking here */ - if (this->q_open != 1 || this->q_state == 0) { - return; - } - YAP_LeaveGoal(FALSE, &this->q_h); - this->q_open = 0; - LOCAL_execution = (struct open_query_struct *)this->oq; + if (EX && !(this->q_flags & (PL_Q_CATCH_EXCEPTION))) { + EX = NULL; + } + /* need to implement backtracking here */ + if (this->q_open != 1 || this->q_state == 0) { + return; + } + YAP_LeaveGoal(FALSE, &this->q_h); + this->q_open = 0; + LOCAL_execution = (struct open_query_struct *)this->oq; } int YAPPredicate::call(YAPTerm t[]) { - YAPQuery q = YAPQuery(*this, t); - int ret = q.next(); - q.cut(); - q.close(); - return ret; + YAPQuery q = YAPQuery(*this, t); + int ret = q.next(); + q.cut(); + q.close(); + return ret; } -YAP::YAP(YAPParams const& params) +YAPEngine::YAPEngine(YAPParams const& params) { YAP_Init( (YAP_init_args *)¶ms.init_args ); } diff --git a/CXX/yapi.hh b/CXX/yapi.hh index 99b74af69..a353b1b68 100644 --- a/CXX/yapi.hh +++ b/CXX/yapi.hh @@ -1,9 +1,26 @@ #define YAP_CPP_INTERFACE 1 +/** + * + * @defgroup yap-cplus-interface An object oriented interface for YAP. + * + * + * @tableofcontents + * + * + * C++ interface to YAP. Designed to be object oriented and to fit naturally + * with the swig interface language generator. It uses ideas from the old YAP + * interface and from the SWI foreign language interface. + * + */ #include +#include + +#if USE_GMP #include +#endif extern "C" { @@ -43,271 +60,337 @@ extern "C" { #include #endif - // taken from yap_structs.h +// taken from yap_structs.h #include "iopreds.h" // we cannot consult YapInterface.h, that conflicts with what we declare, though // it shouldn't } +//#include + +class YAPEngine; class YAPTermHandle; class YAPAtom; class YAPFunctor; class YAPQuery; +/** + * @brief Generic Prolog Term + */ class YAPTerm { - friend class YAPPredicate; - friend class YAPTermHandle; - friend class YAPApplTerm; - friend class YAPPairTerm; + friend class YAPPredicate; + friend class YAPTermHandle; + friend class YAPApplTerm; + friend class YAPPairTerm; protected: - Term t; + Term t; public: - YAPTerm() {} // do nothing constructor - YAPTerm(int i) { CACHE_REGS t = MkIntegerTerm( i ); } - YAPTerm(void *ptr) { CACHE_REGS t = MkIntegerTerm( (Int)ptr ); } - YAPTerm(Term tn) { t = tn; } - YAPTerm(char *s) { Term tp ; t = YAP_ReadBuffer(s,&tp); } + YAPTerm() { t = TermNil; } // do nothing constructor + YAPTerm(void *ptr) { CACHE_REGS t = MkIntegerTerm( (Int)ptr ); } + YAPTerm(Term tn) { t = tn; } + YAPTerm(char *s) { Term tp ; t = YAP_ReadBuffer(s,&tp); } - YAP_tag_t tag(); - YAPTerm deepCopy(); - bool exactlyEqual(YAPTerm t1); - bool unify(YAPTerm t1); - bool unifiable(YAPTerm t1); - bool variant(YAPTerm t1); - intptr_t hash(size_t sz, size_t depth, bool variant); - bool isVar() { return IsVarTerm(t); } - bool isAtom() { return IsAtomTerm(t); } - bool isInteger() { return IsIntegerTerm(t); } - bool isFloat() { return IsFloatTerm(t); } - bool isCompound() { return !(IsVarTerm(t) || IsNumTerm(t)); } - bool isAppl() { return IsApplTerm(t); } - bool isPair() { return IsPairTerm(t); } - bool isGround() { return Yap_IsGroundTerm(t); } - bool isList() { return Yap_IsListTerm(t); } - bool isString() { return IsStringTerm(t); } + YAP_tag_t tag(); + YAPTerm deepCopy(); + bool exactlyEqual(YAPTerm t1); + bool unify(YAPTerm t1); + bool unifiable(YAPTerm t1); + bool variant(YAPTerm t1); + intptr_t hash(size_t sz, size_t depth, bool variant); + bool isVar() { return IsVarTerm(t); } + bool isAtom() { return IsAtomTerm(t); } + bool isInteger() { return IsIntegerTerm(t); } + bool isFloat() { return IsFloatTerm(t); } + bool isCompound() { return !(IsVarTerm(t) || IsNumTerm(t)); } + bool isAppl() { return IsApplTerm(t); } + bool isPair() { return IsPairTerm(t); } + bool isGround() { return Yap_IsGroundTerm(t); } + bool isList() { return Yap_IsListTerm(t); } + bool isString() { return IsStringTerm(t); } }; +/** + * @brief Variable Term + */ class YAPVarTerm: private YAPTerm { public: - YAPVarTerm(): YAPTerm() { CACHE_REGS t = MkVarTerm(); } - CELL *getVar() { return VarOfTerm(t); } - bool unbound() { return IsUnboundVar(VarOfTerm(t)); } + YAPVarTerm(): YAPTerm() { CACHE_REGS t = MkVarTerm(); } + CELL *getVar() { return VarOfTerm(t); } + bool unbound() { return IsUnboundVar(VarOfTerm(t)); } }; +/** + * @brief Compound Term + */ class YAPApplTerm: private YAPTerm { public: - YAPApplTerm(YAPFunctor f, YAPTerm ts[]); - YAPApplTerm(YAPFunctor f); - YAPFunctor getFunctor(); - YAPTerm getArg(unsigned int i); + YAPApplTerm(YAPFunctor f, YAPTerm ts[]); + YAPApplTerm(YAPFunctor f); + YAPFunctor getFunctor(); + YAPTerm getArg(unsigned int i); }; +/** + * @brief List Constructor Term + */ class YAPPairTerm: private YAPTerm { public: - YAPPairTerm(YAPTerm hd, YAPTerm tl); - YAPPairTerm(); - YAPTerm getHead() { return YAPTerm(HeadOfTerm(t)); } - YAPTerm getTail() { return YAPTerm(TailOfTerm(t)); } + YAPPairTerm(YAPTerm hd, YAPTerm tl); + YAPPairTerm(); + YAPTerm getHead() { return YAPTerm(HeadOfTerm(t)); } + YAPTerm getTail() { return YAPTerm(TailOfTerm(t)); } }; -class YAPAtom { - friend class YAPPredicate; - friend class YAPFunctor; - friend class YAPAtomTerm; - Atom a; +/** + * @brief Integer Term + */ + +class YAPIntegerTerm: private YAPTerm { public: - YAPAtom( Atom at ) { a = at; } - YAPAtom( char * s) { a = Yap_LookupAtom( s ); } - YAPAtom( wchar_t * s) { a = Yap_LookupMaybeWideAtom( s ); } - YAPAtom( char * s, size_t len) { a = Yap_LookupAtomWithLength( s, len ); } - YAPAtom( wchar_t * s, size_t len) { a = Yap_LookupMaybeWideAtomWithLength( s, len ); } - char *name(void); + YAPIntegerTerm(intptr_t i) { CACHE_REGS t = MkIntegerTerm( i ); } + intptr_t getInteger(YAPIntegerTerm t) { return IntegerOfTerm(t.t); } + bool isTagged(YAPIntegerTerm i) { return IsIntTerm( t ); } }; +/* +class YAPListTerm: private YAPPairTerm { +public: + YAPListTerm(YAPTerm ts[], size_t n); + YAPListTerm(Term ts[], size_t n); + YAPListTerm( vector v ); + size_t length() { Term *tailp; return Yap_SkipList(&t, &tailp); } + vector toVector(); +}; + */ + +/** + * @brief Atom + */ +class YAPAtom { + friend class YAPPredicate; + friend class YAPFunctor; + friend class YAPAtomTerm; + Atom a; +public: + YAPAtom( Atom at ) { a = at; } + YAPAtom( char * s) { a = Yap_LookupAtom( s ); } + YAPAtom( wchar_t * s) { a = Yap_LookupMaybeWideAtom( s ); } + YAPAtom( char * s, size_t len) { a = Yap_LookupAtomWithLength( s, len ); } + YAPAtom( wchar_t * s, size_t len) { a = Yap_LookupMaybeWideAtomWithLength( s, len ); } + char *name(void); +}; + +/** + * @brief String Term + */ class YAPStringTerm: private YAPTerm { public: - YAPStringTerm(char *s) ; - YAPStringTerm(char *s, size_t len); - YAPStringTerm(wchar_t *s) ; - YAPStringTerm(wchar_t *s, size_t len); - const char *getString() { return StringOfTerm(t); } + YAPStringTerm(char *s) ; + YAPStringTerm(char *s, size_t len); + YAPStringTerm(wchar_t *s) ; + YAPStringTerm(wchar_t *s, size_t len); + const char *getString() { return StringOfTerm(t); } }; +/** + * @brief Atom Term + */ class YAPAtomTerm: private YAPTerm { public: - YAPAtomTerm(YAPAtom a): YAPTerm() { t = MkAtomTerm(a.a); } - YAPAtomTerm(Atom a): YAPTerm() { t = MkAtomTerm(a); } - YAPAtomTerm(char *s) ; - YAPAtomTerm(char *s, size_t len); - YAPAtomTerm(wchar_t *s) ; - YAPAtomTerm(wchar_t *s, size_t len); - YAPAtom getAtom() { return YAPAtom(AtomOfTerm(t)); } + YAPAtomTerm(YAPAtom a): YAPTerm() { t = MkAtomTerm(a.a); } + YAPAtomTerm(Atom a): YAPTerm() { t = MkAtomTerm(a); } + YAPAtomTerm(char *s) ; + YAPAtomTerm(char *s, size_t len); + YAPAtomTerm(wchar_t *s) ; + YAPAtomTerm(wchar_t *s, size_t len); + YAPAtom getAtom() { return YAPAtom(AtomOfTerm(t)); } }; +/** + * @brief Functor + */ class YAPFunctor { - friend class YAPApplTerm; - friend class YAPPredicate; - Functor f; + friend class YAPApplTerm; + friend class YAPPredicate; + Functor f; public: - YAPFunctor( char * s, unsigned int arity) { f = Yap_MkFunctor( Yap_LookupAtom( s ), arity ); } - YAPFunctor( wchar_t * s, unsigned int arity) { f = Yap_MkFunctor( Yap_LookupWideAtom( s ), arity ); } - YAPFunctor( YAPAtom at, unsigned int arity) { f = Yap_MkFunctor( at.a, arity ); } - YAPFunctor( Functor ff) { f = ff; } + YAPFunctor( char * s, unsigned int arity) { f = Yap_MkFunctor( Yap_LookupAtom( s ), arity ); } + YAPFunctor( wchar_t * s, unsigned int arity) { f = Yap_MkFunctor( Yap_LookupWideAtom( s ), arity ); } + YAPFunctor( YAPAtom at, unsigned int arity) { f = Yap_MkFunctor( at.a, arity ); } + YAPFunctor( Functor ff) { f = ff; } - Atom name(void) { - return NameOfFunctor( f ); - } + Atom name(void) { + return NameOfFunctor( f ); + } - unsigned int arity(void) { - return ArityOfFunctor( f ); - } + unsigned int arity(void) { + return ArityOfFunctor( f ); + } }; +/** + * @brief Term Handle + */ class YAPTermHandle { - long int handle; + long int handle; public: - YAPTermHandle(Term t) { - CACHE_REGS - handle = Yap_InitSlot(t PASS_REGS); - } - ~YAPTermHandle(void) { - CACHE_REGS - Yap_RecoverSlots(1 PASS_REGS); - } + YAPTermHandle(Term t) { + CACHE_REGS + handle = Yap_InitSlot(t PASS_REGS); + } + ~YAPTermHandle(void) { + CACHE_REGS + Yap_RecoverSlots(1 PASS_REGS); + } - YAPTerm get() { - CACHE_REGS - return new YAPTerm( Yap_GetFromSlot(handle PASS_REGS) ); - } - - void set(YAPTerm t) { - CACHE_REGS - Yap_PutInSlot(handle, t.t PASS_REGS); - } + YAPTerm get() { + CACHE_REGS + return new YAPTerm( Yap_GetFromSlot(handle PASS_REGS) ); + } + + void set(YAPTerm t) { + CACHE_REGS + Yap_PutInSlot(handle, t.t PASS_REGS); + } }; - + +/** + * @brief Predicate + */ class YAPPredicate { - friend class YAPQuery; - PredEntry *ap; - // trick to communicate t[] back to yapquery - YAPPredicate(char *s, Term **th) { - CACHE_REGS - Term t, tp, m = CurrentModule ; - t = YAP_ReadBuffer(s,&tp); - t = Yap_StripModule(t, &m); - if (IsVarTerm(t) || IsNumTerm(t)) - ap = NULL; - if (IsAtomTerm(t)) { - ap = RepPredProp(PredPropByAtom(AtomOfTerm(t), m)); - *th = NULL; - } else if (IsApplTerm(t)) { - ap = RepPredProp(PredPropByFunc(FunctorOfTerm(t), m)); - *th = RepAppl(t)+1; - } else { - ap = NULL; - } - } + friend class YAPQuery; + PredEntry *ap; + // trick to communicate t[] back to yapquery + YAPPredicate(char *s, Term **th) { + CACHE_REGS + Term t, tp, m = CurrentModule ; + t = YAP_ReadBuffer(s,&tp); + t = Yap_StripModule(t, &m); + if (IsVarTerm(t) || IsNumTerm(t)) + ap = NULL; + if (IsAtomTerm(t)) { + ap = RepPredProp(PredPropByAtom(AtomOfTerm(t), m)); + *th = NULL; + } else if (IsApplTerm(t)) { + ap = RepPredProp(PredPropByFunc(FunctorOfTerm(t), m)); + *th = RepAppl(t)+1; + } else { + ap = NULL; + } + } public: - YAPPredicate(PredEntry *pe) { - ap = pe; - } - YAPPredicate(YAPFunctor f) { - CACHE_REGS - ap = RepPredProp(PredPropByFunc(f.f,CurrentModule)); - } - YAPPredicate(YAPFunctor f, YAPTerm mod) { - ap = RepPredProp(PredPropByFunc(f.f,mod.t)); - } - YAPPredicate(YAPAtom at, YAPTerm mod) { - ap = RepPredProp(PredPropByAtom(at.a,mod.t)); - } - YAPPredicate(YAPAtom at) { - CACHE_REGS - ap = RepPredProp(PredPropByAtom(at.a,CurrentModule)); - } - YAPPredicate(YAPAtom at, unsigned int arity, YAPTerm mod) { - if (arity) { - Functor f = Yap_MkFunctor(at.a, arity); - ap = RepPredProp(PredPropByFunc(f,mod.t)); - } else { - ap = RepPredProp(PredPropByAtom(at.a,mod.t)); - } - } - YAPPredicate(YAPAtom at, unsigned int arity) { - CACHE_REGS - if (arity) { - Functor f = Yap_MkFunctor(at.a, arity); - ap = RepPredProp(PredPropByFunc(f,CurrentModule)); - } else { - ap = RepPredProp(PredPropByAtom(at.a,CurrentModule)); - } - } - YAPPredicate(char *s) { - CACHE_REGS - Term t, tp, m = CurrentModule ; - t = YAP_ReadBuffer(s,&tp); - t = Yap_StripModule(t, &m); - if (IsVarTerm(t) || IsNumTerm(t)) - ap = NULL; - if (IsAtomTerm(t)) { - ap = RepPredProp(PredPropByAtom(AtomOfTerm(t), m)); - } else { - ap = RepPredProp(PredPropByFunc(FunctorOfTerm(t), m)); - } - } - int call(YAPTerm ts[]); + YAPPredicate(PredEntry *pe) { + ap = pe; + } + YAPPredicate(YAPFunctor f) { + CACHE_REGS + ap = RepPredProp(PredPropByFunc(f.f,CurrentModule)); + } + YAPPredicate(YAPFunctor f, YAPTerm mod) { + ap = RepPredProp(PredPropByFunc(f.f,mod.t)); + } + YAPPredicate(YAPAtom at, YAPTerm mod) { + ap = RepPredProp(PredPropByAtom(at.a,mod.t)); + } + YAPPredicate(YAPAtom at) { + CACHE_REGS + ap = RepPredProp(PredPropByAtom(at.a,CurrentModule)); + } + YAPPredicate(YAPAtom at, unsigned int arity, YAPTerm mod) { + if (arity) { + Functor f = Yap_MkFunctor(at.a, arity); + ap = RepPredProp(PredPropByFunc(f,mod.t)); + } else { + ap = RepPredProp(PredPropByAtom(at.a,mod.t)); + } + } + YAPPredicate(YAPAtom at, unsigned int arity) { + CACHE_REGS + if (arity) { + Functor f = Yap_MkFunctor(at.a, arity); + ap = RepPredProp(PredPropByFunc(f,CurrentModule)); + } else { + ap = RepPredProp(PredPropByAtom(at.a,CurrentModule)); + } + } + YAPPredicate(char *s) { + CACHE_REGS + Term t, tp, m = CurrentModule ; + t = YAP_ReadBuffer(s,&tp); + t = Yap_StripModule(t, &m); + if (IsVarTerm(t) || IsNumTerm(t)) + ap = NULL; + if (IsAtomTerm(t)) { + ap = RepPredProp(PredPropByAtom(AtomOfTerm(t), m)); + } else { + ap = RepPredProp(PredPropByFunc(FunctorOfTerm(t), m)); + } + } + int call(YAPTerm ts[]); }; - -/// interface to a YAP Query -/// uses an SWI-like status info internally + +/** + * @brief Term Handle + * + * interface to a YAP Query; + * uses an SWI-like status info internally. + */ class YAPQuery: private YAPPredicate { - int q_open; - int q_state; - Term *q_g; - yamop *q_p, *q_cp; - jmp_buf q_env; - int q_flags; - YAP_dogoalinfo q_h; - YAPQuery *oq; - void initQuery( Term *t ); + int q_open; + int q_state; + Term *q_g; + yamop *q_p, *q_cp; + jmp_buf q_env; + int q_flags; + YAP_dogoalinfo q_h; + YAPQuery *oq; + void initQuery( Term *t ); public: - /// full constructor, is given a functor, module, and an array of terms that must hav at least - /// the same arity as the functor. - YAPQuery(YAPFunctor f, YAPTerm mod, YAPTerm t[]); - YAPQuery(YAPFunctor f, YAPTerm t[]); - YAPQuery(YAPPredicate p, YAPTerm t[]); - YAPQuery(char *s); - // YAPQuery(YAPTerm t); - int next(); - void cut(); - void close(); + /// full constructor, is given a functor, module, and an array of terms that must hav at least + /// the same arity as the functor. + YAPQuery(YAPFunctor f, YAPTerm mod, YAPTerm t[]); + YAPQuery(YAPFunctor f, YAPTerm t[]); + YAPQuery(YAPPredicate p, YAPTerm t[]); + YAPQuery(char *s); + // YAPQuery(YAPTerm t); + int next(); + void cut(); + void close(); }; class YAPParams; -class YAP { +/** + * @brief YAP Constructor + * + */ +class YAPEngine { public: - YAP(YAPParams const& params); + YAPEngine(YAPParams const& params); }; +/** + * @brief Parameters for YAP Constructor + * + */ class YAPParams { - friend YAP; - YAP_init_args init_args; + friend class YAPEngine; + YAP_init_args init_args; public: - YAPParams(); - // sets all the default values for each data member - YAPParams& savedState( char * f); - YAPParams& stackSize(size_t sz); - YAPParams& trailSize(size_t sz); - YAPParams& maxStackSize(size_t sz); - YAPParams& maxTrailSize(size_t sz); - YAPParams& libDir(char *p); - YAPParams& bootFile(char *f); - YAPParams& goal(char *g); - YAPParams& topLevel(char *g); - YAPParams& script(bool v); - YAPParams& fastBoot(bool v); + YAPParams(); + // sets all the default values for each data member + YAPParams& savedState( char * f); + YAPParams& stackSize(size_t sz); + YAPParams& trailSize(size_t sz); + YAPParams& maxStackSize(size_t sz); + YAPParams& maxTrailSize(size_t sz); + YAPParams& libDir(char *p); + YAPParams& bootFile(char *f); + YAPParams& goal(char *g); + YAPParams& topLevel(char *g); + YAPParams& script(bool v); + YAPParams& fastBoot(bool v); }; inline YAPParams::YAPParams() From ba523a7910c05bc95b9e921c2cfd7957a624a2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 22:32:18 +0100 Subject: [PATCH 06/22] eclipse stuff. --- docs/doxygen.rc | 554 ++++++++++++++++++++++-------------------------- 1 file changed, 248 insertions(+), 306 deletions(-) diff --git a/docs/doxygen.rc b/docs/doxygen.rc index 3dcb32612..3e4624df8 100644 --- a/docs/doxygen.rc +++ b/docs/doxygen.rc @@ -24,7 +24,7 @@ # for the list of possible encodings. # The default value is: UTF-8. -DOXYFILE_ENCODING = UTF-8 +DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the @@ -32,33 +32,33 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = yap-6 +PROJECT_NAME = yap-6 # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = +PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify an logo or icon that is included in # the documentation. The maximum height of the logo should not exceed 55 pixels # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo # to the output directory. -PROJECT_LOGO = misc/icons/yap_96x96x32.png +PROJECT_LOGO = misc/icons/yap_96x96x32.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = doxout +OUTPUT_DIRECTORY = doxout # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -68,7 +68,7 @@ OUTPUT_DIRECTORY = doxout # performance problems for the file system. # The default value is: NO. -CREATE_SUBDIRS = YES +CREATE_SUBDIRS = YES # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this @@ -83,14 +83,14 @@ CREATE_SUBDIRS = YES # Ukrainian and Vietnamese. # The default value is: English. -OUTPUT_LANGUAGE = English +OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. -BRIEF_MEMBER_DESC = YES +BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief # description of a member or function before the detailed description @@ -99,7 +99,7 @@ BRIEF_MEMBER_DESC = YES # brief descriptions will be completely suppressed. # The default value is: YES. -REPEAT_BRIEF = YES +REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found @@ -110,24 +110,14 @@ REPEAT_BRIEF = YES # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the +ABBREVIATE_BRIEF = "The $name class" "The $name widget" "The $name file" is provides specifies contains represents a an the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. -ALWAYS_DETAILED_SEC = NO +ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those @@ -135,14 +125,14 @@ ALWAYS_DETAILED_SEC = NO # operators of the base classes will not be shown. # The default value is: NO. -INLINE_INHERITED_MEMB = NO +INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. -FULL_PATH_NAMES = YES +FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand @@ -154,7 +144,7 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -163,14 +153,14 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. -SHORT_NAMES = NO +SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief @@ -179,7 +169,7 @@ SHORT_NAMES = NO # description.) # The default value is: NO. -JAVADOC_AUTOBRIEF = NO +JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If @@ -187,7 +177,7 @@ JAVADOC_AUTOBRIEF = NO # requiring an explicit \brief command for a brief description.) # The default value is: NO. -QT_AUTOBRIEF = NO +QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as @@ -205,20 +195,20 @@ MULTILINE_CPP_IS_BRIEF = NO # documentation from any documented member that it re-implements. # The default value is: YES. -INHERIT_DOCS = YES +INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a # new page for each member. If set to NO, the documentation of a member will be # part of the file/class/namespace that contains it. # The default value is: NO. -SEPARATE_MEMBER_PAGES = NO +SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. -TAB_SIZE = 4 +TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: @@ -230,18 +220,14 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES ="predicate=@brief" \ - "doxygen=\if english" \ - "endenglish=\endif" \ - "dutch=\if dutch" \ - "enddutch=\endif" +ALIASES = "predicate=@brief" "doxygen=\if english" "endenglish=\endif" "dutch=\if dutch" "enddutch=\endif" # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -249,9 +235,9 @@ TCL_SUBST = # members will be omitted, etc. # The default value is: NO. -OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_FOR_PROLOG = YES +OPTIMIZE_OUTPUT_FOR_PROLOG = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored @@ -259,19 +245,19 @@ OPTIMIZE_OUTPUT_FOR_PROLOG = YES # qualified scopes will look different, etc. # The default value is: NO. -OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. -OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. -OPTIMIZE_OUTPUT_VHDL = NO +OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given @@ -287,7 +273,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = md pl=Prolog +EXTENSION_MAPPING = md pl=Prolog # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -297,7 +283,7 @@ EXTENSION_MAPPING = md pl=Prolog # case of backward compatibilities issues. # The default value is: YES. -MARKDOWN_SUPPORT = YES +MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can @@ -305,7 +291,7 @@ MARKDOWN_SUPPORT = YES # or globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. -AUTOLINK_SUPPORT = YES +AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this @@ -315,13 +301,13 @@ AUTOLINK_SUPPORT = YES # diagrams that involve STL classes more complete and accurate. # The default value is: NO. -BUILTIN_STL_SUPPORT = NO +BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. -CPP_CLI_SUPPORT = NO +CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen @@ -329,7 +315,7 @@ CPP_CLI_SUPPORT = NO # of private inheritance when no explicit protection keyword is present. # The default value is: NO. -SIP_SUPPORT = NO +SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make @@ -339,7 +325,7 @@ SIP_SUPPORT = NO # should set this option to NO. # The default value is: YES. -IDL_PROPERTY_SUPPORT = YES +IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first @@ -347,7 +333,7 @@ IDL_PROPERTY_SUPPORT = YES # all members of a group must be documented explicitly. # The default value is: NO. -DISTRIBUTE_GROUP_DOC = NO +DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that @@ -356,7 +342,7 @@ DISTRIBUTE_GROUP_DOC = NO # \nosubgrouping command. # The default value is: YES. -SUBGROUPING = YES +SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) @@ -377,7 +363,7 @@ INLINE_GROUPED_CLASSES = NO # Man pages) or section (for LaTeX and RTF). # The default value is: NO. -INLINE_SIMPLE_STRUCTS = NO +INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So @@ -388,7 +374,7 @@ INLINE_SIMPLE_STRUCTS = NO # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. -TYPEDEF_HIDES_STRUCT = NO +TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be @@ -401,7 +387,7 @@ TYPEDEF_HIDES_STRUCT = NO # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. -LOOKUP_CACHE_SIZE = 0 +LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options @@ -415,25 +401,25 @@ LOOKUP_CACHE_SIZE = 0 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class will # be included in the documentation. # The default value is: NO. -EXTRACT_PRIVATE = NO +EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES all members with package or internal # scope will be included in the documentation. # The default value is: NO. -EXTRACT_PACKAGE = NO +EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file will be # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined # locally in source files will be included in the documentation. If set to NO @@ -441,7 +427,7 @@ EXTRACT_STATIC = NO # for Java sources. # The default value is: YES. -EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local methods, # which are defined in the implementation section but not in the interface are @@ -449,7 +435,7 @@ EXTRACT_LOCAL_CLASSES = YES # included. # The default value is: NO. -EXTRACT_LOCAL_METHODS = NO +EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called @@ -458,7 +444,7 @@ EXTRACT_LOCAL_METHODS = NO # are hidden. # The default value is: NO. -EXTRACT_ANON_NSPACES = NO +EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these @@ -466,7 +452,7 @@ EXTRACT_ANON_NSPACES = NO # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. -HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set @@ -474,28 +460,28 @@ HIDE_UNDOC_MEMBERS = NO # no effect if EXTRACT_ALL is enabled. # The default value is: NO. -HIDE_UNDOC_CLASSES = NO +HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO these declarations will be # included in the documentation. # The default value is: NO. -HIDE_FRIEND_COMPOUNDS = NO +HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. -HIDE_IN_BODY_DOCS = NO +HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. -INTERNAL_DOCS = NO +INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES upper-case letters are also @@ -504,46 +490,46 @@ INTERNAL_DOCS = NO # and Mac users are advised to set this option to NO. # The default value is: system dependent. -CASE_SENSE_NAMES = NO +CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES the # scope will be hidden. # The default value is: NO. -HIDE_SCOPE_NAMES = YES +HIDE_SCOPE_NAMES = YES # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. -SHOW_INCLUDE_FILES = YES +SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. -SHOW_GROUPED_MEMB_INC = NO +SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. -FORCE_LOCAL_INCLUDES = NO +FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. -INLINE_INFO = YES +INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO the members will appear in declaration order. # The default value is: YES. -SORT_MEMBER_DOCS = YES +SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member @@ -551,7 +537,7 @@ SORT_MEMBER_DOCS = YES # this will also influence the order of the classes in the class list. # The default value is: NO. -SORT_BRIEF_DOCS = NO +SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and @@ -570,7 +556,7 @@ SORT_MEMBERS_CTORS_1ST = NO # appear in their defined order. # The default value is: NO. -SORT_GROUP_NAMES = NO +SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will @@ -580,7 +566,7 @@ SORT_GROUP_NAMES = NO # list. # The default value is: NO. -SORT_BY_SCOPE_NAME = NO +SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between @@ -590,40 +576,40 @@ SORT_BY_SCOPE_NAME = NO # accept a match between prototype and implementation in such cases. # The default value is: NO. -STRICT_PROTO_MATCHING = NO +STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the # todo list. This list is created by putting \todo commands in the # documentation. # The default value is: YES. -GENERATE_TODOLIST = YES +GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the # test list. This list is created by putting \test commands in the # documentation. # The default value is: YES. -GENERATE_TESTLIST = YES +GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. -GENERATE_BUGLIST = YES +GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. -GENERATE_DEPRECATEDLIST= YES +GENERATE_DEPRECATEDLIST = YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -634,28 +620,28 @@ ENABLED_SECTIONS = # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. -MAX_INITIALIZER_LINES = 30 +MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES the list # will mention the files that were used to generate the documentation. # The default value is: YES. -SHOW_USED_FILES = YES +SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. -SHOW_FILES = YES +SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. -SHOW_NAMESPACES = YES +SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from @@ -665,7 +651,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -678,7 +664,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -689,7 +675,7 @@ LAYOUT_FILE = # search path. Do not use file names with spaces, bibtex cannot handle them. See # also \cite for info how to create references. -CITE_BIB_FILES = docs/yap.bib +CITE_BIB_FILES = docs/yap.bib #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -700,7 +686,7 @@ CITE_BIB_FILES = docs/yap.bib # messages are off. # The default value is: NO. -QUIET = NO +QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES @@ -709,14 +695,14 @@ QUIET = NO # Tip: Turn warnings on while writing the documentation. # The default value is: YES. -WARNINGS = YES +WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. -WARN_IF_UNDOCUMENTED = YES +WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters @@ -724,7 +710,7 @@ WARN_IF_UNDOCUMENTED = YES # markup commands wrongly. # The default value is: YES. -WARN_IF_DOC_ERROR = YES +WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return @@ -732,7 +718,7 @@ WARN_IF_DOC_ERROR = YES # documentation, but not about the absence of documentation. # The default value is: NO. -WARN_NO_PARAMDOC = NO +WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which @@ -742,13 +728,13 @@ WARN_NO_PARAMDOC = NO # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. -WARN_FORMAT = "$file:$line: $text" +WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -760,7 +746,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = docs/yap.md pl/absf.yap C/cmppreds.c C/eval.c H/eval.h C/arith0.c C/arith1.c C/arith2.c pl/arithpreds.yap +INPUT = docs/yap.md pl/absf.yap C/cmppreds.c C/eval.c H/eval.h C/arith0.c C/arith1.c C/arith2.c pl/arithpreds.yap CXX library/dialect/swi/fli # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -769,7 +755,7 @@ INPUT = docs/yap.md pl/absf.yap C/cmppreds.c C/eval.c H/eval.h # possible encodings. # The default value is: UTF-8. -INPUT_ENCODING = UTF-8 +INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and @@ -780,57 +766,13 @@ INPUT_ENCODING = UTF-8 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.h.in \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.f90 \ - *.f \ - *.for \ - *.tcl \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.as \ - *.js \ - *.pl \ - *.yap +FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.idl *.ddl *.odl *.h *.h.in *.hh *.hxx *.hpp *.h++ *.cs *.d *.php *.php4 *.php5 *.phtml *.inc *.m *.markdown *.md *.mm *.dox *.py *.f90 *.f *.for *.tcl *.vhd *.vhdl *.ucf *.qsf *.as *.js *.pl *.yap # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. -RECURSIVE = YES +RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a @@ -839,14 +781,14 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. -EXCLUDE_SYMLINKS = NO +EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude @@ -855,7 +797,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -866,33 +808,33 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. -EXAMPLE_PATTERNS = * +EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. -EXAMPLE_RECURSIVE = NO +EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -909,7 +851,7 @@ IMAGE_PATH = # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -918,14 +860,14 @@ INPUT_FILTER = # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER ) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. -FILTER_SOURCE_FILES = NO +FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and @@ -953,20 +895,20 @@ USE_MDFILE_AS_MAINPAGE = NO # also VERBATIM_HEADERS is set to NO. # The default value is: NO. -SOURCE_BROWSER = YES +SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. -INLINE_SOURCES = YES +INLINE_SOURCES = YES # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. -STRIP_CODE_COMMENTS = YES +STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. @@ -978,7 +920,7 @@ REFERENCED_BY_RELATION = NO # all documented entities called/used by that function will be listed. # The default value is: NO. -REFERENCES_RELATION = NO +REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES, then the hyperlinks from functions in REFERENCES_RELATION and @@ -996,7 +938,7 @@ REFERENCES_LINK_SOURCE = YES # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. -SOURCE_TOOLTIPS = YES +SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in @@ -1018,7 +960,7 @@ SOURCE_TOOLTIPS = YES # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. -USE_HTAGS = NO +USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is @@ -1026,7 +968,7 @@ USE_HTAGS = NO # See also: Section \class. # The default value is: YES. -VERBATIM_HEADERS = YES +VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more acurate parsing at the @@ -1045,7 +987,7 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1056,14 +998,14 @@ CLANG_OPTIONS = # classes, structs, unions or interfaces. # The default value is: YES. -ALPHABETICAL_INDEX = YES +ALPHABETICAL_INDEX = YES # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -COLS_IN_ALPHA_INDEX = 5 +COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag @@ -1071,7 +1013,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1080,7 +1022,7 @@ IGNORE_PREFIX = # If the GENERATE_HTML tag is set to YES doxygen will generate HTML output # The default value is: YES. -GENERATE_HTML = YES +GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1088,14 +1030,14 @@ GENERATE_HTML = YES # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_OUTPUT = html +HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FILE_EXTENSION = .html +HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a @@ -1115,7 +1057,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1125,7 +1067,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1137,7 +1079,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- # defined cascading style sheet that is included after the standard style sheets @@ -1148,7 +1090,7 @@ HTML_STYLESHEET = # see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1158,7 +1100,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to @@ -1169,7 +1111,7 @@ HTML_EXTRA_FILES = # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_COLORSTYLE_HUE = 220 +HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A @@ -1177,7 +1119,7 @@ HTML_COLORSTYLE_HUE = 220 # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_COLORSTYLE_SAT = 100 +HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 @@ -1188,7 +1130,7 @@ HTML_COLORSTYLE_SAT = 100 # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_COLORSTYLE_GAMMA = 80 +HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this @@ -1196,7 +1138,7 @@ HTML_COLORSTYLE_GAMMA = 80 # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_TIMESTAMP = YES +HTML_TIMESTAMP = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the @@ -1204,7 +1146,7 @@ HTML_TIMESTAMP = YES # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_DYNAMIC_SECTIONS = NO +HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand @@ -1231,7 +1173,7 @@ HTML_INDEX_NUM_ENTRIES = 100 # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_DOCSET = NO +GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider @@ -1239,7 +1181,7 @@ GENERATE_DOCSET = NO # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. -DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. @@ -1247,7 +1189,7 @@ DOCSET_FEEDNAME = "Doxygen generated docs" # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. -DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style @@ -1255,13 +1197,13 @@ DOCSET_BUNDLE_ID = org.doxygen.Project # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. -DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. -DOCSET_PUBLISHER_NAME = Publisher +DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The @@ -1279,14 +1221,14 @@ DOCSET_PUBLISHER_NAME = Publisher # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_HTMLHELP = NO +GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler ( hhc.exe). If non-empty @@ -1294,34 +1236,34 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated ( # YES) or that it should be included in the master .chm file ( NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -GENERATE_CHI = NO +GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated ( # YES) or a normal table of contents ( NO) in the .chm file. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -BINARY_TOC = NO +BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -TOC_EXPAND = NO +TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that @@ -1330,14 +1272,14 @@ TOC_EXPAND = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_QHP = NO +GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1345,7 +1287,7 @@ QCH_FILE = # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_NAMESPACE = org.doxygen.Project +QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual @@ -1354,7 +1296,7 @@ QHP_NAMESPACE = org.doxygen.Project # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_VIRTUAL_FOLDER = doc +QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom @@ -1362,7 +1304,7 @@ QHP_VIRTUAL_FOLDER = doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1370,21 +1312,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1396,7 +1338,7 @@ QHG_LOCATION = # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_ECLIPSEHELP = NO +GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this @@ -1404,7 +1346,7 @@ GENERATE_ECLIPSEHELP = NO # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. -ECLIPSE_DOC_ID = org.doxygen.Project +ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The @@ -1415,7 +1357,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -DISABLE_INDEX = NO +DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag @@ -1432,7 +1374,7 @@ DISABLE_INDEX = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = YES +GENERATE_TREEVIEW = YES # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. @@ -1442,21 +1384,21 @@ GENERATE_TREEVIEW = YES # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. -ENUM_VALUES_PER_LINE = 4 +ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. -TREEVIEW_WIDTH = 250 +TREEVIEW_WIDTH = 250 # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -EXT_LINKS_IN_WINDOW = NO +EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful @@ -1465,7 +1407,7 @@ EXT_LINKS_IN_WINDOW = NO # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. -FORMULA_FONTSIZE = 10 +FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not @@ -1476,7 +1418,7 @@ FORMULA_FONTSIZE = 10 # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. -FORMULA_TRANSPARENT = YES +FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering @@ -1487,7 +1429,7 @@ FORMULA_TRANSPARENT = YES # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -USE_MATHJAX = NO +USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: @@ -1497,7 +1439,7 @@ USE_MATHJAX = NO # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_FORMAT = HTML-CSS +MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory @@ -1510,14 +1452,14 @@ MATHJAX_FORMAT = HTML-CSS # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1525,7 +1467,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1546,7 +1488,7 @@ MATHJAX_CODEFILE = # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. -SEARCHENGINE = YES +SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a web server instead of a web client using Javascript. There @@ -1558,7 +1500,7 @@ SEARCHENGINE = YES # The default value is: NO. # This tag requires that the tag SEARCHENGINE is set to YES. -SERVER_BASED_SEARCH = NO +SERVER_BASED_SEARCH = NO # When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP # script for searching. Instead the search results are written to an XML file @@ -1574,7 +1516,7 @@ SERVER_BASED_SEARCH = NO # The default value is: NO. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH = NO +EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. @@ -1585,7 +1527,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1593,7 +1535,7 @@ SEARCHENGINE_URL = # The default file is: searchdata.xml. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHDATA_FILE = searchdata.xml +SEARCHDATA_FILE = searchdata.xml # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the # EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is @@ -1601,7 +1543,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1611,7 +1553,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1620,7 +1562,7 @@ EXTRA_SEARCH_MAPPINGS = # If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. # The default value is: YES. -GENERATE_LATEX = YES +GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1628,7 +1570,7 @@ GENERATE_LATEX = YES # The default directory is: latex. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_OUTPUT = latex +LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. @@ -1639,14 +1581,14 @@ LATEX_OUTPUT = latex # The default file is: latex. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_CMD_NAME = latex +LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. -MAKEINDEX_CMD_NAME = makeindex +MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some @@ -1654,7 +1596,7 @@ MAKEINDEX_CMD_NAME = makeindex # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. -COMPACT_LATEX = NO +COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used by the # printer. @@ -1663,7 +1605,7 @@ COMPACT_LATEX = NO # The default value is: a4. # This tag requires that the tag GENERATE_LATEX is set to YES. -PAPER_TYPE = a4 +PAPER_TYPE = a4 # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names # that should be included in the LaTeX output. To get the times font for @@ -1672,7 +1614,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1688,7 +1630,7 @@ EXTRA_PACKAGES = # PROJECT_NAME), or the project number (see PROJECT_NUMBER). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1697,7 +1639,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1705,7 +1647,7 @@ LATEX_FOOTER = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1714,7 +1656,7 @@ LATEX_EXTRA_FILES = # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. -PDF_HYPERLINKS = YES +PDF_HYPERLINKS = YES # If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate # the PDF file directly from the LaTeX files. Set this option to YES to get a @@ -1722,7 +1664,7 @@ PDF_HYPERLINKS = YES # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. -USE_PDFLATEX = YES +USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode # command to the generated LaTeX files. This will instruct LaTeX to keep running @@ -1731,14 +1673,14 @@ USE_PDFLATEX = YES # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_BATCHMODE = NO +LATEX_BATCHMODE = NO # If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the # index chapters (such as File Index, Compound Index, etc.) in the output. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HIDE_INDICES = NO +LATEX_HIDE_INDICES = NO # If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source # code with syntax highlighting in the LaTeX output. @@ -1748,7 +1690,7 @@ LATEX_HIDE_INDICES = NO # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_SOURCE_CODE = NO +LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See @@ -1756,7 +1698,7 @@ LATEX_SOURCE_CODE = NO # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_BIB_STYLE = plain +LATEX_BIB_STYLE = plain #--------------------------------------------------------------------------- # Configuration options related to the RTF output @@ -1767,7 +1709,7 @@ LATEX_BIB_STYLE = plain # readers/editors. # The default value is: NO. -GENERATE_RTF = NO +GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1775,7 +1717,7 @@ GENERATE_RTF = NO # The default directory is: rtf. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_OUTPUT = rtf +RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some @@ -1783,7 +1725,7 @@ RTF_OUTPUT = rtf # The default value is: NO. # This tag requires that the tag GENERATE_RTF is set to YES. -COMPACT_RTF = NO +COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will # contain hyperlink fields. The RTF file will contain links (just like the HTML @@ -1795,7 +1737,7 @@ COMPACT_RTF = NO # The default value is: NO. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_HYPERLINKS = NO +RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's config # file, i.e. a series of assignments. You only have to provide replacements, @@ -1805,14 +1747,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # Configuration options related to the man page output @@ -1822,7 +1764,7 @@ RTF_EXTENSIONS_FILE = # classes and files. # The default value is: NO. -GENERATE_MAN = YES +GENERATE_MAN = YES # The MAN_OUTPUT tag is used to specify where the man pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1831,7 +1773,7 @@ GENERATE_MAN = YES # The default directory is: man. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_OUTPUT = man +MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to the generated # man pages. In case the manual section does not start with a number, the number @@ -1840,7 +1782,7 @@ MAN_OUTPUT = man # The default value is: .3. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_EXTENSION = .3 +MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -1849,7 +1791,7 @@ MAN_EXTENSION = .3 # The default value is: NO. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_LINKS = NO +MAN_LINKS = NO #--------------------------------------------------------------------------- # Configuration options related to the XML output @@ -1859,7 +1801,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # The default value is: NO. -GENERATE_XML = YES +GENERATE_XML = YES # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1867,19 +1809,19 @@ GENERATE_XML = YES # The default directory is: xml. # This tag requires that the tag GENERATE_XML is set to YES. -XML_OUTPUT = xml +XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a # validating XML parser to check the syntax of the XML files. # This tag requires that the tag GENERATE_XML is set to YES. -XML_SCHEMA = +XML_SCHEMA = # The XML_DTD tag can be used to specify a XML DTD, which can be used by a # validating XML parser to check the syntax of the XML files. # This tag requires that the tag GENERATE_XML is set to YES. -XML_DTD = +XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to @@ -1888,7 +1830,7 @@ XML_DTD = # The default value is: YES. # This tag requires that the tag GENERATE_XML is set to YES. -XML_PROGRAMLISTING = YES +XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output @@ -1898,7 +1840,7 @@ XML_PROGRAMLISTING = YES # that can be used to generate PDF. # The default value is: NO. -GENERATE_DOCBOOK = NO +GENERATE_DOCBOOK = NO # The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be put in @@ -1906,7 +1848,7 @@ GENERATE_DOCBOOK = NO # The default directory is: docbook. # This tag requires that the tag GENERATE_DOCBOOK is set to YES. -DOCBOOK_OUTPUT = docbook +DOCBOOK_OUTPUT = docbook #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output @@ -1918,7 +1860,7 @@ DOCBOOK_OUTPUT = docbook # experimental and incomplete at the moment. # The default value is: NO. -GENERATE_AUTOGEN_DEF = NO +GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # Configuration options related to the Perl module output @@ -1930,7 +1872,7 @@ GENERATE_AUTOGEN_DEF = NO # Note that this feature is still experimental and incomplete at the moment. # The default value is: NO. -GENERATE_PERLMOD = NO +GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI @@ -1938,7 +1880,7 @@ GENERATE_PERLMOD = NO # The default value is: NO. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_LATEX = NO +PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to @@ -1948,7 +1890,7 @@ PERLMOD_LATEX = NO # The default value is: YES. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_PRETTY = YES +PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file are # prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful @@ -1966,7 +1908,7 @@ PERLMOD_MAKEVAR_PREFIX = # C-preprocessor directives found in the sources and include files. # The default value is: YES. -ENABLE_PREPROCESSING = YES +ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names # in the source code. If set to NO only conditional compilation will be @@ -1975,7 +1917,7 @@ ENABLE_PREPROCESSING = YES # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -MACRO_EXPANSION = NO +MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then # the macro expansion is limited to the macros specified with the PREDEFINED and @@ -1983,21 +1925,21 @@ MACRO_EXPANSION = NO # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_ONLY_PREDEF = NO +EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES the includes files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -SEARCH_INCLUDES = YES +SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2005,7 +1947,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2015,7 +1957,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2024,7 +1966,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all refrences to function-like macros that are alone on a line, have an @@ -2034,7 +1976,7 @@ EXPAND_AS_DEFINED = # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -SKIP_FUNCTION_MACROS = YES +SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration options related to external references @@ -2053,39 +1995,39 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external class will be listed in the # class index. If set to NO only the inherited external classes will be listed. # The default value is: NO. -ALLEXTERNALS = NO +ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in # the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. -EXTERNAL_GROUPS = YES +EXTERNAL_GROUPS = YES # If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. -EXTERNAL_PAGES = YES +EXTERNAL_PAGES = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of 'which perl'). # The default file (with absolute path) is: /usr/bin/perl. -PERL_PATH = /usr/bin/perl +PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool @@ -2098,7 +2040,7 @@ PERL_PATH = /usr/bin/perl # powerful graphs. # The default value is: YES. -CLASS_DIAGRAMS = YES +CLASS_DIAGRAMS = NO # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see: @@ -2107,20 +2049,20 @@ CLASS_DIAGRAMS = YES # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES, the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. -HIDE_UNDOC_RELATIONS = YES +HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: @@ -2129,7 +2071,7 @@ HIDE_UNDOC_RELATIONS = YES # set to NO # The default value is: NO. -HAVE_DOT = NO +HAVE_DOT = YES # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed # to run in parallel. When set to 0 doxygen will base this on the number of @@ -2139,7 +2081,7 @@ HAVE_DOT = NO # Minimum value: 0, maximum value: 32, default value: 0. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_NUM_THREADS = 0 +DOT_NUM_THREADS = 0 # When you want a differently looking font n the dot files that doxygen # generates you can specify the font name using DOT_FONTNAME. You need to make @@ -2149,21 +2091,21 @@ DOT_NUM_THREADS = 0 # The default value is: Helvetica. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = Helvetica +DOT_FONTNAME = Helvetica # The DOT_FONTSIZE tag can be used to set the size (in points) of the font of # dot graphs. # Minimum value: 4, maximum value: 24, default value: 10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the default font as specified with # DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2171,7 +2113,7 @@ DOT_FONTPATH = # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -CLASS_GRAPH = YES +CLASS_GRAPH = YES # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a # graph for each documented class showing the direct and indirect implementation @@ -2180,14 +2122,14 @@ CLASS_GRAPH = YES # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -COLLABORATION_GRAPH = YES +COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for # groups, showing the direct groups dependencies. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -GROUP_GRAPHS = YES +GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling @@ -2195,7 +2137,7 @@ GROUP_GRAPHS = YES # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -UML_LOOK = NO +UML_LOOK = NO # If the UML_LOOK tag is enabled, the fields and methods are shown inside the # class node. If there are many fields or methods and many nodes the graph may @@ -2208,7 +2150,7 @@ UML_LOOK = NO # Minimum value: 0, maximum value: 100, default value: 10. # This tag requires that the tag HAVE_DOT is set to YES. -UML_LIMIT_NUM_FIELDS = 10 +UML_LIMIT_NUM_FIELDS = 10 # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their @@ -2216,7 +2158,7 @@ UML_LIMIT_NUM_FIELDS = 10 # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -TEMPLATE_RELATIONS = NO +TEMPLATE_RELATIONS = NO # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to # YES then doxygen will generate a graph for each documented file showing the @@ -2225,7 +2167,7 @@ TEMPLATE_RELATIONS = NO # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -INCLUDE_GRAPH = YES +INCLUDE_GRAPH = YES # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing @@ -2234,7 +2176,7 @@ INCLUDE_GRAPH = YES # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -INCLUDED_BY_GRAPH = YES +INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH tag is set to YES then doxygen will generate a call # dependency graph for every global function or class method. @@ -2245,7 +2187,7 @@ INCLUDED_BY_GRAPH = YES # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -CALL_GRAPH = NO +CALL_GRAPH = YES # If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller # dependency graph for every global function or class method. @@ -2256,14 +2198,14 @@ CALL_GRAPH = NO # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -CALLER_GRAPH = NO +CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical # hierarchy of all classes instead of a textual one. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -GRAPHICAL_HIERARCHY = YES +GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the # dependencies a directory has on other directories in a graphical way. The @@ -2272,7 +2214,7 @@ GRAPHICAL_HIERARCHY = YES # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -DIRECTORY_GRAPH = YES +DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. @@ -2283,7 +2225,7 @@ DIRECTORY_GRAPH = YES # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_IMAGE_FORMAT = png +DOT_IMAGE_FORMAT = png # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to # enable generation of interactive SVG images that allow zooming and panning. @@ -2295,32 +2237,32 @@ DOT_IMAGE_FORMAT = png # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -INTERACTIVE_SVG = NO +INTERACTIVE_SVG = NO # The DOT_PATH tag can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes @@ -2332,7 +2274,7 @@ DIAFILE_DIRS = # Minimum value: 0, maximum value: 10000, default value: 50. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_GRAPH_MAX_NODES = 50 +DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs # generated by dot. A depth value of 3 means that only nodes reachable from the @@ -2344,7 +2286,7 @@ DOT_GRAPH_MAX_NODES = 50 # Minimum value: 0, maximum value: 1000, default value: 0. # This tag requires that the tag HAVE_DOT is set to YES. -MAX_DOT_GRAPH_DEPTH = 0 +MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not seem @@ -2356,7 +2298,7 @@ MAX_DOT_GRAPH_DEPTH = 0 # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_TRANSPARENT = NO +DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This @@ -2365,7 +2307,7 @@ DOT_TRANSPARENT = NO # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_MULTI_TARGETS = NO +DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated @@ -2373,11 +2315,11 @@ DOT_MULTI_TARGETS = NO # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -GENERATE_LEGEND = YES +GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_CLEANUP = YES +DOT_CLEANUP = YES From bf357212afc917eb2ed21c843889d049f500e93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 22:32:41 +0100 Subject: [PATCH 07/22] fix typo. --- packages/cuda/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cuda/Makefile.in b/packages/cuda/Makefile.in index 852468493..46dc05bf5 100644 --- a/packages/cuda/Makefile.in +++ b/packages/cuda/Makefile.in @@ -62,7 +62,7 @@ memory.o: $(srcdir)/memory.cu $(srcdir)/pred.h @DO_SECOND_LD@cuda.@SO@: $(OBJS) @DO_SECOND_LD@ @CUDA_SHLIB_LD@ $(CUDA_LDFLAGS) -o cuda.@SO@ $(OBJS) -install: all install-exampleS +install: all install-examples mkdir -p $(DESTDIR)$(SHAREDIR) for h in $(BDD_PROLOG); do $(INSTALL_DATA) $$h $(DESTDIR)$(SHAREDIR); done $(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR) From bda0c4694a4b40892d3bacbc665f8be139a4751d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 22:33:13 +0100 Subject: [PATCH 08/22] swig stuff. --- configure | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 939926edc..67dc6e831 100755 --- a/configure +++ b/configure @@ -15364,13 +15364,14 @@ if test "$PKG_SWIG" != ""; then mkdir -p packages/swig/python mkdir -p packages/swig/R mkdir -p packages/swig/java -mkdir -p packages/swig/android +mkdir -p packages/swig/src +mkdir -p packages/swig/jni -ac_config_files="$ac_config_files packages/swig/Makefile" +ac_config_files="$ac_config_files packages/swig/Makefile packages/swig/jni/Android.mk" fi @@ -16706,6 +16707,7 @@ do "library/matlab/Makefile") CONFIG_FILES="$CONFIG_FILES library/matlab/Makefile" ;; "packages/python/Makefile") CONFIG_FILES="$CONFIG_FILES packages/python/Makefile" ;; "packages/swig/Makefile") CONFIG_FILES="$CONFIG_FILES packages/swig/Makefile" ;; + "packages/swig/jni/Android.mk") CONFIG_FILES="$CONFIG_FILES packages/swig/jni/Android.mk" ;; "packages/cuda/Makefile") CONFIG_FILES="$CONFIG_FILES packages/cuda/Makefile" ;; "packages/gecode/Makefile") CONFIG_FILES="$CONFIG_FILES packages/gecode/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; From 3c99f0b055faf99be765fa57561d0070e7fd1a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 23:02:28 +0100 Subject: [PATCH 09/22] more progress --- packages/swig/Makefile.in | 6 +++--- packages/swig/configure.in | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/swig/Makefile.in b/packages/swig/Makefile.in index d2fa323e6..d272e7fe4 100644 --- a/packages/swig/Makefile.in +++ b/packages/swig/Makefile.in @@ -31,11 +31,11 @@ python/yap_wrap.o: python/yap_wrap.c java: java/libyap.@SO@ java/yap.java cd java ; $(JAVAC) *.java; $(JAR) cvf yap.jar *.class -java/libyap.@SO@: java/yap_wrap.o +java/libyap.@SO@: jni/yap_wrap.o $(CXX) -shared $(LDSOFLAGS) -L ../.. -lYap -o java/libyap.@SO@ ../../yapi.o java/yap_wrap.o $(LIBS) @JPLLDFLAGS@ -L ../.. -lYap -lpthread -java/yap_wrap.c: $(srcdir)/yap.i - $(SWIG) -c++ -java -outdir java -o $@ $(DEFS) $(CPPFLAGS) -Wall $< +jni/yap_wrap.c: $(srcdir)/yap.i + $(SWIG) -c++ -java -package pt.up.fc.dcc.yap -outdir src/pt/up/fc/dcc/yap -o $@ $(DEFS) $(CPPFLAGS) -Wall $< java/yap_wrap.o: java/yap_wrap.c $(CXX) -c $(CXXFLAGS) @JPLCFLAGS@ $< -o $@ diff --git a/packages/swig/configure.in b/packages/swig/configure.in index 079aa600f..05b844309 100644 --- a/packages/swig/configure.in +++ b/packages/swig/configure.in @@ -24,12 +24,13 @@ if test "$PKG_SWIG" != ""; then mkdir -p packages/swig/python mkdir -p packages/swig/R mkdir -p packages/swig/java -mkdir -p packages/swig/android +mkdir -p packages/swig/src +mkdir -p packages/swig/jni AC_SUBST(SWIG) AC_SUBST(SWIG_TARGET) AC_SUBST(PKG_SWIG) -AC_CONFIG_FILES([ packages/swig/Makefile ]) +AC_CONFIG_FILES([ packages/swig/Makefile packages/swig/jni/Android.mk ]) fi From 462bb216f7e91949847baa2a78925677dfe887cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 23:14:18 +0100 Subject: [PATCH 10/22] patch from Denis Duchier: compilation issues. --- packages/myddas/myddas_shared.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/myddas/myddas_shared.c b/packages/myddas/myddas_shared.c index 5d8232308..41bfa02e6 100644 --- a/packages/myddas/myddas_shared.c +++ b/packages/myddas/myddas_shared.c @@ -736,10 +736,14 @@ init_myddas(void) } #endif #if defined MYDDAS_MYSQL || defined MYDDAS_ODBC +#define stringify(X) _stringify(X) +#define _stringify(X) #X Yap_REGS.MYDDAS_GLOBAL_POINTER = NULL; Yap_PutValue(AtomMyddasVersionName, - MkAtomTerm(Yap_LookupAtom(MYDDAS_VERSION))); + MkAtomTerm(Yap_LookupAtom(stringify(MYDDAS_VERSION)))); Yap_HaltRegisterHook((HaltHookFunc)Yap_MYDDAS_delete_all_myddas_structs,NULL); +#undef stringify +#undef _stringify Yap_MYDDAS_delete_all_myddas_structs(); #endif } From 7393dd1405ed1049c3d9af8e655d4210c9eab2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 23:15:10 +0100 Subject: [PATCH 11/22] :dummy library, for now. --- library/listing.yap | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 library/listing.yap diff --git a/library/listing.yap b/library/listing.yap new file mode 100644 index 000000000..8e65e4e65 --- /dev/null +++ b/library/listing.yap @@ -0,0 +1,23 @@ +/************************************************************************* +* * +* YAP Prolog * +* * +* Yap Prolog was developed at NCCUP - Universidade do Porto * +* * +* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * +* * +************************************************************************** +* * +* File: listing.pl * +* Last rev: * +* mods: * +* comments: listing a prolog program * +* * +*************************************************************************/ + +% just reexport standard listing predicates. + +:- module( listing, [listing/0, + listing/1, + portray_clause/1, + portray_clause/2], []). From bbad94e5dd7781a76c1924a57d692b7f54e1952b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Sun, 4 May 2014 23:15:39 +0100 Subject: [PATCH 12/22] psckage compilation stuff. --- configure | 10 +++++----- packages/cplint/configure.in | 3 ++- packages/raptor | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 67dc6e831..251b7fbe5 100755 --- a/configure +++ b/configure @@ -651,7 +651,7 @@ LTLIBOBJS LIBOBJS RAPTOR_CPPFLAGS RAPTOR_LDFLAGS -ENABLE_RAPTOR +PKG_RAPTOR LTX_PL _ACJNI_JAVAC JAVADOC @@ -13426,9 +13426,9 @@ fi if test "$yap_cv_raptor" = no then - ENABLE_RAPTOR="@# " + PKG_RAPTOR="" else - ENABLE_RAPTOR="" + PKG_RAPTOR="packages/raptor" fi if test "$yap_cv_raptor" != no; then @@ -13536,7 +13536,7 @@ RAPTOR_LDFLAGS="$LIBS" if test "$raptor_available" = no then - ENABLE_RAPTOR="@# " + PKG_RAPTOR="" cat << EOF ################################################################## # ERROR: Could not find raptor library. Either I don't have the @@ -13544,7 +13544,7 @@ then ################################################################## EOF else - ENABLE_RAPTOR="" + PKG_RAPTOR="packages/raptor" fi diff --git a/packages/cplint/configure.in b/packages/cplint/configure.in index f9b9e10bb..e3b4f73ce 100644 --- a/packages/cplint/configure.in +++ b/packages/cplint/configure.in @@ -28,7 +28,6 @@ if test ! "$yap_cv_cplint" = "no" SHLIB_SUFFIX="so" fi PKG_CPLINT="packages/cplint packages/cplint/splipcase packages/cplint/approx/simplecuddLPADs" - AC_SUBST(PKG_CPLINT) AC_SUBST(CPLINT_LIBS) AC_SUBST(CPLINT_CFLAGS) AC_SUBST(CPLINT_LDFLAGS) @@ -38,6 +37,8 @@ else PKG_CPLINT="" fi +AC_SUBST(PKG_CPLINT) + mkdir -p packages/cplint mkdir -p packages/cplint/approx mkdir -p packages/cplint/approx/simplecuddLPADs diff --git a/packages/raptor b/packages/raptor index 0f77a1e1b..2436b3e2d 160000 --- a/packages/raptor +++ b/packages/raptor @@ -1 +1 @@ -Subproject commit 0f77a1e1b90b36bddb1844712380f4f3858123b7 +Subproject commit 2436b3e2d13d3ca20e8b3ad4db0825b413dc0ed2 From 426d9528947bee33407d1b761260e80d512aa7d2 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 5 May 2014 13:53:39 +0100 Subject: [PATCH 13/22] add listing.yap --- library/listing.yap | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 library/listing.yap diff --git a/library/listing.yap b/library/listing.yap new file mode 100644 index 000000000..e806ee5c1 --- /dev/null +++ b/library/listing.yap @@ -0,0 +1,20 @@ +/* + + emulates listing.pl, but just the interface for now. + +*/ + + +:- module(swi_listing, + [ listing/0, + listing/1, + portray_clause/1, % +Clause + portray_clause/2, % +Stream, +Clause + portray_clause/3 % +Stream, +Clause, +Options + ]). + + +:- meta_predicate portray_clause( +, + , : ). + +portray_clause(Stream, Term, M:Options) :- + portray_clause( Stream, Term ). From 549b4dd83493a5eea4dbf439fc4688fcb17e84a8 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 5 May 2014 14:01:21 +0100 Subject: [PATCH 14/22] add header --- library/listing.yap | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/library/listing.yap b/library/listing.yap index e806ee5c1..b11b18a31 100644 --- a/library/listing.yap +++ b/library/listing.yap @@ -1,3 +1,20 @@ +/************************************************************************* +* * +* YAP Prolog * +* * +* Yap Prolog was developed at NCCUP - Universidade do Porto * +* * +* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * +* * +************************************************************************** +* * +* File: listing.yap * +* Last rev: * +* mods: * +* comments: listing a prolog program * +* * +*************************************************************************/ + /* emulates listing.pl, but just the interface for now. From e9672e9820c81ab3be29759a413f13fbd8b7885f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 5 May 2014 14:12:52 +0100 Subject: [PATCH 15/22] android project --- packages/swig/jni/Android.mk.in | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 packages/swig/jni/Android.mk.in diff --git a/packages/swig/jni/Android.mk.in b/packages/swig/jni/Android.mk.in new file mode 100644 index 000000000..2bd189494 --- /dev/null +++ b/packages/swig/jni/Android.mk.in @@ -0,0 +1,9 @@ +# File: Android.mk +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := yap +LOCAL_SRC_FILES := yap_wrap.c + +include $(BUILD_SHARED_LIBRARY) From e981973d5611cee8a76991647a555effe454408c Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 5 May 2014 16:27:54 +0100 Subject: [PATCH 16/22] fix disappearing syntax error --- os/pl-read.c | 2055 +++++++++++++++++++++++++------------------------- 1 file changed, 1028 insertions(+), 1027 deletions(-) diff --git a/os/pl-read.c b/os/pl-read.c index 37a894066..46144b898 100644 --- a/os/pl-read.c +++ b/os/pl-read.c @@ -19,19 +19,19 @@ isStringStream(IOSTREAM *s) void init_read_data(ReadData _PL_rd, IOSTREAM *in ARG_LD) { CACHE_REGS - memset(_PL_rd, 0, sizeof(*_PL_rd)); /* optimise! */ - - _PL_rd->magic = RD_MAGIC; - _PL_rd->varnames = 0; - _PL_rd->module = Yap_GetModuleEntry(CurrentModule); - _PL_rd->exception = PL_new_term_ref(); - rb.stream = in; - _PL_rd->has_exception = 0; - _PL_rd->module = MODULE_parse; - _PL_rd->flags = _PL_rd->module->flags; /* change for options! */ - _PL_rd->styleCheck = debugstatus.styleCheck; - _PL_rd->on_error = ATOM_error; - _PL_rd->backquoted_string = truePrologFlag(PLFLAG_BACKQUOTED_STRING); + memset(_PL_rd, 0, sizeof(*_PL_rd)); /* optimise! */ + +_PL_rd->magic = RD_MAGIC; +_PL_rd->varnames = 0; +_PL_rd->module = Yap_GetModuleEntry(CurrentModule); +_PL_rd->exception = PL_new_term_ref(); +rb.stream = in; +_PL_rd->has_exception = 0; +_PL_rd->module = MODULE_parse; +_PL_rd->flags = _PL_rd->module->flags; /* change for options! */ +_PL_rd->styleCheck = debugstatus.styleCheck; +_PL_rd->on_error = ATOM_error; +_PL_rd->backquoted_string = truePrologFlag(PLFLAG_BACKQUOTED_STRING); } void @@ -42,7 +42,7 @@ free_read_data(ReadData _PL_rd) static int read_term(term_t t, ReadData _PL_rd ARG_LD) { - return Yap_read_term(t, rb.stream, _PL_rd); + return Yap_read_term(t, rb.stream, _PL_rd); } @@ -51,30 +51,30 @@ static void addUTF8Buffer(Buffer b, int c); static void addUTF8Buffer(Buffer b, int c) { if ( c >= 0x80 ) - { char buf[6]; - char *p, *end; +{ char buf[6]; +char *p, *end; - end = utf8_put_char(buf, c); - for(p=buf; p= UC, U_ID_CONTINUE) #define PlSymbolW(c) CharTypeW(c, == SY, U_SYMBOL) #define PlPunctW(c) CharTypeW(c, == PU, 0) @@ -114,15 +114,15 @@ unicode_separator(pl_wchar_t c) static int reportReadError(ReadData rd) { if ( rd->on_error == ATOM_error ) - return PL_raise_exception(rd->exception); - if ( rd->on_error != ATOM_quiet ) - printMessage(ATOM_error, PL_TERM, rd->exception); - PL_clear_exception(); + return PL_raise_exception(rd->exception); +if ( rd->on_error != ATOM_quiet ) + printMessage(ATOM_error, PL_TERM, rd->exception); +PL_clear_exception(); - if ( rd->on_error == ATOM_dec10 ) - return TRUE; +if ( rd->on_error == ATOM_dec10 ) + return TRUE; - return FALSE; +return FALSE; } @@ -141,9 +141,9 @@ reportReadError(ReadData rd) /* } */ - /******************************** - * RAW READING * - *********************************/ +/******************************** + * RAW READING * + *********************************/ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -160,86 +160,86 @@ claimed automatically en enlarged if necessary. static term_t makeErrorTerm(const char *id_str, term_t id_term, ReadData _PL_rd) { GET_LD - term_t ex, loc=0; /* keep compiler happy */ - unsigned char const *s, *ll = NULL; - int rc = TRUE; + term_t ex, loc=0; /* keep compiler happy */ +unsigned char const *s, *ll = NULL; +int rc = TRUE; - if ( !(ex = PL_new_term_ref()) || - !(loc = PL_new_term_ref()) ) - rc = FALSE; - - if ( rc && !id_term ) - { if ( !(id_term=PL_new_term_ref()) || - !PL_put_atom_chars(id_term, id_str) ) - rc = FALSE; - } - - if ( rc ) - rc = PL_unify_term(ex, - PL_FUNCTOR, FUNCTOR_error2, - PL_FUNCTOR, FUNCTOR_syntax_error1, - PL_TERM, id_term, - PL_TERM, loc); - - source_char_no += last_token_start - rdbase; - for(s=rdbase; s 0 ) lp--; - break; - case '\t': - lp |= 7; - default: - lp++; - } - } - - source_line_pos = lp; - } - - if ( rc ) - { if ( ReadingSource ) /* reading a file */ - { rc = PL_unify_term(loc, - PL_FUNCTOR, FUNCTOR_file4, - PL_ATOM, source_file_name, - PL_INT, source_line_no, - PL_INT, source_line_pos, - PL_INT64, source_char_no); - } else if ( isStringStream(rb.stream) ) - { size_t pos; - - pos = utf8_strlen((char *)rdbase, last_token_start-rdbase); - - rc = PL_unify_term(loc, - PL_FUNCTOR, FUNCTOR_string2, - PL_UTF8_STRING, rdbase, - PL_INT, (int)pos); - } else /* any stream */ - { term_t stream; - - if ( !(stream=PL_new_term_ref()) || - !PL_unify_stream_or_alias(stream, rb.stream) || - !PL_unify_term(loc, - PL_FUNCTOR, FUNCTOR_stream4, - PL_TERM, stream, - PL_INT, source_line_no, - PL_INT, source_line_pos, - PL_INT64, source_char_no) ) +if ( !(ex = PL_new_term_ref()) || + !(loc = PL_new_term_ref()) ) rc = FALSE; - } - } - return (rc ? ex : (term_t)0); +if ( rc && !id_term ) +{ if ( !(id_term=PL_new_term_ref()) || + !PL_put_atom_chars(id_term, id_str) ) + rc = FALSE; +} + +if ( rc ) + rc = PL_unify_term(ex, + PL_FUNCTOR, FUNCTOR_error2, + PL_FUNCTOR, FUNCTOR_syntax_error1, + PL_TERM, id_term, + PL_TERM, loc); + +source_char_no += last_token_start - rdbase; +for(s=rdbase; s 0 ) lp--; + break; +case '\t': + lp |= 7; +default: + lp++; +} +} + +source_line_pos = lp; +} + +if ( rc ) +{ if ( ReadingSource ) /* reading a file */ +{ rc = PL_unify_term(loc, + PL_FUNCTOR, FUNCTOR_file4, + PL_ATOM, source_file_name, + PL_INT, source_line_no, + PL_INT, source_line_pos, + PL_INT64, source_char_no); +} else if ( isStringStream(rb.stream) ) +{ size_t pos; + +pos = utf8_strlen((char *)rdbase, last_token_start-rdbase); + +rc = PL_unify_term(loc, + PL_FUNCTOR, FUNCTOR_string2, + PL_UTF8_STRING, rdbase, + PL_INT, (int)pos); +} else /* any stream */ +{ term_t stream; + +if ( !(stream=PL_new_term_ref()) || + !PL_unify_stream_or_alias(stream, rb.stream) || + !PL_unify_term(loc, + PL_FUNCTOR, FUNCTOR_stream4, + PL_TERM, stream, + PL_INT, source_line_no, + PL_INT, source_line_pos, + PL_INT64, source_char_no) ) + rc = FALSE; +} +} + +return (rc ? ex : (term_t)0); } @@ -247,24 +247,24 @@ makeErrorTerm(const char *id_str, term_t id_term, ReadData _PL_rd) static bool errorWarning(const char *id_str, term_t id_term, ReadData _PL_rd) { GET_LD - term_t ex; + term_t ex; - LD->exception.processing = TRUE; /* allow using spare stack */ +LD->exception.processing = TRUE; /* allow using spare stack */ - ex = makeErrorTerm(id_str, id_term, _PL_rd); +ex = makeErrorTerm(id_str, id_term, _PL_rd); - if ( _PL_rd ) - { _PL_rd->has_exception = TRUE; - if ( ex ) - PL_put_term(_PL_rd->exception, ex); - else - PL_put_term(_PL_rd->exception, exception_term); - } else - { if ( ex ) - PL_raise_exception(ex); - } +if ( _PL_rd ) +{ _PL_rd->has_exception = TRUE; +if ( ex ) + PL_put_term(_PL_rd->exception, ex); +else + PL_put_term(_PL_rd->exception, exception_term); +} else +{ if ( ex ) + PL_raise_exception(ex); +} - fail; +fail; } @@ -272,33 +272,33 @@ errorWarning(const char *id_str, term_t id_term, ReadData _PL_rd) static void clearBuffer(ReadData _PL_rd) { if (rb.size == 0) - { rb.base = rb.fast; - rb.size = sizeof(rb.fast); - } - rb.end = rb.base + rb.size; - rdbase = rb.here = rb.base; +{ rb.base = rb.fast; +rb.size = sizeof(rb.fast); +} +rb.end = rb.base + rb.size; +rdbase = rb.here = rb.base; - _PL_rd->posp = rdbase; - _PL_rd->posi = 0; +_PL_rd->posp = rdbase; +_PL_rd->posi = 0; } static void growToBuffer(int c, ReadData _PL_rd) { if ( rb.base == rb.fast ) /* intptr_t clause: jump to use malloc() */ - { rb.base = PL_malloc(FASTBUFFERSIZE * 2); - memcpy(rb.base, rb.fast, FASTBUFFERSIZE); - } else - rb.base = PL_realloc(rb.base, rb.size*2); +{ rb.base = PL_malloc(FASTBUFFERSIZE * 2); +memcpy(rb.base, rb.fast, FASTBUFFERSIZE); +} else + rb.base = PL_realloc(rb.base, rb.size*2); - DEBUG(8, Sdprintf("Reallocated read buffer at %ld\n", (intptr_t) rb.base)); - _PL_rd->posp = rdbase = rb.base; - rb.here = rb.base + rb.size; - rb.size *= 2; - rb.end = rb.base + rb.size; - _PL_rd->posi = 0; +DEBUG(8, Sdprintf("Reallocated read buffer at %ld\n", (intptr_t) rb.base)); +_PL_rd->posp = rdbase = rb.base; +rb.here = rb.base + rb.size; +rb.size *= 2; +rb.end = rb.base + rb.size; +_PL_rd->posi = 0; - *rb.here++ = c; +*rb.here++ = c; } @@ -306,25 +306,25 @@ static inline void addByteToBuffer(int c, ReadData _PL_rd) { c &= 0xff; - if ( rb.here >= rb.end ) - growToBuffer(c, _PL_rd); - else - *rb.here++ = c; +if ( rb.here >= rb.end ) + growToBuffer(c, _PL_rd); +else + *rb.here++ = c; } static void addToBuffer(int c, ReadData _PL_rd) { if ( c <= 0x7f ) - { addByteToBuffer(c, _PL_rd); - } else - { char buf[10]; - char *s, *e; +{ addByteToBuffer(c, _PL_rd); +} else +{ char buf[10]; +char *s, *e; - e = utf8_put_char(buf, c); - for(s=buf; schar_conversion_table || c < 0 || c >= 256 ) - return c; +if ( !_PL_rd->char_conversion_table || c < 0 || c >= 256 ) + return c; - return _PL_rd->char_conversion_table[c]; +return _PL_rd->char_conversion_table[c]; } @@ -354,14 +354,14 @@ getchr__(ReadData _PL_rd) #define getchrq() Sgetcode(rb.stream) #define ensure_space(c) { if ( something_read && \ - (c == '\n' || !isBlank(rb.here[-1])) ) \ - addToBuffer(c, _PL_rd); \ - } + (c == '\n' || !isBlank(rb.here[-1])) ) \ + addToBuffer(c, _PL_rd); \ +} #define set_start_line { if ( !something_read ) \ - { setCurrentSourceLocation(_PL_rd PASS_LD); \ - something_read++; \ - } \ - } + { setCurrentSourceLocation(_PL_rd PASS_LD); \ + something_read++; \ + } \ +} @@ -375,67 +375,67 @@ Opens a quasi-quoted memory range. @arg QQRange is a term '$quasi_quotation'(ReadData, Start, Length) @arg Stream is a UTF-8 encoded string, whose position indication reflects the location in the real file. -*/ + */ static PRED_IMPL("$qq_open", 2, qq_open, 0) { PRED_LD - if ( PL_is_functor(A1, FUNCTOR_dquasi_quotation3) ) - { void *ptr; - char * start; - size_t len; - term_t arg = PL_new_term_ref(); - IOSTREAM *s; + if ( PL_is_functor(A1, FUNCTOR_dquasi_quotation3) ) + { void *ptr; + char * start; + size_t len; + term_t arg = PL_new_term_ref(); + IOSTREAM *s; - if ( PL_get_arg(1, A1, arg) && PL_get_pointer_ex(arg, &ptr) && - PL_get_arg(2, A1, arg) && PL_get_intptr(arg, (intptr_t *)&start) && - PL_get_arg(3, A1, arg) && PL_get_intptr(arg, (intptr_t *)&len) ) - { //source_location pos; - if ( (s=Sopenmem(&start, &len, "r")) ) - s->encoding = ENC_UTF8; + if ( PL_get_arg(1, A1, arg) && PL_get_pointer_ex(arg, &ptr) && + PL_get_arg(2, A1, arg) && PL_get_intptr(arg, (intptr_t *)&start) && + PL_get_arg(3, A1, arg) && PL_get_intptr(arg, (intptr_t *)&len) ) + { //source_location pos; + if ( (s=Sopenmem(&start, &len, "r")) ) + s->encoding = ENC_UTF8; - return PL_unify_stream(A2, s); + return PL_unify_stream(A2, s); } - } else - PL_type_error("read_context", A1); + } else + PL_type_error("read_context", A1); - return FALSE; +return FALSE; } static int parse_quasi_quotations(ReadData _PL_rd ARG_LD) { if ( _PL_rd->qq_tail ) - { term_t av; - int rc; +{ term_t av; +int rc; - if ( !PL_unify_nil(_PL_rd->qq_tail) ) - return FALSE; +if ( !PL_unify_nil(_PL_rd->qq_tail) ) + return FALSE; - if ( !_PL_rd->quasi_quotations ) - { if ( (av = PL_new_term_refs(2)) && - PL_put_term(av+0, _PL_rd->qq) && +if ( !_PL_rd->quasi_quotations ) +{ if ( (av = PL_new_term_refs(2)) && + PL_put_term(av+0, _PL_rd->qq) && #if __YAP_PROLOG__ - PL_put_atom(av+1, YAP_SWIAtomFromAtom(_PL_rd->module->AtomOfME)) && + PL_put_atom(av+1, YAP_SWIAtomFromAtom(_PL_rd->module->AtomOfME)) && #else - PL_put_atom(av+1, _PL_rd->module->name) && + PL_put_atom(av+1, _PL_rd->module->name) && #endif - PL_cons_functor_v(av, FUNCTOR_dparse_quasi_quotations2, av) ) - { term_t ex; - rc = callProlog(MODULE_system, av+0, PL_Q_CATCH_EXCEPTION, &ex); - if ( rc ) - return TRUE; - _PL_rd->exception = ex; - _PL_rd->has_exception = TRUE; - } - return FALSE; - } else - return TRUE; - } else if ( _PL_rd->quasi_quotations ) /* user option, but no quotes */ - { return PL_unify_nil(_PL_rd->quasi_quotations); - } else - return TRUE; + PL_cons_functor_v(av, FUNCTOR_dparse_quasi_quotations2, av) ) +{ term_t ex; +rc = callProlog(MODULE_system, av+0, PL_Q_CATCH_EXCEPTION, &ex); +if ( rc ) + return TRUE; +_PL_rd->exception = ex; +_PL_rd->has_exception = TRUE; +} +return FALSE; +} else + return TRUE; +} else if ( _PL_rd->quasi_quotations ) /* user option, but no quotes */ +{ return PL_unify_nil(_PL_rd->quasi_quotations); +} else + return TRUE; } @@ -445,79 +445,79 @@ parse_quasi_quotations(ReadData _PL_rd ARG_LD) #define rawSyntaxError(what) { addToBuffer(EOS, _PL_rd); \ - rdbase = rb.base, last_token_start = rb.here-1; \ - syntaxError(what, _PL_rd); \ - } + rdbase = rb.base, last_token_start = rb.here-1; \ + syntaxError(what, _PL_rd); \ +} static int raw_read_quoted(int q, ReadData _PL_rd) { int newlines = 0; - int c; +int c; - addToBuffer(q, _PL_rd); - while((c=getchrq()) != EOF && c != q) - { if ( c == '\\' && DO_CHARESCAPE ) - { int base; - addToBuffer(c, _PL_rd); +addToBuffer(q, _PL_rd); +while((c=getchrq()) != EOF && c != q) +{ if ( c == '\\' && DO_CHARESCAPE ) +{ int base; +addToBuffer(c, _PL_rd); - switch( (c=getchrq()) ) - { case EOF: - goto eofinstr; - case 'u': /* \uXXXX */ - case 'U': /* \UXXXXXXXX */ - addToBuffer(c, _PL_rd); - continue; - case 'x': /* \xNN\ */ - addToBuffer(c, _PL_rd); - c = getchrq(); - if ( c == EOF ) - goto eofinstr; - if ( digitValue(16, c) >= 0 ) - { base = 16; - addToBuffer(c, _PL_rd); +switch( (c=getchrq()) ) +{ case EOF: + goto eofinstr; +case 'u': /* \uXXXX */ +case 'U': /* \UXXXXXXXX */ + addToBuffer(c, _PL_rd); + continue; +case 'x': /* \xNN\ */ + addToBuffer(c, _PL_rd); + c = getchrq(); + if ( c == EOF ) + goto eofinstr; + if ( digitValue(16, c) >= 0 ) + { base = 16; + addToBuffer(c, _PL_rd); - xdigits: - c = getchrq(); - while( digitValue(base, c) >= 0 ) - { addToBuffer(c, _PL_rd); - c = getchrq(); - } - } - if ( c == EOF ) - goto eofinstr; - addToBuffer(c, _PL_rd); - if ( c == q ) - return TRUE; - continue; - default: - addToBuffer(c, _PL_rd); - if ( digitValue(8, c) >= 0 ) /* \NNN\ */ - { base = 8; - goto xdigits; - } else if ( c == '\n' ) /* \ */ - { c = getchrq(); - if ( c == EOF ) - goto eofinstr; - addToBuffer(c, _PL_rd); - if ( c == q ) - return TRUE; - } - continue; /* \symbolic-control-char */ - } - } else if (c == '\n' && - newlines++ > MAXNEWLINES && - (_PL_rd->styleCheck & LONGATOM_CHECK)) - { rawSyntaxError("long_string"); - } - addToBuffer(c, _PL_rd); - } - if (c == EOF) - { eofinstr: - rawSyntaxError("end_of_file_in_string"); - } - addToBuffer(c, _PL_rd); + xdigits: + c = getchrq(); + while( digitValue(base, c) >= 0 ) + { addToBuffer(c, _PL_rd); + c = getchrq(); + } + } + if ( c == EOF ) + goto eofinstr; + addToBuffer(c, _PL_rd); + if ( c == q ) + return TRUE; + continue; +default: + addToBuffer(c, _PL_rd); + if ( digitValue(8, c) >= 0 ) /* \NNN\ */ + { base = 8; + goto xdigits; + } else if ( c == '\n' ) /* \ */ + { c = getchrq(); + if ( c == EOF ) + goto eofinstr; + addToBuffer(c, _PL_rd); + if ( c == q ) + return TRUE; + } + continue; /* \symbolic-control-char */ +} +} else if (c == '\n' && + newlines++ > MAXNEWLINES && + (_PL_rd->styleCheck & LONGATOM_CHECK)) +{ rawSyntaxError("long_string"); +} +addToBuffer(c, _PL_rd); +} +if (c == EOF) +{ eofinstr: + rawSyntaxError("end_of_file_in_string"); +} +addToBuffer(c, _PL_rd); - return TRUE; +return TRUE; } @@ -525,395 +525,395 @@ static int add_comment(Buffer b, IOPOS *pos, ReadData _PL_rd ARG_LD) { term_t head = PL_new_term_ref(); - assert(_PL_rd->comments); - if ( !PL_unify_list(_PL_rd->comments, head, _PL_rd->comments) ) - return FALSE; - if ( pos ) - { if ( !PL_unify_term(head, - PL_FUNCTOR, FUNCTOR_minus2, - PL_FUNCTOR, FUNCTOR_stream_position4, - PL_INT64, pos->charno, - PL_INT, pos->lineno, - PL_INT, pos->linepos, - PL_INT, 0, - PL_UTF8_STRING, baseBuffer(b, char)) ) - return FALSE; - } else - { if ( !PL_unify_term(head, - PL_FUNCTOR, FUNCTOR_minus2, - ATOM_minus, - PL_UTF8_STRING, baseBuffer(b, char)) ) - return FALSE; - } +assert(_PL_rd->comments); +if ( !PL_unify_list(_PL_rd->comments, head, _PL_rd->comments) ) + return FALSE; +if ( pos ) +{ if ( !PL_unify_term(head, + PL_FUNCTOR, FUNCTOR_minus2, + PL_FUNCTOR, FUNCTOR_stream_position4, + PL_INT64, pos->charno, + PL_INT, pos->lineno, + PL_INT, pos->linepos, + PL_INT, 0, + PL_UTF8_STRING, baseBuffer(b, char)) ) + return FALSE; +} else +{ if ( !PL_unify_term(head, + PL_FUNCTOR, FUNCTOR_minus2, + ATOM_minus, + PL_UTF8_STRING, baseBuffer(b, char)) ) + return FALSE; +} - PL_reset_term_refs(head); - return TRUE; +PL_reset_term_refs(head); +return TRUE; } static void setErrorLocation(IOPOS *pos, ReadData _PL_rd) { if ( pos ) - { GET_LD +{ GET_LD - source_char_no = pos->charno; - source_line_pos = pos->linepos; - source_line_no = pos->lineno; - } - rb.here = rb.base+1; /* see rawSyntaxError() */ + source_char_no = pos->charno; +source_line_pos = pos->linepos; +source_line_no = pos->lineno; +} +rb.here = rb.base+1; /* see rawSyntaxError() */ } static unsigned char * raw_read2(ReadData _PL_rd ARG_LD) { int c; - bool something_read = FALSE; - bool dotseen = FALSE; - IOPOS pbuf; /* comment start */ - IOPOS *pos; +bool something_read = FALSE; +bool dotseen = FALSE; +IOPOS pbuf; /* comment start */ +IOPOS *pos; - clearBuffer(_PL_rd); /* clear input buffer */ - _PL_rd->strictness = truePrologFlag(PLFLAG_ISO); - source_line_no = -1; +clearBuffer(_PL_rd); /* clear input buffer */ +_PL_rd->strictness = truePrologFlag(PLFLAG_ISO); +source_line_no = -1; - for(;;) - { c = getchr(); +for(;;) +{ c = getchr(); - handle_c: - switch(c) - { case EOF: - if ( isStringStream(rb.stream) ) /* do not require '. ' when */ - { addToBuffer(' ', _PL_rd); /* reading from a string */ - addToBuffer('.', _PL_rd); - addToBuffer(' ', _PL_rd); - addToBuffer(EOS, _PL_rd); - return rb.base; - } - if (something_read) - { if ( dotseen ) /* term. */ - { if ( rb.here - rb.base == 1 ) - rawSyntaxError("end_of_clause"); - ensure_space(' '); - addToBuffer(EOS, _PL_rd); - return rb.base; - } - rawSyntaxError("end_of_file"); - } - if ( Sfpasteof(rb.stream) ) - { term_t stream; +handle_c: +switch(c) +{ case EOF: + if ( isStringStream(rb.stream) ) /* do not require '. ' when */ + { addToBuffer(' ', _PL_rd); /* reading from a string */ + addToBuffer('.', _PL_rd); + addToBuffer(' ', _PL_rd); + addToBuffer(EOS, _PL_rd); + return rb.base; + } + if (something_read) + { if ( dotseen ) /* term. */ + { if ( rb.here - rb.base == 1 ) + rawSyntaxError("end_of_clause"); + ensure_space(' '); + addToBuffer(EOS, _PL_rd); + return rb.base; + } + rawSyntaxError("end_of_file"); + } + if ( Sfpasteof(rb.stream) ) + { term_t stream; - LD->exception.processing = TRUE; - stream = PL_new_term_ref(); - PL_unify_stream_or_alias(stream, rb.stream); - PL_error(NULL, 0, NULL, ERR_PERMISSION, - ATOM_input, ATOM_past_end_of_stream, stream); - return NULL; - } - set_start_line; - strcpy((char *)rb.base, "end_of_file. "); - rb.here = rb.base + 14; - return rb.base; - case '/': if ( rb.stream->position ) - { pbuf = *rb.stream->position; - pbuf.charno--; - pbuf.linepos--; - pos = &pbuf; - } else - pos = NULL; + LD->exception.processing = TRUE; + stream = PL_new_term_ref(); + PL_unify_stream_or_alias(stream, rb.stream); + PL_error(NULL, 0, NULL, ERR_PERMISSION, + ATOM_input, ATOM_past_end_of_stream, stream); + return NULL; + } + set_start_line; + strcpy((char *)rb.base, "end_of_file. "); + rb.here = rb.base + 14; + return rb.base; +case '/': if ( rb.stream->position ) +{ pbuf = *rb.stream->position; +pbuf.charno--; +pbuf.linepos--; +pos = &pbuf; +} else + pos = NULL; - c = getchr(); - if ( c == '*' ) - { int last; - int level = 1; - union { - tmp_buffer ctmpbuf; - buffer tmpbuf; - } u; - Buffer cbuf; +c = getchr(); +if ( c == '*' ) +{ int last; +int level = 1; +union { + tmp_buffer ctmpbuf; + buffer tmpbuf; +} u; +Buffer cbuf; - if ( _PL_rd->comments ) - { initBuffer(&u.ctmpbuf); - cbuf = &u.tmpbuf; - addUTF8Buffer(cbuf, '/'); - addUTF8Buffer(cbuf, '*'); - } else - { cbuf = NULL; - } +if ( _PL_rd->comments ) +{ initBuffer(&u.ctmpbuf); +cbuf = &u.tmpbuf; +addUTF8Buffer(cbuf, '/'); +addUTF8Buffer(cbuf, '*'); +} else +{ cbuf = NULL; +} - if ((last = getchr()) == EOF) - { if ( cbuf ) - discardBuffer(cbuf); - setErrorLocation(pos, _PL_rd); - rawSyntaxError("end_of_file_in_block_comment"); - } - if ( cbuf ) - addUTF8Buffer(cbuf, last); +if ((last = getchr()) == EOF) +{ if ( cbuf ) + discardBuffer(cbuf); +setErrorLocation(pos, _PL_rd); +rawSyntaxError("end_of_file_in_block_comment"); +} +if ( cbuf ) + addUTF8Buffer(cbuf, last); - if ( something_read ) - { addToBuffer(' ', _PL_rd); /* positions */ - addToBuffer(' ', _PL_rd); - addToBuffer(last == '\n' ? last : ' ', _PL_rd); - } +if ( something_read ) +{ addToBuffer(' ', _PL_rd); /* positions */ +addToBuffer(' ', _PL_rd); +addToBuffer(last == '\n' ? last : ' ', _PL_rd); +} - for(;;) - { c = getchr(); +for(;;) +{ c = getchr(); - if ( cbuf ) - addUTF8Buffer(cbuf, c); +if ( cbuf ) + addUTF8Buffer(cbuf, c); - switch( c ) - { case EOF: - if ( cbuf ) - discardBuffer(cbuf); - setErrorLocation(pos, _PL_rd); - rawSyntaxError("end_of_file_in_block_comment"); +switch( c ) +{ case EOF: + if ( cbuf ) + discardBuffer(cbuf); + setErrorLocation(pos, _PL_rd); + rawSyntaxError("end_of_file_in_block_comment"); #ifndef __YAP_PROLOG__ - /* YAP does not support comment levels in original scanner */ - case '*': - if ( last == '/' ) - level++; - break; + /* YAP does not support comment levels in original scanner */ +case '*': + if ( last == '/' ) + level++; + break; #endif - case '/': - if ( last == '*' && - (--level == 0 || _PL_rd->strictness) ) - { if ( cbuf ) - { addUTF8Buffer(cbuf, EOS); - if ( !add_comment(cbuf, pos, _PL_rd PASS_LD) ) - { discardBuffer(cbuf); - return FALSE; - } - discardBuffer(cbuf); - } - c = ' '; - goto handle_c; - } - break; - } - if ( something_read ) - addToBuffer(c == '\n' ? c : ' ', _PL_rd); - last = c; - } - } else - { set_start_line; - addToBuffer('/', _PL_rd); - if ( isSymbolW(c) ) - { while( c != EOF && isSymbolW(c) && - !(c == '`' && _PL_rd->backquoted_string) ) - { addToBuffer(c, _PL_rd); - c = getchr(); - } - } - dotseen = FALSE; - goto handle_c; - } - case '%': if ( something_read ) - addToBuffer(' ', _PL_rd); - if ( _PL_rd->comments ) - { union { - tmp_buffer ctmpbuf; - buffer uctmpbuf; - } u; - Buffer cbuf; +case '/': + if ( last == '*' && + (--level == 0 || _PL_rd->strictness) ) + { if ( cbuf ) + { addUTF8Buffer(cbuf, EOS); + if ( !add_comment(cbuf, pos, _PL_rd PASS_LD) ) + { discardBuffer(cbuf); + return FALSE; + } + discardBuffer(cbuf); + } + c = ' '; + goto handle_c; + } + break; +} +if ( something_read ) + addToBuffer(c == '\n' ? c : ' ', _PL_rd); +last = c; +} +} else +{ set_start_line; +addToBuffer('/', _PL_rd); +if ( isSymbolW(c) ) +{ while( c != EOF && isSymbolW(c) && + !(c == '`' && _PL_rd->backquoted_string) ) +{ addToBuffer(c, _PL_rd); +c = getchr(); +} +} +dotseen = FALSE; +goto handle_c; +} +case '%': if ( something_read ) + addToBuffer(' ', _PL_rd); +if ( _PL_rd->comments ) +{ union { + tmp_buffer ctmpbuf; + buffer uctmpbuf; +} u; +Buffer cbuf; - if ( rb.stream->position ) - { pbuf = *rb.stream->position; - pbuf.charno--; - pbuf.linepos--; - pos = &pbuf; - } else - pos = NULL; +if ( rb.stream->position ) +{ pbuf = *rb.stream->position; +pbuf.charno--; +pbuf.linepos--; +pos = &pbuf; +} else + pos = NULL; - initBuffer(&u.ctmpbuf); - cbuf = (Buffer)&u.uctmpbuf; - addUTF8Buffer(cbuf, '%'); +initBuffer(&u.ctmpbuf); +cbuf = (Buffer)&u.uctmpbuf; +addUTF8Buffer(cbuf, '%'); - for(;;) - { while((c=getchr()) != EOF && c != '\n') - { addUTF8Buffer(cbuf, c); - if ( something_read ) /* record positions */ - addToBuffer(' ', _PL_rd); - } - if ( c == '\n' ) - { int c2 = Speekcode(rb.stream); +for(;;) +{ while((c=getchr()) != EOF && c != '\n') +{ addUTF8Buffer(cbuf, c); +if ( something_read ) /* record positions */ + addToBuffer(' ', _PL_rd); +} +if ( c == '\n' ) +{ int c2 = Speekcode(rb.stream); - if ( c2 == '%' ) - { if ( something_read ) - { addToBuffer(c, _PL_rd); - addToBuffer(' ', _PL_rd); - } - addUTF8Buffer(cbuf, c); - c = Sgetcode(rb.stream); - assert(c==c2); - addUTF8Buffer(cbuf, c); - continue; - } - } - break; - } - addUTF8Buffer(cbuf, EOS); - if ( !add_comment(cbuf, pos, _PL_rd PASS_LD) ) - { discardBuffer(cbuf); - return FALSE; - } - discardBuffer(cbuf); - } else - { while((c=getchr()) != EOF && c != '\n') - { if ( something_read ) /* record positions */ - addToBuffer(' ', _PL_rd); - } - } - goto handle_c; /* is the newline */ - case '\'': if ( rb.here > rb.base && isDigit(rb.here[-1]) ) - { cucharp bs = &rb.here[-1]; +if ( c2 == '%' ) +{ if ( something_read ) +{ addToBuffer(c, _PL_rd); +addToBuffer(' ', _PL_rd); +} +addUTF8Buffer(cbuf, c); +c = Sgetcode(rb.stream); +assert(c==c2); +addUTF8Buffer(cbuf, c); +continue; +} +} +break; +} +addUTF8Buffer(cbuf, EOS); +if ( !add_comment(cbuf, pos, _PL_rd PASS_LD) ) +{ discardBuffer(cbuf); +return FALSE; +} +discardBuffer(cbuf); +} else +{ while((c=getchr()) != EOF && c != '\n') +{ if ( something_read ) /* record positions */ + addToBuffer(' ', _PL_rd); +} +} +goto handle_c; /* is the newline */ +case '\'': if ( rb.here > rb.base && isDigit(rb.here[-1]) ) +{ cucharp bs = &rb.here[-1]; - if ( bs > rb.base && isDigit(bs[-1]) ) - bs--; - if ( bs > rb.base && isSign(bs[-1]) ) - bs--; +if ( bs > rb.base && isDigit(bs[-1]) ) + bs--; +if ( bs > rb.base && isSign(bs[-1]) ) + bs--; - if ( bs == rb.base || !PlIdContW(bs[-1]) ) - { int base; +if ( bs == rb.base || !PlIdContW(bs[-1]) ) +{ int base; - if ( isSign(bs[0]) ) - bs++; - base = atoi((char*)bs); +if ( isSign(bs[0]) ) + bs++; +base = atoi((char*)bs); - if ( base <= 36 ) - { if ( base == 0 ) /* 0' */ - { addToBuffer(c, _PL_rd); - { if ( (c=getchr()) != EOF ) - { addToBuffer(c, _PL_rd); - if ( c == '\\' ) /* 0'\ */ - { if ( (c=getchr()) != EOF ) - addToBuffer(c, _PL_rd); - } else if ( c == '\'' ) /* 0'' */ - { if ( (c=getchr()) != EOF ) - { if ( c == '\'' ) - addToBuffer(c, _PL_rd); - else - goto handle_c; - } - } - break; - } - rawSyntaxError("end_of_file"); - } - } else - { int c2 = Speekcode(rb.stream); +if ( base <= 36 ) +{ if ( base == 0 ) /* 0' */ +{ addToBuffer(c, _PL_rd); +{ if ( (c=getchr()) != EOF ) +{ addToBuffer(c, _PL_rd); +if ( c == '\\' ) /* 0'\ */ +{ if ( (c=getchr()) != EOF ) + addToBuffer(c, _PL_rd); +} else if ( c == '\'' ) /* 0'' */ +{ if ( (c=getchr()) != EOF ) +{ if ( c == '\'' ) + addToBuffer(c, _PL_rd); +else + goto handle_c; +} +} +break; +} +rawSyntaxError("end_of_file"); +} +} else +{ int c2 = Speekcode(rb.stream); - if ( c2 != EOF ) - { if ( digitValue(base, c2) >= 0 ) - { addToBuffer(c, _PL_rd); - c = Sgetcode(rb.stream); - addToBuffer(c, _PL_rd); - dotseen = FALSE; - break; - } - goto sqatom; - } - rawSyntaxError("end_of_file"); - } - } - } - } +if ( c2 != EOF ) +{ if ( digitValue(base, c2) >= 0 ) +{ addToBuffer(c, _PL_rd); +c = Sgetcode(rb.stream); +addToBuffer(c, _PL_rd); +dotseen = FALSE; +break; +} +goto sqatom; +} +rawSyntaxError("end_of_file"); +} +} +} +} - sqatom: - set_start_line; - if ( !raw_read_quoted(c, _PL_rd) ) - fail; - dotseen = FALSE; +sqatom: +set_start_line; +if ( !raw_read_quoted(c, _PL_rd) ) + fail; +dotseen = FALSE; +break; +case '"': set_start_line; +if ( !raw_read_quoted(c, _PL_rd) ) + fail; +dotseen = FALSE; +break; +case '.': addToBuffer(c, _PL_rd); +set_start_line; +dotseen++; +c = getchr(); +if ( isSymbolW(c) ) +{ while( c != EOF && isSymbolW(c) && + !(c == '`' && _PL_rd->backquoted_string) ) +{ addToBuffer(c, _PL_rd); +c = getchr(); +} +dotseen = FALSE; +} +goto handle_c; +case '`': if ( _PL_rd->backquoted_string ) +{ set_start_line; +if ( !raw_read_quoted(c, _PL_rd) ) + fail; +dotseen = FALSE; +break; +} +/*FALLTHROUGH*/ +default: if ( c < 0xff ) +{ switch(_PL_char_types[c]) +{ case SP: +case CT: + blank: + if ( dotseen ) + { if ( rb.here - rb.base == 1 ) + rawSyntaxError("end_of_clause"); + ensure_space(c); + addToBuffer(EOS, _PL_rd); + return rb.base; + } +do +{ if ( something_read ) /* positions, \0 --> ' ' */ + addToBuffer(c ? c : ' ', _PL_rd); +else + ensure_space(c); +c = getchr(); +} while( c != EOF && PlBlankW(c) ); +goto handle_c; +case SY: + set_start_line; + do + { addToBuffer(c, _PL_rd); + c = getchr(); + if ( c == '`' && _PL_rd->backquoted_string ) break; - case '"': set_start_line; - if ( !raw_read_quoted(c, _PL_rd) ) - fail; - dotseen = FALSE; - break; - case '.': addToBuffer(c, _PL_rd); - set_start_line; - dotseen++; - c = getchr(); - if ( isSymbolW(c) ) - { while( c != EOF && isSymbolW(c) && - !(c == '`' && _PL_rd->backquoted_string) ) - { addToBuffer(c, _PL_rd); - c = getchr(); - } - dotseen = FALSE; - } - goto handle_c; - case '`': if ( _PL_rd->backquoted_string ) - { set_start_line; - if ( !raw_read_quoted(c, _PL_rd) ) - fail; - dotseen = FALSE; - break; - } - /*FALLTHROUGH*/ - default: if ( c < 0xff ) - { switch(_PL_char_types[c]) - { case SP: - case CT: - blank: - if ( dotseen ) - { if ( rb.here - rb.base == 1 ) - rawSyntaxError("end_of_clause"); - ensure_space(c); - addToBuffer(EOS, _PL_rd); - return rb.base; - } - do - { if ( something_read ) /* positions, \0 --> ' ' */ - addToBuffer(c ? c : ' ', _PL_rd); - else - ensure_space(c); - c = getchr(); - } while( c != EOF && PlBlankW(c) ); - goto handle_c; - case SY: - set_start_line; - do - { addToBuffer(c, _PL_rd); - c = getchr(); - if ( c == '`' && _PL_rd->backquoted_string ) - break; - } while( c != EOF && c <= 0xff && isSymbol(c) ); - /* TBD: wide symbols? */ - dotseen = FALSE; - goto handle_c; - case LC: - case UC: - set_start_line; - do - { addToBuffer(c, _PL_rd); - c = getchr(); - } while( c != EOF && PlIdContW(c) ); - dotseen = FALSE; - goto handle_c; - default: - addToBuffer(c, _PL_rd); - dotseen = FALSE; - set_start_line; - } - } else /* > 255 */ - { if ( PlIdStartW(c) ) - { set_start_line; - do - { addToBuffer(c, _PL_rd); - c = getchr(); - } while( c != EOF && PlIdContW(c) ); - dotseen = FALSE; - goto handle_c; - } else if ( PlBlankW(c) ) - { goto blank; - } else - { addToBuffer(c, _PL_rd); - dotseen = FALSE; - set_start_line; - } - } - } - } + } while( c != EOF && c <= 0xff && isSymbol(c) ); + /* TBD: wide symbols? */ + dotseen = FALSE; + goto handle_c; +case LC: +case UC: + set_start_line; + do + { addToBuffer(c, _PL_rd); + c = getchr(); + } while( c != EOF && PlIdContW(c) ); + dotseen = FALSE; + goto handle_c; +default: + addToBuffer(c, _PL_rd); + dotseen = FALSE; + set_start_line; +} +} else /* > 255 */ +{ if ( PlIdStartW(c) ) +{ set_start_line; +do +{ addToBuffer(c, _PL_rd); +c = getchr(); +} while( c != EOF && PlIdContW(c) ); +dotseen = FALSE; +goto handle_c; +} else if ( PlBlankW(c) ) +{ goto blank; +} else +{ addToBuffer(c, _PL_rd); +dotseen = FALSE; +set_start_line; +} +} +} +} } @@ -928,65 +928,65 @@ static unsigned char * raw_read(ReadData _PL_rd, unsigned char **endp ARG_LD) { unsigned char *s; - if ( (rb.stream->flags & SIO_ISATTY) && Sfileno(rb.stream) >= 0 ) - { ttybuf tab; +if ( (rb.stream->flags & SIO_ISATTY) && Sfileno(rb.stream) >= 0 ) +{ ttybuf tab; - PushTty(rb.stream, &tab, TTY_SAVE); /* make sure tty is sane */ - PopTty(rb.stream, &ttytab, FALSE); - s = raw_read2(_PL_rd PASS_LD); - PopTty(rb.stream, &tab, TRUE); - } else - { s = raw_read2(_PL_rd PASS_LD); - } +PushTty(rb.stream, &tab, TTY_SAVE); /* make sure tty is sane */ +PopTty(rb.stream, &ttytab, FALSE); +s = raw_read2(_PL_rd PASS_LD); +PopTty(rb.stream, &tab, TRUE); +} else +{ s = raw_read2(_PL_rd PASS_LD); +} - if ( endp ) - *endp = _PL_rd->_rb.here; +if ( endp ) + *endp = _PL_rd->_rb.here; - return s; +return s; } static void callCommentHook(term_t comments, term_t tpos, term_t term) { GET_LD - fid_t fid; - term_t av; + fid_t fid; +term_t av; - if ( (fid = PL_open_foreign_frame()) && - (av = PL_new_term_refs(3)) ) - { qid_t qid; +if ( (fid = PL_open_foreign_frame()) && + (av = PL_new_term_refs(3)) ) +{ qid_t qid; - PL_put_term(av+0, comments); - PL_put_term(av+1, tpos); - PL_put_term(av+2, term); +PL_put_term(av+0, comments); +PL_put_term(av+1, tpos); +PL_put_term(av+2, term); - if ( (qid = PL_open_query(NULL, PL_Q_NODEBUG|PL_Q_CATCH_EXCEPTION, - (predicate_t)PredCommentHook, av)) ) - { term_t ex; +if ( (qid = PL_open_query(NULL, PL_Q_NODEBUG|PL_Q_CATCH_EXCEPTION, + (predicate_t)PredCommentHook, av)) ) +{ term_t ex; - if ( !PL_next_solution(qid) && (ex=PL_exception(qid)) ) - printMessage(ATOM_error, PL_TERM, ex); +if ( !PL_next_solution(qid) && (ex=PL_exception(qid)) ) + printMessage(ATOM_error, PL_TERM, ex); - PL_close_query(qid); - } - PL_discard_foreign_frame(fid); - } +PL_close_query(qid); +} +PL_discard_foreign_frame(fid); +} } - /******************************** - * PROLOG CONNECTION * - *********************************/ +/******************************** + * PROLOG CONNECTION * + *********************************/ static unsigned char * backSkipUTF8(unsigned const char *start, unsigned const char *end, int *chr) { const unsigned char *s; - for(s=end-1 ; s>start && ( *s&0x80 ); s--) - ; - utf8_get_char((char*)s, chr); +for(s=end-1 ; s>start && ( *s&0x80 ); s--) + ; +utf8_get_char((char*)s, chr); - return (unsigned char *)s; +return (unsigned char *)s; } @@ -994,34 +994,34 @@ static unsigned char * backSkipBlanks(const unsigned char *start, const unsigned char *end) { const unsigned char *s; - for( ; end > start; end = s) - { unsigned char *e; - int chr; +for( ; end > start; end = s) +{ unsigned char *e; +int chr; - for(s=end-1 ; s>start && ISUTF8_CB(*s); s--) - ; - e = (unsigned char*)utf8_get_char((char*)s, &chr); - assert(e == end); - if ( !PlBlankW(chr) ) - return (unsigned char*)end; - } +for(s=end-1 ; s>start && ISUTF8_CB(*s); s--) + ; +e = (unsigned char*)utf8_get_char((char*)s, &chr); +assert(e == end); +if ( !PlBlankW(chr) ) + return (unsigned char*)end; +} - return (unsigned char *)start; +return (unsigned char *)start; } static inline ucharp skipSpaces(cucharp in) { int chr; - ucharp s; +ucharp s; - for( ; *in; in=s) - { s = utf8_get_uchar(in, &chr); +for( ; *in; in=s) +{ s = utf8_get_uchar(in, &chr); - if ( !PlBlankW(chr) ) - return (ucharp)in; - } +if ( !PlBlankW(chr) ) + return (ucharp)in; +} - return (ucharp)in; +return (ucharp)in; } @@ -1029,202 +1029,203 @@ skipSpaces(cucharp in) word pl_raw_read2(term_t from, term_t term) { GET_LD - unsigned char *s, *e, *t2, *top; - read_data rd; - word rval; - IOSTREAM *in; - int chr; - PL_chars_t txt; + unsigned char *s, *e, *t2, *top; +read_data rd; +word rval; +IOSTREAM *in; +int chr; +PL_chars_t txt; - if ( !getTextInputStream(from, &in) ) - fail; +if ( !getTextInputStream(from, &in) ) + fail; - init_read_data(&rd, in PASS_LD); - if ( !(s = raw_read(&rd, &e PASS_LD)) ) - { rval = PL_raise_exception(rd.exception); - goto out; - } +init_read_data(&rd, in PASS_LD); +if ( !(s = raw_read(&rd, &e PASS_LD)) ) +{ rval = PL_raise_exception(rd.exception); +goto out; +} - /* strip the input from blanks */ - top = backSkipBlanks(s, e-1); - t2 = backSkipUTF8(s, top, &chr); - if ( chr == '.' ) - top = backSkipBlanks(s, t2); - /* watch for "0' ." */ - if ( top < e && top-2 >= s && top[-1] == '\'' && top[-2] == '0' ) - top++; - *top = EOS; - s = skipSpaces(s); +/* strip the input from blanks */ +top = backSkipBlanks(s, e-1); +t2 = backSkipUTF8(s, top, &chr); +if ( chr == '.' ) + top = backSkipBlanks(s, t2); +/* watch for "0' ." */ +if ( top < e && top-2 >= s && top[-1] == '\'' && top[-2] == '0' ) + top++; +*top = EOS; +s = skipSpaces(s); - txt.text.t = (char*)s; - txt.length = top-s; - txt.storage = PL_CHARS_HEAP; - txt.encoding = ENC_UTF8; - txt.canonical = FALSE; +txt.text.t = (char*)s; +txt.length = top-s; +txt.storage = PL_CHARS_HEAP; +txt.encoding = ENC_UTF8; +txt.canonical = FALSE; - rval = PL_unify_text(term, 0, &txt, PL_ATOM); +rval = PL_unify_text(term, 0, &txt, PL_ATOM); out: - free_read_data(&rd); - if ( Sferror(in) ) - return streamStatus(in); - else - PL_release_stream(in); +free_read_data(&rd); +if ( Sferror(in) ) + return streamStatus(in); +else + PL_release_stream(in); - return rval; +return rval; } static int unify_read_term_position(term_t tpos ARG_LD) { if ( tpos && source_line_no > 0 ) - { return PL_unify_term(tpos, - PL_FUNCTOR, FUNCTOR_stream_position4, - PL_INT64, source_char_no, - PL_INT, source_line_no, - PL_INT, source_line_pos, - PL_INT64, source_byte_no); - } else - { return TRUE; - } +{ return PL_unify_term(tpos, + PL_FUNCTOR, FUNCTOR_stream_position4, + PL_INT64, source_char_no, + PL_INT, source_line_no, + PL_INT, source_line_pos, + PL_INT64, source_byte_no); +} else +{ return TRUE; +} } /** read_clause(+Stream:stream, -Clause:clause, +Options:list) - + Options: - * variable_names(-Names) - * process_comment(+Boolean) - * comments(-List) - * syntax_errors(+Atom) - * term_position(-Position) - * subterm_positions(-Layout) -*/ + * variable_names(-Names) + * process_comment(+Boolean) + * comments(-List) + * syntax_errors(+Atom) + * term_position(-Position) + * subterm_positions(-Layout) + */ static const opt_spec read_clause_options[] = { { ATOM_variable_names, OPT_TERM }, - { ATOM_term_position, OPT_TERM }, - { ATOM_subterm_positions, OPT_TERM }, - { ATOM_process_comment, OPT_BOOL }, - { ATOM_comments, OPT_TERM }, - { ATOM_syntax_errors, OPT_ATOM }, - { NULL_ATOM, 0 } + { ATOM_term_position, OPT_TERM }, + { ATOM_subterm_positions, OPT_TERM }, + { ATOM_process_comment, OPT_BOOL }, + { ATOM_comments, OPT_TERM }, + { ATOM_syntax_errors, OPT_ATOM }, + { NULL_ATOM, 0 } }; static int read_clause(IOSTREAM *s, term_t term, term_t options ARG_LD) -{ read_data rd; - int rval; - fid_t fid; - term_t tpos = 0; - term_t comments = 0; - term_t opt_comments = 0; - int process_comment; - atom_t syntax_errors = ATOM_dec10; +{ + read_data rd; + int rval; + fid_t fid; + term_t tpos = 0; + term_t comments = 0; + term_t opt_comments = 0; + int process_comment; + atom_t syntax_errors = ATOM_dec10; - { - OPCODE ophook = PredCommentHook->OpcodeOfPred; - if (ophook == UNDEF_OPCODE || ophook == FAIL_OPCODE) - process_comment = FALSE; - else - process_comment = TRUE; - } - if ( !(fid=PL_open_foreign_frame()) ) - return FALSE; + { + OPCODE ophook = PredCommentHook->OpcodeOfPred; + if (ophook == UNDEF_OPCODE || ophook == FAIL_OPCODE) + process_comment = FALSE; + else + process_comment = TRUE; + } + if ( !(fid=PL_open_foreign_frame()) ) + return FALSE; -retry: - init_read_data(&rd, s PASS_LD); + retry: + init_read_data(&rd, s PASS_LD); - if ( options && - !scan_options(options, 0, ATOM_read_option, read_clause_options, - &rd.varnames, - &tpos, - &rd.subtpos, - &process_comment, - &opt_comments, - &syntax_errors) ) - { PL_close_foreign_frame(fid); - return FALSE; - } + if ( options && + !scan_options(options, 0, ATOM_read_option, read_clause_options, + &rd.varnames, + &tpos, + &rd.subtpos, + &process_comment, + &opt_comments, + &syntax_errors) ) + { PL_close_foreign_frame(fid); + return FALSE; + } - if ( opt_comments ) - { comments = PL_new_term_ref(); - } else if ( process_comment ) - { if ( !tpos ) - tpos = PL_new_term_ref(); - comments = PL_new_term_ref(); - } + if ( opt_comments ) + { comments = PL_new_term_ref(); + } else if ( process_comment ) + { if ( !tpos ) + tpos = PL_new_term_ref(); + comments = PL_new_term_ref(); + } - REGS_FROM_LD - rd.module = Yap_GetModuleEntry( LOCAL_SourceModule ); - if ( comments ) - rd.comments = PL_copy_term_ref(comments); - rd.on_error = syntax_errors; - rd.singles = rd.styleCheck & SINGLETON_CHECK ? 1 : 0; - if ( (rval=read_term(term, &rd PASS_LD)) && - (!tpos || (rval=unify_read_term_position(tpos PASS_LD))) ) - { - PredEntry *ap; + REGS_FROM_LD + rd.module = Yap_GetModuleEntry( LOCAL_SourceModule ); + if ( comments ) + rd.comments = PL_copy_term_ref(comments); + rd.on_error = syntax_errors; + rd.singles = rd.styleCheck & SINGLETON_CHECK ? 1 : 0; + if ( (rval=read_term(term, &rd PASS_LD)) && + (!tpos || (rval=unify_read_term_position(tpos PASS_LD))) ) + { + PredEntry *ap; - if (rd.singles) { - // warning, singletons([X=_A],f(X,Y,Z), pos). - printMessage(ATOM_warning, - PL_FUNCTOR_CHARS, "singletons", 3, - PL_TERM, rd.singles, - PL_TERM, term, - PL_TERM, tpos ); - } - ap = Yap_PredFromClause( Yap_GetFromSlot(term PASS_REGS) PASS_REGS); - if (rd.styleCheck & (DISCONTIGUOUS_STYLE|MULTIPLE_CHECK) && ap != NULL ) { - if ( rd.styleCheck & (DISCONTIGUOUS_STYLE) && Yap_discontiguous( ap PASS_REGS) ) { - printMessage(ATOM_warning, - PL_FUNCTOR_CHARS, "discontiguous", 2, - PL_TERM, term, - PL_TERM, tpos ); - } - if ( rd.styleCheck & (MULTIPLE_CHECK) && Yap_multiple( ap PASS_REGS) ) { - printMessage(ATOM_warning, - PL_FUNCTOR_CHARS, "multiple", 3, - PL_TERM, term, - PL_TERM, tpos, - PL_ATOM, YAP_SWIAtomFromAtom(ap->src.OwnerFile) ); - } - } - if ( rd.comments && - (rval = PL_unify_nil(rd.comments)) ) - { if ( opt_comments ) - rval = PL_unify(opt_comments, comments); - else if ( !PL_get_nil(comments) ) - callCommentHook(comments, tpos, term); + if (rd.singles) { + // warning, singletons([X=_A],f(X,Y,Z), pos). + printMessage(ATOM_warning, + PL_FUNCTOR_CHARS, "singletons", 3, + PL_TERM, rd.singles, + PL_TERM, term, + PL_TERM, tpos ); + } + ap = Yap_PredFromClause( Yap_GetFromSlot(term PASS_REGS) PASS_REGS); + if (rd.styleCheck & (DISCONTIGUOUS_STYLE|MULTIPLE_CHECK) && ap != NULL ) { + if ( rd.styleCheck & (DISCONTIGUOUS_STYLE) && Yap_discontiguous( ap PASS_REGS) ) { + printMessage(ATOM_warning, + PL_FUNCTOR_CHARS, "discontiguous", 2, + PL_TERM, term, + PL_TERM, tpos ); + } + if ( rd.styleCheck & (MULTIPLE_CHECK) && Yap_multiple( ap PASS_REGS) ) { + printMessage(ATOM_warning, + PL_FUNCTOR_CHARS, "multiple", 3, + PL_TERM, term, + PL_TERM, tpos, + PL_ATOM, YAP_SWIAtomFromAtom(ap->src.OwnerFile) ); + } + } + if ( rd.comments && + (rval = PL_unify_nil(rd.comments)) ) + { if ( opt_comments ) + rval = PL_unify(opt_comments, comments); + else if ( !PL_get_nil(comments) ) + callCommentHook(comments, tpos, term); + } } else { if ( rd.has_exception && reportReadError(&rd) ) - { PL_rewind_foreign_frame(fid); - free_read_data(&rd); - goto retry; - } + { PL_rewind_foreign_frame(fid); + free_read_data(&rd); + goto retry; } - } - free_read_data(&rd); + } + free_read_data(&rd); - return rval; + return rval; } static PRED_IMPL("read_clause", 3, read_clause, 0) { PRED_LD - int rc; - IOSTREAM *s; + int rc; +IOSTREAM *s; - if ( !getTextInputStream(A1, &s) ) - return FALSE; - rc = read_clause(s, A2, A3 PASS_LD); - if ( Sferror(s) ) - return streamStatus(s); - else - PL_release_stream(s); +if ( !getTextInputStream(A1, &s) ) + return FALSE; +rc = read_clause(s, A2, A3 PASS_LD); +if ( Sferror(s) ) + return streamStatus(s); +else + PL_release_stream(s); - return rc; +return rc; } @@ -1236,237 +1237,237 @@ pl_raw_read(term_t term) static const opt_spec read_term_options[] = { { ATOM_variable_names, OPT_TERM }, - { ATOM_variables, OPT_TERM }, - { ATOM_singletons, OPT_TERM }, - { ATOM_term_position, OPT_TERM }, - { ATOM_subterm_positions, OPT_TERM }, - { ATOM_character_escapes, OPT_BOOL }, - { ATOM_double_quotes, OPT_ATOM }, - { ATOM_module, OPT_ATOM }, - { ATOM_syntax_errors, OPT_ATOM }, - { ATOM_backquoted_string, OPT_BOOL }, - { ATOM_comments, OPT_TERM }, - { ATOM_process_comment, OPT_BOOL }, + { ATOM_variables, OPT_TERM }, + { ATOM_singletons, OPT_TERM }, + { ATOM_term_position, OPT_TERM }, + { ATOM_subterm_positions, OPT_TERM }, + { ATOM_character_escapes, OPT_BOOL }, + { ATOM_double_quotes, OPT_ATOM }, + { ATOM_module, OPT_ATOM }, + { ATOM_syntax_errors, OPT_ATOM }, + { ATOM_backquoted_string, OPT_BOOL }, + { ATOM_comments, OPT_TERM }, + { ATOM_process_comment, OPT_BOOL }, #ifdef O_QUASIQUOTATIONS - { ATOM_quasi_quotations, OPT_TERM }, + { ATOM_quasi_quotations, OPT_TERM }, #endif - { ATOM_cycles, OPT_BOOL }, - { NULL_ATOM, 0 } + { ATOM_cycles, OPT_BOOL }, + { NULL_ATOM, 0 } }; static foreign_t read_term_from_stream(IOSTREAM *s, term_t term, term_t options ARG_LD) { term_t tpos = 0; - term_t comments = 0; - term_t opt_comments = 0; - int process_comment; - int rval; - atom_t w; - read_data rd; - bool charescapes = -1; - atom_t dq = NULL_ATOM; - atom_t mname = NULL_ATOM; - fid_t fid = PL_open_foreign_frame(); +term_t comments = 0; +term_t opt_comments = 0; +int process_comment; +int rval; +atom_t w; +read_data rd; +bool charescapes = -1; +atom_t dq = NULL_ATOM; +atom_t mname = NULL_ATOM; +fid_t fid = PL_open_foreign_frame(); - if (!fid) - return FALSE; +if (!fid) + return FALSE; retry: - init_read_data(&rd, s PASS_LD); +init_read_data(&rd, s PASS_LD); - if ( !scan_options(options, 0, ATOM_read_option, read_term_options, - &rd.varnames, - &rd.variables, - &rd.singles, - &tpos, - &rd.subtpos, - &charescapes, - &dq, - &mname, - &rd.on_error, - &rd.backquoted_string, - &opt_comments, - &process_comment, +if ( !scan_options(options, 0, ATOM_read_option, read_term_options, + &rd.varnames, + &rd.variables, + &rd.singles, + &tpos, + &rd.subtpos, + &charescapes, + &dq, + &mname, + &rd.on_error, + &rd.backquoted_string, + &opt_comments, + &process_comment, #ifdef O_QUASIQUOTATIONS - &rd.quasi_quotations, + &rd.quasi_quotations, #endif - &rd.cycles) ) { - PL_discard_foreign_frame(fid); - free_read_data(&rd); - return FALSE; - } + &rd.cycles) ) { + PL_discard_foreign_frame(fid); + free_read_data(&rd); + return FALSE; +} - // yap specific, do not call process comment if undefined - if (process_comment) { - OPCODE ophook = PredCommentHook->OpcodeOfPred; - if (ophook == UNDEF_OPCODE || ophook == FAIL_OPCODE) - process_comment = FALSE; - } +// yap specific, do not call process comment if undefined +if (process_comment) { + OPCODE ophook = PredCommentHook->OpcodeOfPred; + if (ophook == UNDEF_OPCODE || ophook == FAIL_OPCODE) + process_comment = FALSE; +} - if ( opt_comments ) - { comments = PL_new_term_ref(); - } else if ( process_comment ) - { if ( !tpos ) - tpos = PL_new_term_ref(); - comments = PL_new_term_ref(); - } +if ( opt_comments ) +{ comments = PL_new_term_ref(); +} else if ( process_comment ) +{ if ( !tpos ) + tpos = PL_new_term_ref(); +comments = PL_new_term_ref(); +} - if ( mname ) - { rd.module = lookupModule(mname); - rd.flags = rd.module->flags; - } +if ( mname ) +{ rd.module = lookupModule(mname); +rd.flags = rd.module->flags; +} - if ( charescapes != -1 ) - { if ( charescapes ) - set(&rd, M_CHARESCAPE); - else - clear(&rd, M_CHARESCAPE); - } - if ( dq ) - { if ( !setDoubleQuotes(dq, &rd.flags) ) - return FALSE; - } - if ( rd.singles && PL_get_atom(rd.singles, &w) && w == ATOM_warning) - rd.singles = 1; +if ( charescapes != -1 ) +{ if ( charescapes ) + set(&rd, M_CHARESCAPE); +else + clear(&rd, M_CHARESCAPE); +} +if ( dq ) +{ if ( !setDoubleQuotes(dq, &rd.flags) ) + return FALSE; +} +if ( rd.singles && PL_get_atom(rd.singles, &w) && w == ATOM_warning) + rd.singles = 1; - if ( comments ) - rd.comments = PL_copy_term_ref(comments); +if ( comments ) + rd.comments = PL_copy_term_ref(comments); - rval = read_term(term, &rd PASS_LD); - if ( Sferror(s) ) { - free_read_data(&rd); - return FALSE; - } +rval = read_term(term, &rd PASS_LD); +if ( Sferror(s) ) { + free_read_data(&rd); + return FALSE; +} #ifdef O_QUASIQUOTATIONS - if ( rval ) - rval = parse_quasi_quotations(&rd PASS_LD); +if ( rval ) + rval = parse_quasi_quotations(&rd PASS_LD); #endif - if ( rval ) - { if ( tpos ) - rval = unify_read_term_position(tpos PASS_LD); - if (rval) { - if ( opt_comments ) - rval = PL_unify(opt_comments, comments); - else if (comments && !PL_get_nil(comments) ) - callCommentHook(comments, tpos, term); - } - } else { - if ( rd.has_exception && reportReadError(&rd) ) - { PL_rewind_foreign_frame(fid); - free_read_data(&rd); - goto retry; - } - } - free_read_data(&rd); +if ( rval ) +{ if ( tpos ) + rval = unify_read_term_position(tpos PASS_LD); +if (rval) { + if ( opt_comments ) + rval = PL_unify(opt_comments, comments); + else if (comments && !PL_get_nil(comments) ) + callCommentHook(comments, tpos, term); +} +} else { + if ( rd.has_exception && reportReadError(&rd) ) + { PL_rewind_foreign_frame(fid); + free_read_data(&rd); + goto retry; + } +} +free_read_data(&rd); - return rval; +return rval; } /** read_term(+Stream, -Term, +Options) is det. -*/ + */ static PRED_IMPL("read_term", 3, read_term, PL_FA_ISO) { PRED_LD - IOSTREAM *s; + IOSTREAM *s; - if ( getTextInputStream(A1, &s) ) - { if ( read_term_from_stream(s, A2, A3 PASS_LD) ) - return PL_release_stream(s); - if ( Sferror(s) ) - return streamStatus(s); - PL_release_stream(s); - return FALSE; - } +if ( getTextInputStream(A1, &s) ) +{ if ( read_term_from_stream(s, A2, A3 PASS_LD) ) + return PL_release_stream(s); +if ( Sferror(s) ) + return streamStatus(s); +PL_release_stream(s); +return FALSE; +} - return FALSE; +return FALSE; } /** read_term(-Term, +Options) is det. -*/ + */ static PRED_IMPL("read_term", 2, read_term, PL_FA_ISO) { PRED_LD - IOSTREAM *s; + IOSTREAM *s; - if ( getTextInputStream(0, &s) ) - { if ( read_term_from_stream(s, A1, A2 PASS_LD) ) - return PL_release_stream(s); - if ( Sferror(s) ) - return streamStatus(s); - PL_release_stream(s); - return FALSE; - } +if ( getTextInputStream(0, &s) ) +{ if ( read_term_from_stream(s, A1, A2 PASS_LD) ) + return PL_release_stream(s); +if ( Sferror(s) ) + return streamStatus(s); +PL_release_stream(s); +return FALSE; +} - return FALSE; +return FALSE; } - /******************************* - * TERM <->ATOM * - *******************************/ +/******************************* + * TERM <->ATOM * + *******************************/ static int atom_to_term(term_t atom, term_t term, term_t bindings) { GET_LD - PL_chars_t txt; + PL_chars_t txt; - if ( !bindings && PL_is_variable(atom) ) /* term_to_atom(+, -) */ - { char buf[1024]; - size_t bufsize = sizeof(buf); - int rval; - char *s = buf; - IOSTREAM *stream; - PL_chars_t txt; +if ( !bindings && PL_is_variable(atom) ) /* term_to_atom(+, -) */ +{ char buf[1024]; +size_t bufsize = sizeof(buf); +int rval; +char *s = buf; +IOSTREAM *stream; +PL_chars_t txt; - stream = Sopenmem(&s, &bufsize, "w"); - stream->encoding = ENC_UTF8; - PL_write_term(stream, term, 1200, PL_WRT_QUOTED); - Sflush(stream); +stream = Sopenmem(&s, &bufsize, "w"); +stream->encoding = ENC_UTF8; +PL_write_term(stream, term, 1200, PL_WRT_QUOTED); +Sflush(stream); - txt.text.t = s; - txt.length = bufsize; - txt.storage = PL_CHARS_HEAP; - txt.encoding = ENC_UTF8; - txt.canonical = FALSE; - rval = PL_unify_text(atom, 0, &txt, PL_ATOM); +txt.text.t = s; +txt.length = bufsize; +txt.storage = PL_CHARS_HEAP; +txt.encoding = ENC_UTF8; +txt.canonical = FALSE; +rval = PL_unify_text(atom, 0, &txt, PL_ATOM); - Sclose(stream); - if ( s != buf ) - Sfree(s); +Sclose(stream); +if ( s != buf ) + Sfree(s); - return rval; - } +return rval; +} - if ( PL_get_text(atom, &txt, CVT_ALL|CVT_EXCEPTION) ) - { GET_LD - read_data rd; - int rval; - IOSTREAM *stream; - source_location oldsrc = LD->read_source; +if ( PL_get_text(atom, &txt, CVT_ALL|CVT_EXCEPTION) ) +{ GET_LD + read_data rd; +int rval; +IOSTREAM *stream; +source_location oldsrc = LD->read_source; - stream = Sopen_text(&txt, "r"); +stream = Sopen_text(&txt, "r"); - init_read_data(&rd, stream PASS_LD); - if ( bindings && (PL_is_variable(bindings) || PL_is_list(bindings)) ) - rd.varnames = bindings; - else if ( bindings ) - return PL_error(NULL, 0, NULL, ERR_TYPE, ATOM_list, bindings); +init_read_data(&rd, stream PASS_LD); +if ( bindings && (PL_is_variable(bindings) || PL_is_list(bindings)) ) + rd.varnames = bindings; +else if ( bindings ) + return PL_error(NULL, 0, NULL, ERR_TYPE, ATOM_list, bindings); - if ( !(rval = read_term(term, &rd PASS_LD)) && rd.has_exception ) - rval = PL_raise_exception(rd.exception); - free_read_data(&rd); - Sclose(stream); - LD->read_source = oldsrc; +if ( !(rval = read_term(term, &rd PASS_LD)) && rd.has_exception ) + rval = PL_raise_exception(rd.exception); +free_read_data(&rd); +Sclose(stream); +LD->read_source = oldsrc; - // getchar(); - return rval; - } +// getchar(); +return rval; +} - fail; +fail; } @@ -1485,33 +1486,33 @@ PRED_IMPL("term_to_atom", 2, term_to_atom, 0) int PL_chars_to_term(const char *s, term_t t) { GET_LD - read_data rd; - int rval; - IOSTREAM *stream = Sopen_string(NULL, (char *)s, -1, "r"); - source_location oldsrc = LD->read_source; + read_data rd; +int rval; +IOSTREAM *stream = Sopen_string(NULL, (char *)s, -1, "r"); +source_location oldsrc = LD->read_source; - init_read_data(&rd, stream PASS_LD); - PL_put_variable(t); - if ( !(rval = read_term(t, &rd PASS_LD)) && rd.has_exception ) - PL_put_term(t, rd.exception); - free_read_data(&rd); - Sclose(stream); - LD->read_source = oldsrc; +init_read_data(&rd, stream PASS_LD); +PL_put_variable(t); +if ( !(rval = read_term(t, &rd PASS_LD)) && rd.has_exception ) + PL_put_term(t, rd.exception); +free_read_data(&rd); +Sclose(stream); +LD->read_source = oldsrc; - return rval; +return rval; } - /******************************* - * PUBLISH PREDICATES * - *******************************/ +/******************************* + * PUBLISH PREDICATES * + *******************************/ BeginPredDefs(read) - PRED_DEF("read_term", 3, read_term, PL_FA_ISO) - PRED_DEF("read_term", 2, read_term, PL_FA_ISO) - PRED_DEF("read_clause", 3, read_clause, 0) - PRED_DEF("atom_to_term", 3, atom_to_term, 0) - PRED_DEF("term_to_atom", 2, term_to_atom, 0) +PRED_DEF("read_term", 3, read_term, PL_FA_ISO) +PRED_DEF("read_term", 2, read_term, PL_FA_ISO) +PRED_DEF("read_clause", 3, read_clause, 0) +PRED_DEF("atom_to_term", 3, atom_to_term, 0) +PRED_DEF("term_to_atom", 2, term_to_atom, 0) #ifdef O_QUASIQUOTATIONS - PRED_DEF("$qq_open", 2, qq_open, 0) +PRED_DEF("$qq_open", 2, qq_open, 0) #endif EndPredDefs From 2ec6d6588df9188dd36e4d0855d6f258ea7f5381 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 6 May 2014 09:32:49 +0100 Subject: [PATCH 17/22] do not compile pldoc for now --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 44b195e60..61d3e4207 100755 --- a/Makefile.in +++ b/Makefile.in @@ -542,7 +542,7 @@ INSTALLED_PACKAGES= \ @PKG_LIBARCHIVE@ \ @PKG_LTX2HTM@ \ @PKG_ODBC@ \ - @PKG_PLDOC@ \ + \ @PKG_PLUNIT@ \ @PKG_REAL@ \ @PKG_RDF@ \ @@ -550,7 +550,7 @@ INSTALLED_PACKAGES= \ @PKG_SGML@ \ @PKG_SWIG@ \ @PKG_WINCONSOLE@ \ - @PKG_ZLIB@ + @PKG_ZLIB@ # @PKG_PLDOC@ PACKAGES= \ library \ From d6aa3ed8f003764944ae26e71b8c8d59ecb8b3d9 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 6 May 2014 09:34:25 +0100 Subject: [PATCH 18/22] use_module/3 wasn't working. --- pl/consult.yap | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pl/consult.yap b/pl/consult.yap index 3f9039c65..517dea81a 100755 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -251,6 +251,9 @@ load_files(Files,Opts) :- ( Val == false -> true ; Val == true -> true ; '$do_error'(domain_error(unimplemented_option,register(Val)),Call) ). +'$process_lf_opt'('$context_module', Val, Call) :- + ( atom(File) -> true ; '$do_error'(type_error(atom,File),Call) ). + '$lf_default_opts'(I, LastOpt, _TOpts) :- I > LastOpt, !. '$lf_default_opts'(I, LastOpt, TOpts) :- @@ -372,12 +375,20 @@ module(Mod, Decls) :- use_module(M,F,Is) :- '$use_module'(M,F,Is). +'$use_module'(M,F,Is) :- + var(Is), !, + '$use_module'(M,F,all). '$use_module'(M,F,Is) :- nonvar(M), !, - recorded('$module','$module'(F1,M,_,_),_), - '$load_files'(F1, [if(not_loaded),must_be_module(true),imports(Is)], use_module(M,F,Is)), - ( F1 = F -> true ; true ). + ( + recorded('$module','$module'(F1,M,_,_),_) + -> + '$load_files'(F1, [if(not_loaded),must_be_module(true),imports(Is)], use_module(M,F,Is)) + ), + strip_module(F, _, F0), + (var(F0) -> F0 = F1 ; absolute_file_name( F1, F0, [file_type(prolog)] ) ). '$use_module'(M,F,Is) :- - '$load_files'(F, [if(not_loaded),must_be_module(true),imports(Is)], use_module(M,F,Is)). + strip_module(F, M0, F0), + '$load_files'(F0, [if(not_loaded),'$context_module'(M0),must_be_module(true),imports(Is)], use_module(M,F,Is)). '$csult'(Fs, M) :- '$extract_minus'(Fs, MFs), !, From df1dfc821a837e99fba40e07415bfb299b64e89d Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 6 May 2014 09:37:32 +0100 Subject: [PATCH 19/22] eclipse --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index 14b395f06..6ea2980ba 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,4 @@ docs/yap.info* .build -.cproject -.project -.settings autom4te.cache \ No newline at end of file From 4ebe56aad90aff0f0979b1ce5a33fc02d6059b9c Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 6 May 2014 09:38:22 +0100 Subject: [PATCH 20/22] C++ flags --- configure | 2 +- packages/gecode/Makefile.in | 2 +- packages/gecode/configure.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 251b7fbe5..7ecbcb973 100755 --- a/configure +++ b/configure @@ -15484,7 +15484,7 @@ fi if test -d /usr/local/include/gecode; then CFLAGS="$CFLAGS -I/usr/local/include" - SHLIB_CXXFLAGS="$SHLIB_CXXFLAGS -I/usr/local/include" + SHLIB_CXX_FLAGS="$SHLIB_CXX_FLAGS -I/usr/local/include" GECODE_EXTRALIBS="-L/usr/local/lib" fi diff --git a/packages/gecode/Makefile.in b/packages/gecode/Makefile.in index 7a8ac9451..45e30dd41 100755 --- a/packages/gecode/Makefile.in +++ b/packages/gecode/Makefile.in @@ -23,7 +23,7 @@ SHAREDIR=$(ROOTDIR)/share # # CXX=@CXX@ -CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I. -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../os -I "@GECODE_INCLUDES@" +CXXFLAGS= @SHLIB_CXX_FLAGS@ $(YAP_EXTRAS) $(DEFS) -I. -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../os -I "@GECODE_INCLUDES@" # # # You shouldn't need to change what follows. diff --git a/packages/gecode/configure.in b/packages/gecode/configure.in index a3fa90a1a..37fc7170b 100755 --- a/packages/gecode/configure.in +++ b/packages/gecode/configure.in @@ -7,7 +7,7 @@ AC_ARG_ENABLE(gecode, dnl gecode is usually in /usr/local if test -d /usr/local/include/gecode; then CFLAGS="$CFLAGS -I/usr/local/include" - SHLIB_CXXFLAGS="$SHLIB_CXXFLAGS -I/usr/local/include" + SHLIB_CXX_FLAGS="$SHLIB_CXX_FLAGS -I/usr/local/include" GECODE_EXTRALIBS="-L/usr/local/lib" fi From 73ff8676cabf83bcd8e302d3be60b98da6333906 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 6 May 2014 09:39:04 +0100 Subject: [PATCH 21/22] file systems without case --- packages/swig/yap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/swig/yap.c b/packages/swig/yap.c index 61adeb639..bf77d1e05 100644 --- a/packages/swig/yap.c +++ b/packages/swig/yap.c @@ -2,7 +2,7 @@ #include #include -#include "YAPInterface.h" +#include "YapInterface.h" static void init_yap( void ); int yap_prove_string(char *s); From b3704044329851c84fb39f0c8fa12b5d8243f920 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 6 May 2014 09:55:40 +0100 Subject: [PATCH 22/22] C++ flags --- packages/Dialect.defs.in | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/Dialect.defs.in b/packages/Dialect.defs.in index 41c883e1f..f7332bc72 100755 --- a/packages/Dialect.defs.in +++ b/packages/Dialect.defs.in @@ -48,6 +48,7 @@ CWFLAGS= CMFLAGS=@SHLIB_CFLAGS@ CIFLAGS= CFLAGS=$(COFLAGS) $(CWFLAGS) $(CMFLAGS) $(CIFLAGS) $(PKGCFLAGS) @DEFS@ +CXXFLAGS= $(COFLAGS) $(CWFLAGS) @SHLIB_CXXFLAGS@ $(CIFLAGS) $(PKGCFLAGS) @DEFS@ LDSOFLAGS=@LDFLAGS@ $(PKGLDFLAGS) LDFLAGS=$(PKGLDFLAGS)