From c4aae66f3ed69473219d0b911d04fc6b3edc625f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Tue, 13 Oct 2015 09:10:53 +0100 Subject: [PATCH] submods work --- C/pl-yap.c | 1571 ----------------- File | 0 .../CMakeDirectoryInformation.cmake | 16 - console/terminal/CMakeFiles/progress.marks | 1 - .../CMakeFiles/qtyap.dir/DependInfo.cmake | 57 - .../terminal/CMakeFiles/qtyap.dir/link.txt | 1 - .../qtyap_automoc.dir/AutogenInfo.cmake | 26 - .../qtyap_automoc.dir/DependInfo.cmake | 8 - .../CMakeDirectoryInformation.cmake | 16 - library/clp/CMakeFiles/progress.marks | 1 - .../CMakeDirectoryInformation.cmake | 16 - .../CMakeFiles/dialects.dir/DependInfo.cmake | 8 - library/dialect/CMakeFiles/progress.marks | 1 - .../CMakeDirectoryInformation.cmake | 16 - library/matlab/CMakeFiles/progress.marks | 1 - .../CMakeDirectoryInformation.cmake | 16 - library/mpi/CMakeFiles/progress.marks | 1 - .../CMakeDirectoryInformation.cmake | 16 - packages/CLPBN/CMakeFiles/progress.marks | 1 - .../CMakeDirectoryInformation.cmake | 16 - packages/ProbLog/CMakeFiles/progress.marks | 1 - packages/jpl/src/c/jpl.c | 138 +- packages/real/real.c | 2 +- packages/udi/LOG | 34 - packages/udi/LOGE | 1 - .../startup.yss.dir/DependInfo.cmake | 8 - .../CMakeDirectoryInformation.cmake | 16 - swi/library/CMakeFiles/progress.marks | 1 - 28 files changed, 70 insertions(+), 1920 deletions(-) delete mode 100755 C/pl-yap.c delete mode 100644 File delete mode 100644 console/terminal/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 console/terminal/CMakeFiles/progress.marks delete mode 100644 console/terminal/CMakeFiles/qtyap.dir/DependInfo.cmake delete mode 100644 console/terminal/CMakeFiles/qtyap.dir/link.txt delete mode 100644 console/terminal/CMakeFiles/qtyap_automoc.dir/AutogenInfo.cmake delete mode 100644 console/terminal/CMakeFiles/qtyap_automoc.dir/DependInfo.cmake delete mode 100644 library/clp/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 library/clp/CMakeFiles/progress.marks delete mode 100644 library/dialect/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 library/dialect/CMakeFiles/dialects.dir/DependInfo.cmake delete mode 100644 library/dialect/CMakeFiles/progress.marks delete mode 100644 library/matlab/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 library/matlab/CMakeFiles/progress.marks delete mode 100644 library/mpi/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 library/mpi/CMakeFiles/progress.marks delete mode 100644 packages/CLPBN/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 packages/CLPBN/CMakeFiles/progress.marks delete mode 100644 packages/ProbLog/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 packages/ProbLog/CMakeFiles/progress.marks delete mode 100644 packages/udi/LOG delete mode 100644 packages/udi/LOGE delete mode 100644 pl/CMakeFiles/startup.yss.dir/DependInfo.cmake delete mode 100644 swi/library/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 swi/library/CMakeFiles/progress.marks diff --git a/C/pl-yap.c b/C/pl-yap.c deleted file mode 100755 index 21ccd9068..000000000 --- a/C/pl-yap.c +++ /dev/null @@ -1,1571 +0,0 @@ - -/* YAP support for some low-level SWI stuff */ - -#define PL_KERNEL 1 - -#include -#if HAVE_UNISTD_H -#include -#endif -#if HAVE_SYS_TIMES_H -#include -#endif -#include "Yap.h" -#include "Yatom.h" -#include "pl-incl.h" -#include "YapText.h" -#include "yapio.h" -#if HAVE_MATH_H -#include -#endif -#if __WINDOWS__ -#include - -#define getpid _getpid -#endif - -#ifdef HAVE_LIMITS_H -#include -#endif - -//#define LOCK() PL_LOCK(L_PLFLAG) -//#define UNLOCK() PL_UNLOCK(L_PLFLAG) - -PL_local_data_t lds; - -gds_t gds; - -static atom_t -uncachedCodeToAtom(int chrcode) -{ if ( chrcode < 256 ) - { char tmp[2]; - - tmp[0] = chrcode; - tmp[1] = '\0'; - return YAP_SWIAtomFromAtom(lookupAtom(tmp, 1)); - } else - { pl_wchar_t tmp[2]; - - tmp[0] = chrcode; - tmp[1] = '\0'; - - return YAP_SWIAtomFromAtom(Yap_LookupWideAtom(tmp)); - } -} - - -atom_t -codeToAtom(int chrcode) -{ atom_t a; - - if ( chrcode == EOF ) - return ATOM_end_of_file; - - assert(chrcode >= 0); - - if ( chrcode < (1<<15) ) - { int page = chrcode / 256; - int entry = chrcode % 256; - atom_t *pv; - - if ( !(pv=GD->atoms.for_code[page]) ) - { pv = PL_malloc(256*sizeof(atom_t)); - - memset(pv, 0, 256*sizeof(atom_t)); - GD->atoms.for_code[page] = pv; - } - - if ( !(a=pv[entry]) ) - { a = pv[entry] = uncachedCodeToAtom(chrcode); - } - } else - { a = uncachedCodeToAtom(chrcode); - } - - return a; -} - -word -globalString(size_t size, char *s) -{ - CACHE_REGS - - return Yap_CharsToString(s PASS_REGS); -} - -word -globalWString(size_t size, wchar_t *s) -{ - CACHE_REGS - - return Yap_WCharsToString(s PASS_REGS); -} - -int -PL_rethrow(void) -{ GET_LD - - if ( LD->exception.throw_environment ) - longjmp(LD->exception.throw_environment->exception_jmp_env, 1); - - fail; -} - -int -saveWakeup(wakeup_state *state, int forceframe ARG_LD) -{ - return 0; -} - -void -restoreWakeup(wakeup_state *state ARG_LD) -{ -} - -int -callProlog(module_t module, term_t goal, int flags, term_t *ex ) -{ GET_LD - term_t g = PL_new_term_ref(); - functor_t fd; - predicate_t proc; - - if ( ex ) - *ex = 0; - - PL_strip_module(goal, &module, g); - if ( !PL_get_functor(g, &fd) ) - { PL_error(NULL, 0, NULL, ERR_TYPE, ATOM_callable, goal); - if ( ex ) - *ex = exception_term; - - fail; - } - - proc = PL_pred(fd, module); - - { int arity = arityFunctor(fd); - term_t args = PL_new_term_refs(arity); - qid_t qid; - int n, rval; - - for(n=0; ntype = V_INTEGER; - r->value.i = YAP_IntOfTerm(t0); - return 1; - } - if (YAP_IsFloatTerm(t0)) { - r->type = V_FLOAT; - r->value.f = YAP_FloatOfTerm(t0); - return 1; - } -#ifdef O_GMP - if (YAP_IsBigNumTerm(t0)) { - r->type = V_MPZ; - mpz_init(r->value.mpz); - YAP_BigNumOfTerm(t0, r->value.mpz); - return 1; - } - if (YAP_IsRationalTerm(t0)) { - r->type = V_MPQ; - mpq_init(r->value.mpq); - YAP_RationalOfTerm(t0, r->value.mpq); - return 1; - } -#endif - return 0; -} - - -/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -toIntegerNumber(Number n, int flags) - -Convert a number to an integer. Default, only rationals that happen to -be integer are converted. If TOINT_CONVERT_FLOAT is present, floating -point numbers are converted if they represent integers. If also -TOINT_TRUNCATE is provided non-integer floats are truncated to integers. - -Note that if a double is out of range for int64_t, it never has a -fractional part. -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - -static int -double_in_int64_range(double x) -{ int k; - double y = frexp(x, &k); - - if ( k < 8*(int)sizeof(int64_t) || - (y == -0.5 && k == 8*(int)sizeof(int64_t)) ) - return TRUE; - - return FALSE; -} - -int -toIntegerNumber(Number n, int flags) -{ -switch(n->type) - { case V_INTEGER: - succeed; -#ifdef O_GMP - case V_MPZ: - succeed; - case V_MPQ: /* never from stacks iff integer */ - if ( mpz_cmp_ui(mpq_denref(n->value.mpq), 1L) == 0 ) - { mpz_clear(mpq_denref(n->value.mpq)); - n->value.mpz[0] = mpq_numref(n->value.mpq)[0]; - n->type = V_MPZ; - succeed; - } - fail; -#endif - case V_FLOAT: - if ( (flags & TOINT_CONVERT_FLOAT) ) - { if ( double_in_int64_range(n->value.f) ) - { int64_t l = (int64_t)n->value.f; - - if ( (flags & TOINT_TRUNCATE) || - (double)l == n->value.f ) - { n->value.i = l; - n->type = V_INTEGER; - - return TRUE; - } - return FALSE; -#ifdef O_GMP - } else - { mpz_init_set_d(n->value.mpz, n->value.f); - n->type = V_MPZ; - - return TRUE; -#endif - } - } - return FALSE; - } - assert(0); - fail; -} - - -int -_PL_unify_atomic(term_t t, PL_atomic_t a) -{ - GET_LD - if (IsApplTerm(a) || IsAtomTerm(a)) - return Yap_unify(Yap_GetFromSlot(t ), a); - return PL_unify_atom(t, a); -} - -int -_PL_unify_string(term_t t, word w) -{ - CACHE_REGS - return Yap_unify(Yap_GetFromSlot(t ), w); -} - -Atom lookupAtom(const char *s, size_t len) -{ - Atom at; - - /* dirty trick to ensure s is null terminated */ - char *st = (char *)s; - if (st[len]) - st[len] = '\0'; - if (len >= strlen(s)) { - at = Yap_LookupAtom(st); - } else { - char * buf = PL_malloc(len+1); - - if (!buf) - return 0; - strncpy(buf,s,len); - at = Yap_LookupAtom(buf); - PL_free(buf); - } - Yap_AtomIncreaseHold(at); - return at; -} - -Atom lookupUCSAtom(const pl_wchar_t *s, size_t len) -{ - YAP_Atom at; - - if (len >= wcslen(s)) { - at = Yap_LookupWideAtom(s); - } else { - pl_wchar_t * buf = PL_malloc((len+1)*sizeof(pl_wchar_t)); - - if (!buf) - return 0; - wcsncpy(buf,s,len); - at = Yap_LookupWideAtom(buf); - PL_free(buf); - } - Yap_AtomIncreaseHold(at); - return at; -} - - - - /******************************* - * OPTIONS * - *******************************/ - -/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Variable argument list: - - atom_t name - int type OPT_ATOM, OPT_STRING, OPT_BOOL, OPT_INT, OPT_LONG - pointer value -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - -#define MAXOPTIONS 32 - -typedef union -{ bool *b; /* boolean value */ - long *l; /* long value */ - int *i; /* integer value */ - char **s; /* string value */ - word *a; /* atom value */ - term_t *t; /* term-reference */ - void *ptr; /* anonymous pointer */ -} optvalue; - - -int -get_atom_ptr_text(Atom a, PL_chars_t *text) -{ - if (IsWideAtom(a)) { - pl_wchar_t *name = (pl_wchar_t *)a->WStrOfAE; - text->text.w = name; - text->length = wcslen(name); - text->encoding = ENC_WCHAR; - } else - { char *name = a->StrOfAE; - text->text.t = name; - text->length = strlen(name); - text->encoding = ENC_ISO_LATIN_1; - } - text->storage = PL_CHARS_HEAP; - text->canonical = TRUE; - - succeed; -} - - -int -get_atom_text(atom_t atom, PL_chars_t *text) -{ Atom a = YAP_AtomFromSWIAtom(atom); - - return get_atom_ptr_text(a, text); -} - -int -get_string_text(word w, PL_chars_t *text ARG_LD) -{ - text->text.t = (char *)StringOfTerm(w); - text->encoding = ENC_UTF8; - text->length = strlen(text->text.t); - text->storage = PL_CHARS_STACK; - text->canonical = TRUE; - return TRUE; -} - -void -PL_get_number(term_t l, number *n) { - GET_LD - YAP_Term t = valHandle(l); - if (YAP_IsIntTerm(t)) { - n->type = V_INTEGER; - n->value.i = YAP_IntOfTerm(t); -#ifdef O_GMP - } else if (YAP_IsBigNumTerm(t)) { - n->type = V_MPZ; - mpz_init(n->value.mpz); - YAP_BigNumOfTerm(t, n->value.mpz); - } else { - n->type = V_MPQ; - mpq_init(n->value.mpq); - YAP_RationalOfTerm(t, &n->value.mpq); -#endif - } -} - -/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Formatting a float. This is very complicated as we must write floats -such that it can be read as a float. This means using the conventions of -the C locale and if the float happens to be integer as .0. - -Switching the locale is no option as locale handling is not thread-safe -and may have unwanted consequences for embedding. There is a intptr_t -discussion on the very same topic on the Python mailinglist. Many hacks -are proposed, none is very satisfactory. Richard O'Keefe suggested to -use ecvt(), fcvt() and gcvt(). These are not thread-safe. The GNU C -library provides *_r() variations that can do the trick. An earlier -patch used localeconv() to find the decimal point, but this is both -complicated and not thread-safe. - -Finally, with help of Richard we decided to replace the first character -that is not a digit nor [eE], as this must be the decimal point. -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - -#define isDigit(c) ((c) >= '0' && (c) <= '9') - -intptr_t -lengthList(term_t list, int errors) -{ GET_LD - intptr_t length = 0; - Word l = YAP_AddressFromSlot(list); - Word tail; - - length = skip_list(l, &tail PASS_LD); - - if ( isNil(*tail) ) - return length; - - if ( errors ) - PL_error(NULL, 0, NULL, ERR_TYPE, ATOM_list, wordToTermRef(l)); - - return isVar(*tail) ? -2 : -1; -} - -int raiseStackOverflow(int overflow) -{ - return overflow; -} - - /******************************* - * FEATURES * - *******************************/ - -int -PL_set_prolog_flag(const char *name, int type, ...) -{ va_list args; - int rval = TRUE; - int flags = (type & FF_MASK); - - va_start(args, type); - switch(type & ~FF_MASK) - { case PL_BOOL: - { int val = va_arg(args, int); - - setPrologFlag(name, FT_BOOL|flags, val, 0); - break; - } - case PL_ATOM: - { const char *v = va_arg(args, const char *); -#ifndef __YAP_PROLOG__ - if ( !GD->initialised ) - initAtoms(); -#endif - setPrologFlag(name, FT_ATOM|flags, v); - break; - } - case PL_INTEGER: - { intptr_t v = va_arg(args, intptr_t); - setPrologFlag(name, FT_INTEGER|flags, v); - break; - } - default: - rval = FALSE; - } - va_end(args); - - return rval; -} - - -int -PL_unify_chars(term_t t, int flags, size_t len, const char *s) -{ PL_chars_t text; - term_t tail; - int rc; - - if ( len == (size_t)-1 ) - len = strlen(s); - - text.text.t = (char *)s; - text.encoding = ((flags&REP_UTF8) ? ENC_UTF8 : \ - (flags&REP_MB) ? ENC_ANSI : ENC_ISO_LATIN_1); - text.storage = PL_CHARS_HEAP; - text.length = len; - text.canonical = FALSE; - - flags &= ~(REP_UTF8|REP_MB|REP_ISO_LATIN_1); - - if ( (flags & PL_DIFF_LIST) ) - { tail = t+1; - flags &= (~PL_DIFF_LIST); - } else - { tail = 0; - } - - rc = PL_unify_text(t, tail, &text, flags); - PL_free_text(&text); - - return rc; -} - -X_API int PL_handle_signals(void) -{ - return Yap_HandleInterrupts( ); -} - -void -outOfCore() -{ fprintf(stderr,"Could not allocate memory: %s", OsError()); - exit(1); -} - -int -priorityOperator(Module m, atom_t atom) -{ - YAP_Term mod = (YAP_Term)m; - if (!m) - mod = YAP_CurrentModule(); - return YAP_MaxOpPriority(YAP_AtomFromSWIAtom(atom), mod); -} - -int -currentOperator(Module m, atom_t name, int kind, int *type, int *priority) -{ - YAP_Term mod = (YAP_Term)m; - int opkind, yap_type; - - if (!m) - mod = YAP_CurrentModule(); - switch (kind) { - case OP_PREFIX: - opkind = 2; - break; - case OP_INFIX: - opkind = 0; - break; - case OP_POSTFIX: - default: - opkind = 1; - } - if (!YAP_OpInfo(YAP_AtomFromSWIAtom(name), mod, opkind, &yap_type, priority)) { - return FALSE; - } - switch(yap_type) { - case 1: - *type = OP_XFX; - break; - case 2: - *type = OP_XFY; - break; - case 3: - *type = OP_YFX; - break; - case 4: - *type = OP_XFX; - break; - case 5: - *type = OP_XF; - break; - case 6: - *type = OP_YF; - break; - case 7: - *type = OP_FX; - break; - default: - *type = OP_FY; - break; - } - return 1; -} - -int -numberVars(term_t t, nv_options *opts, int n ARG_LD) { - - return Yap_NumberVars(YAP_GetFromSlot(t), n, opts->singletons); -} - - /******************************* - * PROMOTION * - *******************************/ - -int -check_float(double f) -{ -#ifdef HAVE_FPCLASSIFY - switch(fpclassify(f)) - { case FP_NAN: - return PL_error(NULL, 0, NULL, ERR_AR_UNDEF); - break; - case FP_INFINITE: - return PL_error(NULL, 0, NULL, ERR_AR_OVERFLOW); - break; - } -#else -#ifdef HAVE_FPCLASS - switch(fpclass(f)) - { case FP_SNAN: - case FP_QNAN: - return PL_error(NULL, 0, NULL, ERR_AR_UNDEF); - break; - case FP_NINF: - case FP_PINF: - return PL_error(NULL, 0, NULL, ERR_AR_OVERFLOW); - break; - case FP_NDENORM: /* pos/neg denormalized non-zero */ - case FP_PDENORM: - case FP_NNORM: /* pos/neg normalized non-zero */ - case FP_PNORM: - case FP_NZERO: /* pos/neg zero */ - case FP_PZERO: - break; - } -#else -#ifdef HAVE__FPCLASS - switch(_fpclass(f)) - { case _FPCLASS_SNAN: - case _FPCLASS_QNAN: - return PL_error(NULL, 0, NULL, ERR_AR_UNDEF); - break; - case _FPCLASS_NINF: - case _FPCLASS_PINF: - return PL_error(NULL, 0, NULL, ERR_AR_OVERFLOW); - break; - } -#else -#ifdef HAVE_ISNAN - if ( isnan(f) ) - return PL_error(NULL, 0, NULL, ERR_AR_UNDEF); -#endif -#ifdef HAVE_ISINF - if ( isinf(f) ) - return PL_error(NULL, 0, NULL, ERR_AR_OVERFLOW); -#endif -#endif /*HAVE__FPCLASS*/ -#endif /*HAVE_FPCLASS*/ -#endif /*HAVE_FPCLASSIFY*/ - return TRUE; -} - - -int -promoteToFloatNumber(Number n) -{ switch(n->type) - { case V_INTEGER: - n->value.f = (double)n->value.i; - n->type = V_FLOAT; - break; -#ifdef O_GMP - case V_MPZ: - { double val = mpz_get_d(n->value.mpz); - - if ( !check_float(val) ) - return FALSE; - - clearNumber(n); - n->value.f = val; - n->type = V_FLOAT; - break; - } - case V_MPQ: - { double val = mpq_get_d(n->value.mpq); - - if ( !check_float(val) ) - return FALSE; - - clearNumber(n); - n->value.f = val; - n->type = V_FLOAT; - break; - } -#endif - case V_FLOAT: - break; - } - - return TRUE; -} - - - -int -PL_get_list_nchars(term_t l, size_t *length, char **s, unsigned int flags) -{ Buffer b; - CVT_result result; - - if ( (b = codes_or_chars_to_buffer(l, flags, FALSE, &result)) ) - { char *r; - size_t len = entriesBuffer(b, char); - - if ( length ) - *length = len; - addBuffer(b, EOS, char); - r = baseBuffer(b, char); - - if ( flags & BUF_MALLOC ) - { *s = PL_malloc(len+1); - memcpy(*s, r, len+1); - unfindBuffer(flags); - } else - *s = r; - - succeed; - } - - fail; -} - -void * -PL_malloc_uncollectable(size_t sz) -{ - return malloc(sz); -} - -int -PL_get_list_chars(term_t l, char **s, unsigned flags) -{ return PL_get_list_nchars(l, NULL, s, flags); -} - - -int -PL_unify_wchars_diff(term_t t, term_t tail, int flags, - size_t len, const pl_wchar_t *s) -{ PL_chars_t text; - int rc; - - if ( len == (size_t)-1 ) - len = wcslen(s); - text.text.w = (pl_wchar_t *)s; - text.encoding = ENC_WCHAR; - text.storage = PL_CHARS_HEAP; - text.length = len; - text.canonical = FALSE; - - rc = PL_unify_text(t, tail, &text, flags); - PL_free_text(&text); - - return rc; -} - -int -PL_get_wchars(term_t l, size_t *length, pl_wchar_t **s, unsigned flags) -{ GET_LD - PL_chars_t text; - - if ( !PL_get_text(l, &text, flags) ) - return FALSE; - - PL_promote_text(&text); - PL_save_text(&text, flags); - - if ( length ) - *length = text.length; - *s = text.text.w; - - return TRUE; -} - - -int -PL_get_nchars(term_t l, size_t *length, char **s, unsigned flags) -{ GET_LD - PL_chars_t text; - - if ( !PL_get_text(l, &text, flags) ) - return FALSE; - - if ( PL_mb_text(&text, flags) ) - { PL_save_text(&text, flags); - - if ( length ) - *length = text.length; - *s = text.text.t; - - return TRUE; - } else - { PL_free_text(&text); - - return FALSE; - } -} - - -int -PL_get_chars(term_t t, char **s, unsigned flags) -{ return PL_get_nchars(t, NULL, s, flags); -} - -char * -Yap_TermToString(Term t, char *s, size_t sz, size_t *length, int *encoding, int flags) -{ - CACHE_REGS - Int l; - Int myASP = LCL0-ASP; - yhandle_t CurSlot = Yap_StartSlots(); - - Yap_StartSlots( ); - l = Yap_InitSlot(t ); - - { IOENC encodings[3]; - IOENC *enc; - char *r, buf[256]; - - encodings[0] = ENC_ISO_LATIN_1; - encodings[1] = ENC_WCHAR; - encodings[2] = ENC_UNKNOWN; - - for(enc = encodings; *enc != ENC_UNKNOWN; enc++) - { - int64_t size; - IOSTREAM *fd; - - if (s) { - r = s; - } else { - r = buf; - } - fd = Sopenmem(&r, &sz, "w"); - fd->encoding = *enc; - if ( PL_write_term(fd, l, 1200, flags) && - Sputcode(EOS, fd) >= 0 && - Sflush(fd) >= 0 ) - { *encoding = *enc; - size = Stell64(fd); - if ( *enc == ENC_ISO_LATIN_1 ) - { - *length = size-1; - } else - { - *length = (size/sizeof(pl_wchar_t))-1; - } - /* found, just check if using local space */ - if (r == buf) { - char *bf = malloc(*length+1); - if (!bf) { - Yap_CloseSlots(CurSlot); - ASP = LCL0-myASP; - return NULL; - } - strncpy(bf,buf,*length+1); - r = bf; - } - Yap_CloseSlots(CurSlot); - ASP = LCL0-myASP; - return r; - } else - { Sclose(fd); - } - } - /* failed */ - if ( r != s && r != buf ) { - Sfree(r); - } - } - Yap_CloseSlots(CurSlot); - ASP = LCL0-myASP; - return NULL; -} - -char * -Yap_HandleToString(yhandle_t l, size_t sz, size_t *length, int *encoding, int flags) -{ - - char *buf; - - - size_t size = 4096, total = size; - IOSTREAM *fd; - - total = size+1; - buf = malloc(total); - buf[0]='\0'; - while ( (fd = Sopenmem(&buf, &size, "w")) == NULL || - (( fd->encoding = ENC_UTF8) && FALSE) || - (PL_write_term(fd, l, 1200, flags) == 0) || - Sputcode(EOS, fd) < 0 || - Sflush(fd) < 0 ) /* failure */ - { - Sclose(fd); - if (!fd) - return NULL; - total += size; - buf = realloc(buf, total); - if (!buf) - return NULL; - Sclose(fd); - } - Sclose(fd); - /* success */ - return buf; -} - - -X_API int -PL_ttymode(IOSTREAM *s) -{ GET_LD - - if ( s == Suser_input ) - { if ( !truePrologFlag(PLFLAG_TTY_CONTROL) ) /* -tty in effect */ - return PL_NOTTY; - if ( ttymode == TTY_RAW ) /* get_single_char/1 and friends */ - return PL_RAWTTY; - return PL_COOKEDTTY; /* cooked (readline) input */ - } else - return PL_NOTTY; -} - -char * -PL_prompt_string(int fd) -{ if ( fd == 0 ) - { atom_t a = PrologPrompt(); /* TBD: deal with UTF-8 */ - - if ( a ) - { - Atom at = YAP_AtomFromSWIAtom(a); - if (!IsWideAtom(at) && !IsBlob(at)) { - return RepAtom(at)->StrOfAE; - } - } - } - - return NULL; -} - - -X_API void -PL_prompt_next(int fd) -{ GET_LD - - if ( fd == 0 ) - LD->prompt.next = TRUE; -} - -/* just a stub for now */ -int -warning(const char *fm, ...) -{ va_list args; - - va_start(args, fm); - fprintf(stderr,"warning: %s\n", fm); - va_end(args); - - return TRUE; -} - -#if defined(HAVE_SELECT) && !defined(__WINDOWS__) && !defined(__CYGWIN__) - -#ifdef __WINDOWS__ -#include -#endif - -static int -input_on_fd(int fd) -{ fd_set rfds; - struct timeval tv; - - FD_ZERO(&rfds); - FD_SET(fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - - return select(fd+1, &rfds, NULL, NULL, &tv) != 0; -} - -#else -#define input_on_fd(fd) 1 -#endif - - -PL_dispatch_hook_t -PL_dispatch_hook(PL_dispatch_hook_t hook) -{ PL_dispatch_hook_t old = GD->foreign.dispatch_events; - - GD->foreign.dispatch_events = hook; - return old; -} - - -X_API int -PL_dispatch(int fd, int wait) -{ if ( wait == PL_DISPATCH_INSTALLED ) - return GD->foreign.dispatch_events ? TRUE : FALSE; - - if ( GD->foreign.dispatch_events && PL_thread_self() == 1 ) - { if ( wait == PL_DISPATCH_WAIT ) - { while( !input_on_fd(fd) ) - { if ( PL_handle_signals() < 0 ) - return FALSE; - (*GD->foreign.dispatch_events)(fd); - } - } else - { (*GD->foreign.dispatch_events)(fd); - if ( PL_handle_signals() < 0 ) - return FALSE; - } - } - - return TRUE; -} - -/* SWI: int PL_get_arg(int index, term_t t, term_t a) - YAP: YAP_Term YAP_ArgOfTerm(int argno, YAP_Term t)*/ -X_API int _PL_get_arg__LD(int index, term_t ts, term_t a ARG_LD) -{ - REGS_FROM_LD - YAP_Term t = Yap_GetFromSlot(ts); - if ( !YAP_IsApplTerm(t) ) { - if (YAP_IsPairTerm(t)) { - if (index == 1){ - Yap_PutInSlot(a,HeadOfTerm(t) PASS_REGS); - return 1; - } else if (index == 2) { - Yap_PutInSlot(a,TailOfTerm(t) PASS_REGS); - return 1; - } - } - return 0; - } - 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) */ -int PL_get_atom__LD(term_t ts, atom_t *a ARG_LD) -{ - REGS_FROM_LD - YAP_Term t = Yap_GetFromSlot(ts); - if ( !IsAtomTerm(t)) - return 0; - *a = YAP_SWIAtomFromAtom(AtomOfTerm(t)); - return 1; -} - -X_API int PL_put_atom__LD(term_t t, atom_t a ARG_LD) -{ - REGS_FROM_LD - Yap_PutInSlot(t,MkAtomTerm(SWIAtomToAtom(a)) PASS_REGS); - return TRUE; -} - -int PL_put_term__LD(term_t d, term_t s ARG_LD) -{ - REGS_FROM_LD - Yap_PutInSlot(d,Yap_GetFromSlot(s) PASS_REGS); - return 1; -} - -term_t PL_new_term_ref__LD(ARG1_LD) -{ - REGS_FROM_LD - term_t to = Yap_NewSlots(1); - return to; -} - -int PL_is_atom__LD(term_t ts ARG_LD) -{ - REGS_FROM_LD - Term t = Yap_GetFromSlot(ts); - return !IsVarTerm(t) && IsAtomTerm(t); -} - -int PL_is_variable__LD(term_t ts ARG_LD) -{ - REGS_FROM_LD - YAP_Term t = Yap_GetFromSlot(ts); - return IsVarTerm(t); -} - -X_API int PL_unify__LD(term_t t1, term_t t2 ARG_LD) -{ - REGS_FROM_LD - return Yap_unify(Yap_GetFromSlot(t1),Yap_GetFromSlot(t2)); -} - -int PL_unify_atom__LD(term_t t, atom_t at ARG_LD) -{ - REGS_FROM_LD - YAP_Term cterm = MkAtomTerm(YAP_AtomFromSWIAtom(at)); - return YAP_Unify(Yap_GetFromSlot(t),cterm); -} - -/* SWI: int PL_unify_integer(term_t ?t, long n) - YAP long int unify(YAP_Term* a, Term* b) */ -int PL_unify_integer__LD(term_t t, intptr_t i ARG_LD) -{ - REGS_FROM_LD - Term iterm = MkIntegerTerm(i); - return Yap_unify(Yap_GetFromSlot(t),iterm); -} - -/* SWI: int PL_unify_integer(term_t ?t, long n) - YAP long int unify(YAP_Term* a, Term* b) */ -X_API int PL_unify_int64__LD(term_t t, int64_t n ARG_LD) -{ - REGS_FROM_LD -#if SIZEOF_INT_P==8 - Term iterm = MkIntegerTerm(n); - return Yap_unify(Yap_GetFromSlot(t),iterm); -#elif USE_GMP - YAP_Term iterm; - char s[64]; - MP_INT rop; - -#ifdef _WIN32 - snprintf(s, 64, "%I64d", (long long int)n); -#elif HAVE_SNPRINTF - snprintf(s, 64, "%lld", (long long int)n); -#else - sprintf(s, "%lld", (long long int)n); -#endif - mpz_init_set_str (&rop, s, 10); - iterm = YAP_MkBigNumTerm((void *)&rop); - return YAP_Unify(Yap_GetFromSlot(t),iterm); -#else - if ((long)n == n) - return PL_unify_integer(t, n); - // 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 - -} - -Procedure -resolveProcedure(functor_t f, Module module) -{ return RepPredProp(PredPropByFunc((Functor)f, MkAtomTerm(module->AtomOfME))); -} - - - -#ifdef _WIN32 - -#include - - - -#if O_PLMT -/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -PL_w32thread_raise(DWORD id, int sig) - Sets the signalled mask for a specific Win32 thread. This is a - partial work-around for the lack of proper asynchronous signal - handling in the Win32 platform. -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - -static int thread_highest_id = 0; - -X_API int -PL_w32thread_raise(DWORD id, int sig) -{ int i; - CACHE_REGS - - if ( sig < 0 || sig > MAXSIGNAL ) - return FALSE; /* illegal signal */ - - PL_LOCK(L_PLFLAG); - for(i = 0; i <= thread_highest_id; i++) - { PL_thread_info_t *info = GD->thread.threads[i]; - - if ( info && info->w32id == id && info->thread_data ) - { - Sfprintf(GLOBAL_stderr, "post %d %d\n\n\n",i, sig); - Yap_external_signal(i, sig); //raiseSignal(info->thread_data, sig); - if ( info->w32id ) - PostThreadMessage(info->w32id, WM_SIGNALLED, 0, 0L); - PL_UNLOCK(L_PLFLAG); - DEBUG(1, Sdprintf("Signalled %d to thread %d\n", sig, i)); - return TRUE; - } - } - PL_UNLOCK(L_PLFLAG); - - return FALSE; /* can't find thread */ -} - -#else - -int -PL_w32thread_raise(DWORD id, int sig) -{ return PL_raise(sig); -} - -#endif -#endif /*__WINDOWS__*/ - - -extern size_t PL_utf8_strlen(const char *s, size_t len); - -X_API size_t -PL_utf8_strlen(const char *s, size_t len) -{ return utf8_strlen(s, len); -} - -void -PL_add_to_protocol(const char *buf, size_t n) -{ protocol(buf, n); -} - -void -PL_license(const char *license, const char *module) -{ - /* unimplemented */ -} - - -bool -systemMode(bool accept) -{ - return FALSE; -} - -term_t -Yap_fetch_module_for_format(term_t args, YAP_Term *modp) { - YAP_Term nmod; - YAP_Term nt = YAP_StripModule(YAP_GetFromSlot(args), &nmod); - *modp = YAP_SetCurrentModule(nmod); - if (!nt) { - return args; - } - return YAP_InitSlot(nt); -} - -extern word pl_readline(term_t flag); - -word -pl_readline(term_t flag) -{ - return 0; -} - -static Term -StreamPosition(IOSTREAM *st) -{ GET_LD - Term t[4]; - if (!st) - st = Suser_input; - t[0] = MkIntegerTerm(st->posbuf.charno); - t[1] = MkIntegerTerm(st->posbuf.lineno); - t[2] = MkIntegerTerm(st->posbuf.linepos); - t[3] = MkIntegerTerm(st->posbuf.byteno); - return Yap_MkApplTerm(FunctorStreamPos,4,t); -} - -extern Term Yap_StreamPosition(IOSTREAM *st); - -Term -Yap_StreamPosition(IOSTREAM *st) -{ - return StreamPosition(st); -} - -IOSTREAM *Yap_Scurin(void); - -IOSTREAM * -Yap_Scurin(void) -{ - GET_LD - return Scurin; -} - -int -isWideAtom(atom_t atom) -{ - Atom a = (Atom)atomValue(atom); - return IsWideAtom(a); -} - -wchar_t * -nameOfWideAtom(atom_t atom) -{ - Atom a = (Atom)atomValue(atom); - return RepAtom(a)->WStrOfAE; -} - -access_level_t -setAccessLevel(access_level_t accept) -{ GET_LD - bool old; - - old = LD->prolog_flag.access_level; - LD->prolog_flag.access_level = accept; - return old; -} - -static bool -sysError(const char *fm, va_list args) -{ static int active = 0; - - switch ( active++ ) - { case 1: - PL_halt(3); - case 2: - abort(); - } - -#ifdef O_PLMT - Sfprintf(Serror, "[PROLOG SYSTEM ERROR: Thread %d\n\t", - PL_thread_self()); -#else - Sfprintf(Serror, "[PROLOG SYSTEM ERROR:\n\t"); -#endif - Svfprintf(Serror, fm, args); - -#if defined(O_DEBUGGER) - Sfprintf(Serror, "\n\nPROLOG STACK:\n"); - PL_backtrace(10, 0); - Sfprintf(Serror, "]\n"); -#endif /*O_DEBUGGER*/ - -#ifdef HAVE_GETPID - Sfprintf(Serror, "\n[pid=%d] Action? ", getpid()); -#else - Sfprintf(Serror, "\nAction? "); -#endif - Sflush(Soutput); - ResetTty(); - - PL_halt(3); - - return FALSE; /* not reached */ -} - - -bool -sysError(const char *fm, ...) -{ va_list args; - - va_start(args, fm); - vsysError(fm, args); - va_end(args); - - PL_fail; -} - -atom_t -accessLevel(void) -{ GET_LD - - switch(LD->prolog_flag.access_level) - { case ACCESS_LEVEL_USER: return ATOM_user; - case ACCESS_LEVEL_SYSTEM: return ATOM_system; - } - - return NULL_ATOM; -} - -#define SKIP_VERY_DEEP 1000000000L -#define SKIP_REDO_IN_SKIP (SKIP_VERY_DEEP-1) - -#define WFG_TRACE 0x01000 -#define WFG_TRACING 0x02000 -#define WFG_BACKTRACE 0x04000 -#define WFG_CHOICE 0x08000 - -#define TRACE_FIND_NONE 0 -#define TRACE_FIND_ANY 1 -#define TRACE_FIND_NAME 2 -#define TRACE_FIND_TERM 3 - -typedef struct find_data_tag -{ int port; /* Port to find */ - bool searching; /* Currently searching? */ - int type; /* TRACE_FIND_* */ - union - { atom_t name; /* Name of goal to find */ - struct - { functor_t functor; /* functor of the goal */ - Record term; /* Goal to find */ - } term; - } goal; -} find_data; - - -int -tracemode(debug_type doit, debug_type *old) -{ GET_LD - - if ( doit ) - { debugmode(DBG_ON, NULL); - doit = TRUE; - } - - if ( old ) - *old = debugstatus.tracing; - - if ( debugstatus.tracing != doit ) - { debugstatus.tracing = doit; - printMessage(ATOM_silent, - PL_FUNCTOR_CHARS, "trace_mode", 1, - PL_ATOM, doit ? ATOM_on : ATOM_off); - } - if ( doit ) /* make sure trace works inside skip */ - { debugstatus.skiplevel = SKIP_VERY_DEEP; - if ( LD->trace.find ) - LD->trace.find->searching = FALSE; - } - - succeed; -} - - -int -debugmode(debug_type doit, debug_type *old) -{ GET_LD - - if ( old ) - *old = debugstatus.debugging; - - if ( debugstatus.debugging != doit ) - { if ( doit ) - { debugstatus.skiplevel = SKIP_VERY_DEEP; - if ( doit == DBG_ALL ) - { doit = DBG_ON; - } - } - debugstatus.debugging = doit; - printMessage(ATOM_silent, - PL_FUNCTOR_CHARS, "debug_mode", 1, - PL_ATOM, doit ? ATOM_on : ATOM_off); - } - - succeed; -} - - -int -getAccessLevelMask(atom_t a, access_level_t *val) -{ if ( a == ATOM_user ) - *val = ACCESS_LEVEL_USER; - else if ( a == ATOM_system ) - *val = ACCESS_LEVEL_SYSTEM; - else - return FALSE; - - return TRUE; -} - - -int -currentBreakLevel(void) -{ GET_LD - - return LD->break_level; -} - -#if THREADS - -PL_thread_info_t * -SWI_thread_info(int tid, PL_thread_info_t *info) -{ - if (info) - GD->thread.threads[tid] = REMOTE_PL_local_data_p(tid)->thread.info = info; - return REMOTE_PL_local_data_p(tid)->thread.info; -} - -static int -recursive_attr(pthread_mutexattr_t **ap) -{ static int done; - static pthread_mutexattr_t attr; - int rc; - - if ( done ) - { *ap = &attr; - return 0; - } - - PL_LOCK(L_THREAD); - if ( done ) - { PL_UNLOCK(L_THREAD); - - *ap = &attr; - return 0; - } - if ( (rc=pthread_mutexattr_init(&attr)) ) - goto error; -#ifdef HAVE_PTHREAD_MUTEXATTR_SETTYPE - if ( (rc=pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE)) ) - goto error; -#else -#ifdef HAVE_PTHREAD_MUTEXATTR_SETKIND_NP - if ( (rc=pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP)) ) - goto error; -#endif -#endif - - done = TRUE; - PL_UNLOCK(L_THREAD); - *ap = &attr; - - return 0; - -error: - PL_UNLOCK(L_THREAD); - return rc; -} - -int -recursiveMutexInit(recursiveMutex *m) -{ - int rc; - pthread_mutexattr_t *attr; - - if ( (rc=recursive_attr(&attr)) ) - return rc; - - return pthread_mutex_init(m, attr); - -} - - - -#endif diff --git a/File b/File deleted file mode 100644 index e69de29bb..000000000 diff --git a/console/terminal/CMakeFiles/CMakeDirectoryInformation.cmake b/console/terminal/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index bab203dbc..000000000 --- a/console/terminal/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.3 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/vsc/git/yap-6.3") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/vsc/git/yap-6.3") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/console/terminal/CMakeFiles/progress.marks b/console/terminal/CMakeFiles/progress.marks deleted file mode 100644 index 59343b09e..000000000 --- a/console/terminal/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -53 diff --git a/console/terminal/CMakeFiles/qtyap.dir/DependInfo.cmake b/console/terminal/CMakeFiles/qtyap.dir/DependInfo.cmake deleted file mode 100644 index f1ef5d99e..000000000 --- a/console/terminal/CMakeFiles/qtyap.dir/DependInfo.cmake +++ /dev/null @@ -1,57 +0,0 @@ -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - "CXX" - ) -# The set of files for implicit dependencies of each language: -set(CMAKE_DEPENDS_CHECK_CXX - "/Users/vsc/git/yap-6.3/console/terminal/console.cpp" "/Users/vsc/git/yap-6.3/console/terminal/CMakeFiles/qtyap.dir/console.cpp.o" - "/Users/vsc/git/yap-6.3/console/terminal/main.cpp" "/Users/vsc/git/yap-6.3/console/terminal/CMakeFiles/qtyap.dir/main.cpp.o" - "/Users/vsc/git/yap-6.3/console/terminal/mainwindow.cpp" "/Users/vsc/git/yap-6.3/console/terminal/CMakeFiles/qtyap.dir/mainwindow.cpp.o" - "/Users/vsc/git/yap-6.3/console/terminal/qrc_terminal.cpp" "/Users/vsc/git/yap-6.3/console/terminal/CMakeFiles/qtyap.dir/qrc_terminal.cpp.o" - "/Users/vsc/git/yap-6.3/console/terminal/qtyap_automoc.cpp" "/Users/vsc/git/yap-6.3/console/terminal/CMakeFiles/qtyap.dir/qtyap_automoc.cpp.o" - "/Users/vsc/git/yap-6.3/console/terminal/settingsdialog.cpp" "/Users/vsc/git/yap-6.3/console/terminal/CMakeFiles/qtyap.dir/settingsdialog.cpp.o" - ) -set(CMAKE_CXX_COMPILER_ID "Clang") - -# Preprocessor definitions for this target. -set(CMAKE_TARGET_DEFINITIONS_CXX - "COROUTINING=1" - "DEBUG=1" - "DEPTH_LIMIT=1" - "HAVE_CONFIG_H" - "LOW_LEVEL_TRACER=1" - "QT_CORE_LIB" - "QT_GUI_LIB" - "QT_WIDGETS_LIB" - "RATIONAL_TREES=1" - "TABLING=1" - "USE_THREADEAD_CODE=1" - "_YAP_NOT_INSTALLED_=1" - ) - -# The include file search paths: -set(CMAKE_CXX_TARGET_INCLUDE_PATH - "console/terminal" - "." - "H" - "include" - "os" - "JIT/HPP" - "/usr/local/include" - "OPTYap" - "console/terminal/../../CXX" - "/Users/vsc/Qt/5.4/clang_64/lib/QtWidgets.framework" - "/Users/vsc/Qt/5.4/clang_64/lib/QtWidgets.framework/Headers" - "/Users/vsc/Qt/5.4/clang_64/lib/QtGui.framework" - "/Users/vsc/Qt/5.4/clang_64/lib/QtGui.framework/Headers" - "/Users/vsc/Qt/5.4/clang_64/lib/QtCore.framework" - "/Users/vsc/Qt/5.4/clang_64/lib/QtCore.framework/Headers" - "/Users/vsc/Qt/5.4/clang_64/mkspecs/macx-clang" - "/System/Library/Frameworks/OpenGL.framework/Headers" - ) - -# Targets to which this target links. -set(CMAKE_TARGET_LINKED_INFO_FILES - "/Users/vsc/git/yap-6.3/CXX/CMakeFiles/Yap++.dir/DependInfo.cmake" - "/Users/vsc/git/yap-6.3/CMakeFiles/libYap.dir/DependInfo.cmake" - ) diff --git a/console/terminal/CMakeFiles/qtyap.dir/link.txt b/console/terminal/CMakeFiles/qtyap.dir/link.txt deleted file mode 100644 index dd3095846..000000000 --- a/console/terminal/CMakeFiles/qtyap.dir/link.txt +++ /dev/null @@ -1 +0,0 @@ -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/qtyap.dir/console.cpp.o CMakeFiles/qtyap.dir/main.cpp.o CMakeFiles/qtyap.dir/mainwindow.cpp.o CMakeFiles/qtyap.dir/settingsdialog.cpp.o CMakeFiles/qtyap.dir/qrc_terminal.cpp.o CMakeFiles/qtyap.dir/qtyap_automoc.cpp.o -o qtyap ../../CXX/libYap++.dylib /Users/vsc/Qt/5.4/clang_64/lib/QtWidgets.framework/QtWidgets ../../libYap.6.3.4.dylib -ldl /usr/local/lib/libgmp.dylib /usr/local/opt/readline/lib/libreadline.dylib /usr/lib/libncurses.dylib /Users/vsc/Qt/5.4/clang_64/lib/QtGui.framework/QtGui /Users/vsc/Qt/5.4/clang_64/lib/QtCore.framework/QtCore -Wl,-rpath,/Users/vsc/git/yap-6.3/CXX -Wl,-rpath,/Users/vsc/git/yap-6.3 diff --git a/console/terminal/CMakeFiles/qtyap_automoc.dir/AutogenInfo.cmake b/console/terminal/CMakeFiles/qtyap_automoc.dir/AutogenInfo.cmake deleted file mode 100644 index 284e5c264..000000000 --- a/console/terminal/CMakeFiles/qtyap_automoc.dir/AutogenInfo.cmake +++ /dev/null @@ -1,26 +0,0 @@ -set(AM_SOURCES "/Users/vsc/git/yap-6.3/console/terminal/console.cpp;/Users/vsc/git/yap-6.3/console/terminal/main.cpp;/Users/vsc/git/yap-6.3/console/terminal/mainwindow.cpp;/Users/vsc/git/yap-6.3/console/terminal/settingsdialog.cpp" ) -set(AM_RCC_SOURCES ) -set(AM_RCC_INPUTS ) -set(AM_SKIP_MOC "" ) -set(AM_SKIP_UIC ) -set(AM_HEADERS "/Users/vsc/git/yap-6.3/console/terminal/console.h;/Users/vsc/git/yap-6.3/console/terminal/mainwindow.h;/Users/vsc/git/yap-6.3/console/terminal/settingsdialog.h" ) -set(AM_MOC_COMPILE_DEFINITIONS "COROUTINING=1;DEBUG=1;DEPTH_LIMIT=1;HAVE_CONFIG_H;LOW_LEVEL_TRACER=1;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;RATIONAL_TREES=1;TABLING=1;USE_THREADEAD_CODE=1;_YAP_NOT_INSTALLED_=1") -set(AM_MOC_INCLUDES "/Users/vsc/git/yap-6.3/console/terminal;/Users/vsc/git/yap-6.3;/Users/vsc/git/yap-6.3/H;/Users/vsc/git/yap-6.3/include;/Users/vsc/git/yap-6.3/os;/Users/vsc/git/yap-6.3/JIT/HPP;/usr/local/include;/Users/vsc/git/yap-6.3/OPTYap;/Users/vsc/git/yap-6.3/console/terminal/../../CXX;/Users/vsc/Qt/5.4/clang_64/lib/QtWidgets.framework;/Users/vsc/Qt/5.4/clang_64/lib/QtWidgets.framework/Headers;/Users/vsc/Qt/5.4/clang_64/lib/QtGui.framework;/Users/vsc/Qt/5.4/clang_64/lib/QtGui.framework/Headers;/Users/vsc/Qt/5.4/clang_64/lib/QtCore.framework;/Users/vsc/Qt/5.4/clang_64/lib/QtCore.framework/Headers;/Users/vsc/Qt/5.4/clang_64/mkspecs/macx-clang;/System/Library/Frameworks/OpenGL.framework/Headers") -set(AM_MOC_OPTIONS "") -set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "") -set(AM_CMAKE_BINARY_DIR "/Users/vsc/git/yap-6.3/") -set(AM_CMAKE_SOURCE_DIR "/Users/vsc/git/yap-6.3/") -set(AM_QT_MOC_EXECUTABLE "/Users/vsc/Qt/5.4/clang_64/bin/moc") -set(AM_QT_UIC_EXECUTABLE "") -set(AM_QT_RCC_EXECUTABLE "") -set(AM_CMAKE_CURRENT_SOURCE_DIR "/Users/vsc/git/yap-6.3/console/terminal/") -set(AM_CMAKE_CURRENT_BINARY_DIR "/Users/vsc/git/yap-6.3/console/terminal/") -set(AM_QT_VERSION_MAJOR "5") -set(AM_TARGET_NAME "qtyap_automoc") -set(AM_ORIGIN_TARGET_NAME "qtyap") -set(AM_RELAXED_MODE "FALSE") -set(AM_UIC_TARGET_OPTIONS ) -set(AM_UIC_OPTIONS_FILES ) -set(AM_UIC_OPTIONS_OPTIONS ) -set(AM_RCC_OPTIONS_FILES ) -set(AM_RCC_OPTIONS_OPTIONS ) diff --git a/console/terminal/CMakeFiles/qtyap_automoc.dir/DependInfo.cmake b/console/terminal/CMakeFiles/qtyap_automoc.dir/DependInfo.cmake deleted file mode 100644 index 86c3d8af6..000000000 --- a/console/terminal/CMakeFiles/qtyap_automoc.dir/DependInfo.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - ) -# The set of files for implicit dependencies of each language: - -# Targets to which this target links. -set(CMAKE_TARGET_LINKED_INFO_FILES - ) diff --git a/library/clp/CMakeFiles/CMakeDirectoryInformation.cmake b/library/clp/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index bab203dbc..000000000 --- a/library/clp/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.3 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/vsc/git/yap-6.3") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/vsc/git/yap-6.3") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/library/clp/CMakeFiles/progress.marks b/library/clp/CMakeFiles/progress.marks deleted file mode 100644 index 573541ac9..000000000 --- a/library/clp/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/library/dialect/CMakeFiles/CMakeDirectoryInformation.cmake b/library/dialect/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index bab203dbc..000000000 --- a/library/dialect/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.3 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/vsc/git/yap-6.3") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/vsc/git/yap-6.3") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/library/dialect/CMakeFiles/dialects.dir/DependInfo.cmake b/library/dialect/CMakeFiles/dialects.dir/DependInfo.cmake deleted file mode 100644 index 86c3d8af6..000000000 --- a/library/dialect/CMakeFiles/dialects.dir/DependInfo.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - ) -# The set of files for implicit dependencies of each language: - -# Targets to which this target links. -set(CMAKE_TARGET_LINKED_INFO_FILES - ) diff --git a/library/dialect/CMakeFiles/progress.marks b/library/dialect/CMakeFiles/progress.marks deleted file mode 100644 index 573541ac9..000000000 --- a/library/dialect/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/library/matlab/CMakeFiles/CMakeDirectoryInformation.cmake b/library/matlab/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index bab203dbc..000000000 --- a/library/matlab/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.3 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/vsc/git/yap-6.3") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/vsc/git/yap-6.3") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/library/matlab/CMakeFiles/progress.marks b/library/matlab/CMakeFiles/progress.marks deleted file mode 100644 index 573541ac9..000000000 --- a/library/matlab/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/library/mpi/CMakeFiles/CMakeDirectoryInformation.cmake b/library/mpi/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index bab203dbc..000000000 --- a/library/mpi/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.3 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/vsc/git/yap-6.3") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/vsc/git/yap-6.3") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/library/mpi/CMakeFiles/progress.marks b/library/mpi/CMakeFiles/progress.marks deleted file mode 100644 index 573541ac9..000000000 --- a/library/mpi/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/packages/CLPBN/CMakeFiles/CMakeDirectoryInformation.cmake b/packages/CLPBN/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index bab203dbc..000000000 --- a/packages/CLPBN/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.3 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/vsc/git/yap-6.3") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/vsc/git/yap-6.3") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/packages/CLPBN/CMakeFiles/progress.marks b/packages/CLPBN/CMakeFiles/progress.marks deleted file mode 100644 index 573541ac9..000000000 --- a/packages/CLPBN/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/packages/ProbLog/CMakeFiles/CMakeDirectoryInformation.cmake b/packages/ProbLog/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index bab203dbc..000000000 --- a/packages/ProbLog/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.3 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/vsc/git/yap-6.3") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/vsc/git/yap-6.3") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/packages/ProbLog/CMakeFiles/progress.marks b/packages/ProbLog/CMakeFiles/progress.marks deleted file mode 100644 index 573541ac9..000000000 --- a/packages/ProbLog/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/packages/jpl/src/c/jpl.c b/packages/jpl/src/c/jpl.c index e7501f4ad..c0ec1e5d9 100755 --- a/packages/jpl/src/c/jpl.c +++ b/packages/jpl/src/c/jpl.c @@ -49,8 +49,8 @@ refactoring (trivial): #define JPL_C_LIB_VERSION_STATUS "alpha" /*#define DEBUG(n, g) ((void)0) */ -#define DEBUG_LEVEL 3 -#define DEBUG(n, g) ( n >= DEBUG_LEVEL ? g : (void)0 ) +#define DEBUG_LEVEL 4 +#define JPL_DEBUG(n, g) ( n >= DEBUG_LEVEL ? g : (void)0 ) /* disable type-of-ref caching (at least until GC issues are resolved) */ #define JPL_CACHE_TYPE_OF_REF FALSE @@ -642,7 +642,7 @@ jni_env(void) /* economically gets a JNIEnv pointer, valid for this thread */ { case JNI_OK: return env; case JNI_EDETACHED: - DEBUG(2, Sdprintf( "[JPL: jni_env() calls AttachCurrentThread]\n")); + JPL_DEBUG(2, Sdprintf( "[JPL: jni_env() calls AttachCurrentThread]\n")); return (*jvm)->AttachCurrentThread(jvm, (void**)&env, NULL) == 0 ? env : NULL; default: /* error */ return NULL; @@ -851,7 +851,7 @@ jni_free_iref( /* called indirectly from agc hook when a possible iref is u { if ( !jni_tidy_iref_type_cache(iref) ) { - DEBUG(0, Sdprintf( "[JPL: jni_tidy_iref_type_cache(%u) failed]\n", iref)); + JPL_DEBUG(0, Sdprintf( "[JPL: jni_tidy_iref_type_cache(%lu) failed]\n", iref)); } hr_del_count++; return TRUE; @@ -1045,12 +1045,12 @@ jni_atom_freed( sprintf( cs, IREF_FMT, (IREF_INTTYPE)iref); /* reconstruct digits part of tag in cs */ if ( strcmp(cp,cs) != 0 ) /* original digits != reconstructed digits? */ { - DEBUG(0, Sdprintf( "[JPL: garbage-collected tag '%s'=%u is bogus (not canonical)]\n", cp, iref)); + JPL_DEBUG(0, Sdprintf( "[JPL: garbage-collected tag '%s'=%lu is bogus (not canonical)]\n", cp, iref)); } else if ( !jni_free_iref(env,iref) ) /* free it (iff it's in the hashedref table) */ { - DEBUG(0, Sdprintf( "[JPL: garbage-collected tag '%s' is bogus (not in HashedRefs)]\n", cp)); + JPL_DEBUG(0, Sdprintf( "[JPL: garbage-collected tag '%s' is bogus (not in HashedRefs)]\n", cp)); } } else @@ -1343,7 +1343,7 @@ jni_hr_del( HrEntry *ep; /* pointer to a HashedRef table entry */ HrEntry **epp; /* pointer to ep's handle, in case it needs updating */ - DEBUG(1, Sdprintf( "[removing possible object reference %u]\n", iref)); + JPL_DEBUG(1, Sdprintf( "[removing possible object reference %u]\n", iref)); for ( index=0 ; indexlength ; index++ ) /* for each slot */ { for ( epp=&(hr_table->slots[index]), ep=*epp ; ep!=NULL ; epp=&(ep->next), ep=*epp ) @@ -1354,12 +1354,12 @@ jni_hr_del( *epp = ep->next; /* bypass the entry */ free( ep); /* free the now-redundant space */ hr_table->count--; /* adjust table's entry count */ - DEBUG(1, Sdprintf( "[found & removed hashtable entry for object reference %u]\n", iref)); + JPL_DEBUG(1, Sdprintf( "[found & removed hashtable entry for object reference %lu]\n", iref)); return TRUE; /* entry found and removed */ } } } - DEBUG(1, Sdprintf("[JPL: failed to find hashtable entry for (presumably bogus) object reference %u]\n", iref)); + JPL_DEBUG(1, Sdprintf("[JPL: failed to find hashtable entry for (presumably bogus) object reference %lu]\n", iref)); return FALSE; } @@ -1828,7 +1828,7 @@ jni_create_jvm_c( int optn = 0; JNIEnv *env; - DEBUG(1, Sdprintf( "[creating JVM with 'java.class.path=%s']\n", classpath)); + JPL_DEBUG(1, Sdprintf( "[creating JVM with 'java.class.path=%s']\n", classpath)); vm_args.version = JNI_VERSION_1_2; /* "Java 1.2 please" */ if ( classpath ) { @@ -1906,7 +1906,7 @@ jni_create_jvm( int r1; int r2; - DEBUG(1, Sdprintf("[JPL: checking for Java VM...]\n")); + JPL_DEBUG(1, Sdprintf("[JPL: checking for Java VM...]\n")); return ( jvm != NULL ? 1 /* already initialised */ @@ -1915,8 +1915,8 @@ jni_create_jvm( : ( (r2=jni_init()) < 0 ? r2 /* err code from jni_init() */ : ( r1 == 0 /* success code from JVM-specific routine */ - ? ( DEBUG(0, Sdprintf("[JPL: Java VM created]\n")), r1) - : ( DEBUG(0, Sdprintf("[JPL: Java VM found]\n")), r1) + ? ( JPL_DEBUG(0, Sdprintf("[JPL: Java VM created]\n")), r1) + : ( JPL_DEBUG(0, Sdprintf("[JPL: Java VM found]\n")), r1) ) ) ) @@ -1948,7 +1948,7 @@ jni_create_default_jvm(void) char *cp = getenv("CLASSPATH"); #endif - DEBUG(0, Sdprintf("jni_create_default_jvm(): cp=%s\n", cp)); + JPL_DEBUG(0, Sdprintf("jni_create_default_jvm(): cp=%s\n", cp)); if ( (r=jni_create_jvm(cp)) < 0 ) { @@ -3303,7 +3303,7 @@ jpl_do_jpl_init( /* to be called once only, after PL init, before any JPL calls if ( jpl_status != JPL_INIT_RAW ) /* jpl init already attempted? (shouldn't happen) */ { - DEBUG(1, Sdprintf( "[JPL: jpl_do_jpl_init() called AGAIN (skipping...)]\n")); + JPL_DEBUG(1, Sdprintf( "[JPL: jpl_do_jpl_init() called AGAIN (skipping...)]\n")); return TRUE; } @@ -3421,7 +3421,7 @@ jpl_do_jpl_init( /* to be called once only, after PL init, before any JPL calls goto err; } - DEBUG(1, Sdprintf( "[jpl_do_jpl_init() sets jpl_status = JPL_INIT_PVM_MAYBE, returns TRUE]\n")); + JPL_DEBUG(1, Sdprintf( "[jpl_do_jpl_init() sets jpl_status = JPL_INIT_PVM_MAYBE, returns TRUE]\n")); jpl_status = JPL_INIT_PVM_MAYBE; return TRUE; @@ -3527,12 +3527,12 @@ jpl_test_pvm_init( if ( !PL_is_initialised(&argc,&argv) ) /* PVM not ready? */ { /* jpl_status remains = JPL_INIT_PVM_MAYBE */ - DEBUG(1, Sdprintf( "[pl_test_pvm_init(): PL is not yet initialised: returning FALSE]\n")); + JPL_DEBUG(1, Sdprintf( "[pl_test_pvm_init(): PL is not yet initialised: returning FALSE]\n")); return FALSE; /* already-active Prolog VM not found (NB not an exceptional condition) */ } else { - DEBUG(1, Sdprintf( "[pl_test_pvm_init(): PL is already initialised: proceeding to jpl_post_pvm_init()]\n")); + JPL_DEBUG(1, Sdprintf( "[pl_test_pvm_init(): PL is already initialised: proceeding to jpl_post_pvm_init()]\n")); return jpl_post_pvm_init(env,argc,argv); /* TRUE, FALSE or exception */ } } @@ -3594,10 +3594,10 @@ jpl_do_pvm_init( cp = (char*)(*env)->GetStringUTFChars(env,arg,0); argv[i] = (char*)malloc(strlen(cp)+1); strcpy( argv[i], cp); - DEBUG(1, Sdprintf( " argv[%d] = %s\n", i, argv[i])); + JPL_DEBUG(1, Sdprintf( " argv[%d] = %s\n", i, argv[i])); (*env)->ReleaseStringUTFChars( env, arg, cp); } - DEBUG(1, Sdprintf( " argv[%d] = NULL\n", argc)); + JPL_DEBUG(1, Sdprintf( " argv[%d] = NULL\n", argc)); argv[argc] = NULL; if ( !PL_initialise(argc,(char**)argv) ) /* NB not (const char**) */ { @@ -4352,14 +4352,14 @@ JNIEXPORT int JNICALL } rc = current_pool_engine_handle(&engine); - DEBUG(0, Sdprintf( "attach_engine(): current_engine=%p, thread_self=%d, pool_id=%d\n", engine, PL_thread_self(), rc)); + JPL_DEBUG(0, Sdprintf( "attach_engine(): current_engine=%p, thread_self=%d, pool_id=%d\n", engine, PL_thread_self(), rc)); if ( !getPointerValue(env,jengine,(pointer*)&engine) ) /* checks jengine isn't null */ { return -3; /* null engine holder */ } - DEBUG(0, Sdprintf( "attach_engine(): new_engine=%p\n", engine)); + JPL_DEBUG(0, Sdprintf( "attach_engine(): new_engine=%p\n", engine)); if ( (rc=PL_set_engine(engine,NULL)) == PL_ENGINE_SET ) { @@ -4387,13 +4387,13 @@ JNIEXPORT void JNICALL { qid_t qid; - DEBUG(1, Sdprintf( ">close_query(env=%lu,jProlog=%lu,jquid=%u)...\n", (long)env, (long)jProlog, (long)jqid)); + JPL_DEBUG(1, Sdprintf( ">close_query(env=%lu,jProlog=%lu,jquid=%lu)...\n", (long)env, (long)jProlog, (long)jqid)); if ( jpl_ensure_pvm_init(env) && getUIntPtrValue(env,jqid,(uintptr_t *)&qid) /* checks that jqid != NULL */ ) { PL_close_query( qid); /* void */ - DEBUG(1, Sdprintf( " ok: PL_close_query(%lu)\n", (long)qid)); + JPL_DEBUG(1, Sdprintf( " ok: PL_close_query(%lu)\n", (long)qid)); } } @@ -4414,13 +4414,13 @@ JNIEXPORT jint JNICALL /* returns -1, 0 or 1 (or -2 for error) */ term_t term1; term_t term2; - DEBUG(1, Sdprintf( ">compare(term1=%lu,term2=%lu)\n", (long)jterm1, (long)jterm2)); + JPL_DEBUG(1, Sdprintf( ">compare(term1=%lu,term2=%lu)\n", (long)jterm1, (long)jterm2)); if ( jpl_ensure_pvm_init(env) && getTermTValue(env,jterm1,&term1) /* checks jterm1 isn't null */ && getTermTValue(env,jterm2,&term2) /* checks jterm2 isn't null */ ) { - DEBUG(1, Sdprintf( "> PL_compare( %u, %u)", term1, term2)); + JPL_DEBUG(1, Sdprintf( "> PL_compare( %lu, %lu)", term1, term2)); return PL_compare(term1,term2); /* returns -1, 0 or 1 */ } else @@ -4554,21 +4554,21 @@ JNIEXPORT jobject JNICALL term_t term; jobject term_t; /* return value */ - DEBUG(1, Sdprintf( ">exception(jqid=%lu)\n", (long)jqid)); + JPL_DEBUG(1, Sdprintf( ">exception(jqid=%lu)\n", (long)jqid)); return ( jpl_ensure_pvm_init(env) - && ( DEBUG(1, Sdprintf( " ok: jpl_ensure_pvm_init(env)\n")), TRUE ) + && ( JPL_DEBUG(1, Sdprintf( " ok: jpl_ensure_pvm_init(env)\n")), TRUE ) /* && jqid != NULL // redundant */ - && ( DEBUG(1, Sdprintf( " ok: jqid != NULL\n")), TRUE ) + && ( JPL_DEBUG(1, Sdprintf( " ok: jqid != NULL\n")), TRUE ) && getUIntPtrValue(env,jqid,(uintptr_t *)&qid) /* checks that jqid isn't null */ - && ( DEBUG(1, Sdprintf( " ok: getUIntPtrValue(env,jqid,&qid)\n")), TRUE ) + && ( JPL_DEBUG(1, Sdprintf( " ok: getUIntPtrValue(env,jqid,&qid)\n")), TRUE ) && ( (term=PL_exception(qid)) , TRUE ) /* we'll build a term_t object regardless */ - && ( DEBUG(1, Sdprintf(" ok: ( (term=PL_exception(qid)), TRUE)\n")), TRUE ) + && ( JPL_DEBUG(1, Sdprintf(" ok: ( (term=PL_exception(qid)), TRUE)\n")), TRUE ) && (term_t=(*env)->AllocObject(env,jTermT_c)) != NULL - && ( DEBUG(1, Sdprintf( " ok: (term_t=(*env)->AllocObject(env,jTermT_c)) != NULL\n")), TRUE ) + && ( JPL_DEBUG(1, Sdprintf( " ok: (term_t=(*env)->AllocObject(env,jTermT_c)) != NULL\n")), TRUE ) && setTermTValue(env,term_t,term) - && ( DEBUG(1, Sdprintf( " ok: setTermTValue(env,term_t,term)\n")), TRUE ) + && ( JPL_DEBUG(1, Sdprintf( " ok: setTermTValue(env,term_t,term)\n")), TRUE ) ? ( - DEBUG(1, Sdprintf(" =%lu\n",(long)term_t)), + JPL_DEBUG(1, Sdprintf(" =%lu\n",(long)term_t)), term_t ) : NULL /* oughta diagnose failure? */ @@ -4876,14 +4876,14 @@ JNIEXPORT jobject JNICALL jobject rval; term_t trefs; - DEBUG(1, Sdprintf( ">new_term_refs(env=%lu,jProlog=%lu,jn=%lu)...\n", (long)env, (long)jProlog, (long)jn)); + JPL_DEBUG(1, Sdprintf( ">new_term_refs(env=%lu,jProlog=%lu,jn=%lu)...\n", (long)env, (long)jProlog, (long)jn)); return ( jpl_ensure_pvm_init(env) && jn >= 0 /* I hope PL_new_term_refs(0) is defined [ISSUE] */ && (rval=(*env)->AllocObject(env,jTermT_c)) != NULL && ( trefs=PL_new_term_refs((int)jn), TRUE ) && setUIntPtrValue(env,rval,trefs) - && ( DEBUG(1, Sdprintf(" ok: stashed trefs=%ld into new term_t object\n",(long)trefs)), TRUE ) + && ( JPL_DEBUG(1, Sdprintf(" ok: stashed trefs=%ld into new term_t object\n",(long)trefs)), TRUE ) ? rval : NULL ) @@ -4906,14 +4906,14 @@ JNIEXPORT jboolean JNICALL qid_t qid; int rval; /* for boolean return value */ - DEBUG(1, Sdprintf( ">next_solution(env=%lu,jProlog=%lu,jqid=%lu)...\n", (long)env, (long)jProlog, (long)jqid)); + JPL_DEBUG(1, Sdprintf( ">next_solution(env=%lu,jProlog=%lu,jqid=%lu)...\n", (long)env, (long)jProlog, (long)jqid)); return jpl_ensure_pvm_init(env) && getUIntPtrValue(env,jqid,(uintptr_t *)&qid) /* checks that jqid isn't null */ - && ( DEBUG(1, Sdprintf( " ok: getUIntPtrValue(env,jqid,&qid(%lu))\n",(long)qid)), TRUE ) + && ( JPL_DEBUG(1, Sdprintf( " ok: getUIntPtrValue(env,jqid,&qid(%lu))\n",(long)qid)), TRUE ) && ( rval=PL_next_solution(qid), TRUE ) /* can call this until it returns FALSE */ - && ( DEBUG(1, Sdprintf( " ok: PL_next_solution(qid=%lu)=%u\n",(long)qid,rval)), TRUE ) + && ( JPL_DEBUG(1, Sdprintf( " ok: PL_next_solution(qid=%lu)=%u\n",(long)qid,rval)), TRUE ) && ( - DEBUG(1, Sdprintf(" =%lu\n",(long)rval)), + JPL_DEBUG(1, Sdprintf(" =%lu\n",(long)rval)), rval ) ; @@ -4984,23 +4984,23 @@ Java_jpl_fli_Prolog_open_1query( qid_t qid; jobject jqid; /* for returned new QidT object */ - DEBUG(1, Sdprintf( ">open_query(env=%lu,jProlog=%lu,jmodule=%lu,jflags=%lu,jpredicate=%lu,jterm0=%lu)...\n", + JPL_DEBUG(1, Sdprintf( ">open_query(env=%lu,jProlog=%lu,jmodule=%lu,jflags=%lu,jpredicate=%lu,jterm0=%lu)...\n", (long)env, (long)jProlog, (long)jmodule, (long)jflags, (long)jpredicate, (long)jterm0)); return ( jpl_ensure_pvm_init(env) && ( getPointerValue(env,jmodule,(pointer*)&module) , TRUE ) /* NULL module is OK below... */ - && ( DEBUG(1, Sdprintf(" ok: getPointerValue(env,jmodule=%lu,&(pointer)module=%lu)\n",(long)jmodule,(long)module)), TRUE ) + && ( JPL_DEBUG(1, Sdprintf(" ok: getPointerValue(env,jmodule=%lu,&(pointer)module=%lu)\n",(long)jmodule,(long)module)), TRUE ) && getPointerValue(env,jpredicate,(pointer*)&predicate) /* checks that jpredicate != NULL */ - && ( DEBUG(1, Sdprintf(" ok: getPointerValue(env,jpredicate=%lu,&(pointer)predicate=%lu)\n",(long)jpredicate,(long)predicate)), TRUE ) + && ( JPL_DEBUG(1, Sdprintf(" ok: getPointerValue(env,jpredicate=%lu,&(pointer)predicate=%lu)\n",(long)jpredicate,(long)predicate)), TRUE ) && getTermTValue(env,jterm0,&term0) /* jterm0!=NULL */ && ( (qid=PL_open_query(module,jflags,predicate,term0)) , TRUE ) /* NULL module is OK (?) [ISSUE] */ - && ( DEBUG(1, Sdprintf(" ok: PL_open_query(module=%lu,jflags=%u,predicate=%lu,term0=%lu)=%lu\n",(long)module,jflags,(long)predicate,(long)term0,(long)qid)), TRUE ) + && ( JPL_DEBUG(1, Sdprintf(" ok: PL_open_query(module=%lu,jflags=%u,predicate=%lu,term0=%lu)=%lu\n",(long)module,jflags,(long)predicate,(long)term0,(long)qid)), TRUE ) && (jqid=(*env)->AllocObject(env,jQidT_c)) != NULL - && ( DEBUG(1, Sdprintf(" ok: AllocObject(env,jQidT_c)=%lu\n",(long)jqid)), TRUE ) + && ( JPL_DEBUG(1, Sdprintf(" ok: AllocObject(env,jQidT_c)=%lu\n",(long)jqid)), TRUE ) && setUIntPtrValue(env,jqid,(uintptr_t)qid) - && ( DEBUG(1, Sdprintf(" ok: setUIntPtrValue(env,%lu,%lu)\n",(long)jqid,(long)qid)), TRUE ) - && ( DEBUG(1, Sdprintf("[open_query module = %s]\n", (module==NULL?"(null)":PL_atom_chars(PL_module_name(module))))), TRUE ) + && ( JPL_DEBUG(1, Sdprintf(" ok: setUIntPtrValue(env,%lu,%lu)\n",(long)jqid,(long)qid)), TRUE ) + && ( JPL_DEBUG(1, Sdprintf("[open_query module = %s]\n", (module==NULL?"(null)":PL_atom_chars(PL_module_name(module))))), TRUE ) ? ( - DEBUG(1, Sdprintf(" =%lu\n",(long)jqid)), + JPL_DEBUG(1, Sdprintf(" =%lu\n",(long)jqid)), jqid ) : NULL /* oughta diagnose failure? raise JPL exception? */ @@ -5030,7 +5030,7 @@ JNIEXPORT jobject JNICALL predicate_t predicate; jobject rval; - DEBUG(1, Sdprintf(">predicate(env=%lu,jProlog=%lu,jname=%lu,jarity=%lu,jmodule=%lu)...\n", + JPL_DEBUG(1, Sdprintf(">predicate(env=%lu,jProlog=%lu,jname=%lu,jarity=%lu,jmodule=%lu)...\n", (long)env, (long)jProlog, (long)jname, (long)jarity, (long)jmodule)); return ( jpl_ensure_pvm_init(env) && jni_String_to_atom(env,jname,&pname) /* checks that jname isn't NULL */ @@ -5045,7 +5045,7 @@ JNIEXPORT jobject JNICALL && (rval=(*env)->AllocObject(env,jPredicateT_c)) != NULL && setPointerValue(env,rval,(pointer)predicate) ? ( - DEBUG(1, Sdprintf("[predicate() module=%s\n",(jmodule==NULL?"(null)":PL_atom_chars(mname)))), + JPL_DEBUG(1, Sdprintf("[predicate() module=%s\n",(jmodule==NULL?"(null)":PL_atom_chars(mname)))), rval ) : NULL /* oughta warn of failure? */ @@ -5263,14 +5263,14 @@ JNIEXPORT void JNICALL { atom_t atom; - DEBUG(1, Sdprintf( ">unregister_atom(env=%lu,jProlog=%lu,jatom=%u)...\n", (long)env, (long)jProlog, (long)jatom)); + JPL_DEBUG(1, Sdprintf( "unregister_atom(env=%lu,jProlog=%lu,jatom=%lu)...\n", (long)env, (long)jProlog, (long)jatom)); if ( jpl_ensure_pvm_init(env) && getAtomTValue(env,jatom,&atom) /* checks that jatom isn't null */ ) { PL_unregister_atom( atom); /* void */ - DEBUG(1, Sdprintf( " ok: PL_unregister_atom(%lu)\n", (long)atom)); + JPL_DEBUG(1, Sdprintf( " ok: PL_unregister_atom(%lu)\n", (long)atom)); } } @@ -5355,7 +5355,7 @@ create_pool_engines() { int i; - DEBUG(1, Sdprintf( "JPL creating engine pool:\n")); + JPL_DEBUG(1, Sdprintf( "JPL creating engine pool:\n")); if ( (engines=malloc(sizeof(PL_engine_t)*JPL_MAX_POOL_ENGINES)) == NULL ) { return -1; /* malloc failed */ @@ -5363,10 +5363,10 @@ create_pool_engines() engines_allocated = JPL_MAX_POOL_ENGINES; memset(engines, 0, sizeof(PL_engine_t)*engines_allocated); - DEBUG(1, Sdprintf( "JPL stashing default engine as [0]\n")); + JPL_DEBUG(1, Sdprintf( "JPL stashing default engine as [0]\n")); PL_set_engine( PL_ENGINE_CURRENT, &engines[0]); - DEBUG(1, Sdprintf( "JPL detaching default engine\n")); + JPL_DEBUG(1, Sdprintf( "JPL detaching default engine\n")); /* PL_set_engine( NULL, NULL); */ for ( i=1 ; iAllocObject(env,jEngineT_c)) != NULL && setPointerValue(env,rval,(pointer)engines[i]) @@ -5425,7 +5425,7 @@ Java_jpl_fli_Prolog_attach_1pool_1engine( } if ( rc != PL_ENGINE_INUSE ) { - DEBUG(1, Sdprintf( "JPL PL_set_engine fails with %d\n", rc)); + JPL_DEBUG(1, Sdprintf( "JPL PL_set_engine fails with %d\n", rc)); pthread_mutex_unlock( &engines_mutex); return NULL; /* bad engine status: oughta throw exception */ } @@ -5433,7 +5433,7 @@ Java_jpl_fli_Prolog_attach_1pool_1engine( for ( i=0 ; i 0 ) - { DEBUG(1, Sdprintf("JPL releasing engine[%d]=%p\n", i, e)); + { JPL_DEBUG(1, Sdprintf("JPL releasing engine[%d]=%p\n", i, e)); PL_set_engine(NULL, NULL); pthread_cond_signal(&engines_cond); /* alert waiters */ } @@ -5692,26 +5692,26 @@ static foreign_t } if ( jvm_dia == jvm_ia ) /* jvm_dia still points to the built-in (non-malloc-ed) default default opts */ { - DEBUG(1, Sdprintf("JPL not freeing original (static) JVM opts; replacing with malloc-ed [%d+1]\n", n)); + JPL_DEBUG(1, Sdprintf("JPL not freeing original (static) JVM opts; replacing with malloc-ed [%d+1]\n", n)); jvm_dia = (char**)malloc((n+1)*sizeof(char**)); } else { - DEBUG(1, Sdprintf("JPL has malloc-ed JVM opt[?] (of malloc-ed strings)\n")); + JPL_DEBUG(1, Sdprintf("JPL has malloc-ed JVM opt[?] (of malloc-ed strings)\n")); for ( i = 0; jvm_dia[i] != NULL && i < 100; i++ ) /* a malloc-ed array always has NULL in its last element */ { - DEBUG(1, Sdprintf("JPL freeing malloc-ed JVM opt '%s'\n", jvm_dia[i])); + JPL_DEBUG(1, Sdprintf("JPL freeing malloc-ed JVM opt '%s'\n", jvm_dia[i])); free(jvm_dia[i]); /* a malloc-ed array's elements always point to malloc-ed strings, which we should free */ } if ( n != i ) /* we need an array of a different length */ { - DEBUG(1, Sdprintf("JPL needs different qty JVM opts so freeing old [%d] and malloc-ing new [%d]\n", i, n)); + JPL_DEBUG(1, Sdprintf("JPL needs different qty JVM opts so freeing old [%d] and malloc-ing new [%d]\n", i, n)); free(jvm_dia); jvm_dia = (char**)malloc((n+1)*sizeof(char**)); } else { - DEBUG(1, Sdprintf("JPL needs [%d] JVM opts as before\n")); + JPL_DEBUG(1, Sdprintf("JPL needs [%d] JVM opts as before\n")); } } head = PL_new_term_ref(); /* variable for the elements */ @@ -5720,7 +5720,7 @@ static foreign_t { if ( PL_get_atom_chars(head,&s) ) { - DEBUG(1, Sdprintf("JPL malloc-ing space for '%s'\n", s)); + JPL_DEBUG(1, Sdprintf("JPL malloc-ing space for '%s'\n", s)); jvm_dia[i] = (char*)malloc(strlen(s)+1); strcpy(jvm_dia[i],s); } diff --git a/packages/real/real.c b/packages/real/real.c index a8dfe6538..c35c955cd 100644 --- a/packages/real/real.c +++ b/packages/real/real.c @@ -2291,7 +2291,7 @@ execute_R(term_t rvar, term_t value) PROTECT_AND_COUNT( sexp = term_to_sexp(value, true) ); //PROTECT_AND_COUNT( sexp = protected_tryEval(sexp, R_GlobalEnv, &hadError) ); - if (sexp == R_UnboundValue || Rf_isNull(sExp)) + if (sexp == R_UnboundValue || Rf_isNull(sexp)) { UNPROTECT( nprotect ); return false; diff --git a/packages/udi/LOG b/packages/udi/LOG deleted file mode 100644 index dedd1f5b8..000000000 --- a/packages/udi/LOG +++ /dev/null @@ -1,34 +0,0 @@ -Doxygen version 1.8.8 -Copyright Dimitri van Heesch 1997-2014 - -You can use doxygen in a number of ways: - -1) Use doxygen to generate a template configuration file: - /Users/vsc/bin/doxygen [-s] -g [configName] - - If - is used for configName doxygen will write to standard output. - -2) Use doxygen to update an old configuration file: - /Users/vsc/bin/doxygen [-s] -u [configName] - -3) Use doxygen to generate documentation using an existing configuration file: - /Users/vsc/bin/doxygen [configName] - - If - is used for configName doxygen will read from standard input. - -4) Use doxygen to generate a template file controlling the layout of the - generated documentation: - /Users/vsc/bin/doxygen -l layoutFileName.xml - -5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex. - RTF: /Users/vsc/bin/doxygen -w rtf styleSheetFile - HTML: /Users/vsc/bin/doxygen -w html headerFile footerFile styleSheetFile [configFile] - LaTeX: /Users/vsc/bin/doxygen -w latex headerFile footerFile styleSheetFile [configFile] - -6) Use doxygen to generate a rtf extensions file - RTF: /Users/vsc/bin/doxygen -e rtf extensionsFile - -If -s is specified the comments of the configuration items in the config file will be omitted. -If configName is omitted `Doxyfile' will be used as a default. - --v print version string diff --git a/packages/udi/LOGE b/packages/udi/LOGE deleted file mode 100644 index 45ce2a68e..000000000 --- a/packages/udi/LOGE +++ /dev/null @@ -1 +0,0 @@ -error: configuration file docs/doxfull.rc not found! diff --git a/pl/CMakeFiles/startup.yss.dir/DependInfo.cmake b/pl/CMakeFiles/startup.yss.dir/DependInfo.cmake deleted file mode 100644 index 86c3d8af6..000000000 --- a/pl/CMakeFiles/startup.yss.dir/DependInfo.cmake +++ /dev/null @@ -1,8 +0,0 @@ -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - ) -# The set of files for implicit dependencies of each language: - -# Targets to which this target links. -set(CMAKE_TARGET_LINKED_INFO_FILES - ) diff --git a/swi/library/CMakeFiles/CMakeDirectoryInformation.cmake b/swi/library/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index bab203dbc..000000000 --- a/swi/library/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.3 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/vsc/git/yap-6.3") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/vsc/git/yap-6.3") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/swi/library/CMakeFiles/progress.marks b/swi/library/CMakeFiles/progress.marks deleted file mode 100644 index 573541ac9..000000000 --- a/swi/library/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -0