SWI flags compat
This commit is contained in:
parent
35b7f040d5
commit
1cbe82da1e
@ -29,8 +29,8 @@ static char SccsId[] = "%W% %G%.2";
|
|||||||
#include "Foreign.h"
|
#include "Foreign.h"
|
||||||
|
|
||||||
#if _WIN32 || defined(__CYGWIN__)
|
#if _WIN32 || defined(__CYGWIN__)
|
||||||
#ifndef YAP_SHLIB_SUFFIX
|
#ifndef SO_EXT
|
||||||
#define YAP_SHLIB_SUFFIX ".dll"
|
#define SO_EXT ".dll"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -210,12 +210,12 @@ p_call_shared_object_function( USES_REGS1 ) {
|
|||||||
|
|
||||||
static Int
|
static Int
|
||||||
p_obj_suffix( USES_REGS1 ) {
|
p_obj_suffix( USES_REGS1 ) {
|
||||||
return Yap_unify(Yap_StringToList(YAP_SHLIB_SUFFIX),ARG1);
|
return Yap_unify(Yap_StringToList(SO_EXT),ARG1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Int
|
static Int
|
||||||
p_open_shared_objects( USES_REGS1 ) {
|
p_open_shared_objects( USES_REGS1 ) {
|
||||||
#ifdef YAP_SHLIB_SUFFIX
|
#ifdef SO_EXT
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
#else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -131,10 +131,10 @@ add_end_dot(char arg[])
|
|||||||
static int
|
static int
|
||||||
dump_runtime_variables(void)
|
dump_runtime_variables(void)
|
||||||
{
|
{
|
||||||
fprintf(stdout,"CC=\"%s\"\n",YAP_CC);
|
fprintf(stdout,"CC=\"%s\"\n",C_CC);
|
||||||
fprintf(stdout,"YAP_ROOTDIR=\"%s\"\n",YAP_ROOTDIR);
|
fprintf(stdout,"YAP_ROOTDIR=\"%s\"\n",YAP_ROOTDIR);
|
||||||
fprintf(stdout,"YAP_LIBS=\"%s\"\n",YAP_LIBS);
|
fprintf(stdout,"YAP_LIBS=\"%s\"\n",C_LIBS);
|
||||||
fprintf(stdout,"YAP_SHLIB_SUFFIX=\"%s\"\n",YAP_SHLIB_SUFFIX);
|
fprintf(stdout,"YAP_SHLIB_SUFFIX=\"%s\"\n",SO_EXT);
|
||||||
fprintf(stdout,"YAP_VERSION=%d\n",YAP_VERSION);
|
fprintf(stdout,"YAP_VERSION=%d\n",YAP_VERSION);
|
||||||
exit(0);
|
exit(0);
|
||||||
return 1;
|
return 1;
|
||||||
|
22
Makefile.in
22
Makefile.in
@ -74,6 +74,7 @@ AWK=@AWK@
|
|||||||
CPP=@CPP@
|
CPP=@CPP@
|
||||||
DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1
|
DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1
|
||||||
LIBS=@LIBS@
|
LIBS=@LIBS@
|
||||||
|
DLL_LIBS=@LIBS@ @EXTRA_LIBS_FOR_DLLS@
|
||||||
LDFLAGS=@LDFLAGS@
|
LDFLAGS=@LDFLAGS@
|
||||||
LN_S=@LN_S@
|
LN_S=@LN_S@
|
||||||
M4=@M4@
|
M4=@M4@
|
||||||
@ -276,8 +277,8 @@ C_SOURCES= \
|
|||||||
$(srcdir)/OPTYap/or.thread_engine.c \
|
$(srcdir)/OPTYap/or.thread_engine.c \
|
||||||
$(srcdir)/OPTYap/or.scheduler.c $(srcdir)/OPTYap/or.cut.c \
|
$(srcdir)/OPTYap/or.scheduler.c $(srcdir)/OPTYap/or.cut.c \
|
||||||
$(srcdir)/OPTYap/tab.tries.c $(srcdir)/OPTYap/tab.completion.c \
|
$(srcdir)/OPTYap/tab.tries.c $(srcdir)/OPTYap/tab.completion.c \
|
||||||
$(srcdir)/library/mpi/mpi.c $(srcdir)/library/mpi/mpe.c \
|
# $(srcdir)/library/mpi/mpi.c $(srcdir)/library/mpi/mpe.c \
|
||||||
$(srcdir)/library/lammpi/yap_mpi.c $(srcdir)/library/lammpi/hash.c $(srcdir)/library/lammpi/prologterms2c.c \
|
# $(srcdir)/library/lammpi/yap_mpi.c $(srcdir)/library/lammpi/hash.c $(srcdir)/library/lammpi/prologterms2c.c \
|
||||||
$(srcdir)/C/cut_c.c \
|
$(srcdir)/C/cut_c.c \
|
||||||
$(srcdir)/library/dialect/swi/fli/swi.c \
|
$(srcdir)/library/dialect/swi/fli/swi.c \
|
||||||
$(srcdir)/library/dialect/swi/fli/blobs.c \
|
$(srcdir)/library/dialect/swi/fli/blobs.c \
|
||||||
@ -431,12 +432,13 @@ parms.h: Makefile
|
|||||||
@echo $(VERSION) | $(AWK) -F. '{ printf("#define YAP_VERSION %d\n", $$1 * 10000 + $$2 * 100 + $$3); }' >> $@%
|
@echo $(VERSION) | $(AWK) -F. '{ printf("#define YAP_VERSION %d\n", $$1 * 10000 + $$2 * 100 + $$3); }' >> $@%
|
||||||
@echo "#define MYDDAS_VERSION \"$(MYDDAS_VERSION)\"" >> $@%
|
@echo "#define MYDDAS_VERSION \"$(MYDDAS_VERSION)\"" >> $@%
|
||||||
@echo "#define YAP_ARCH \"$(ARCH)\"" >> $@%
|
@echo "#define YAP_ARCH \"$(ARCH)\"" >> $@%
|
||||||
@echo "#define YAP_LIBS \"$(LIBS)\"" >> $@%
|
@echo "#define C_LIBS \"$(LIBS)\"" >> $@%
|
||||||
|
@echo "#define C_LIBPLSO \"$(DLL_LIBS)\"" >> $@%
|
||||||
@echo "#define YAP_YAPLIB \"$(YAPLIB)\"" >> $@%
|
@echo "#define YAP_YAPLIB \"$(YAPLIB)\"" >> $@%
|
||||||
@echo "#define YAP_CC \"$(CC)\"" >> $@%
|
@echo "#define C_CC \"$(CC)\"" >> $@%
|
||||||
@echo "#define YAP_CFLAGS \"$(CFLAGS)\"" >> $@%
|
@echo "#define C_CFLAGS \"$(CFLAGS)\"" >> $@%
|
||||||
@echo "#define YAP_LDFLAGS \"$(LDFLAGS)\"" >> $@%
|
@echo "#define C_LDFLAGS \"$(LDFLAGS)\"" >> $@%
|
||||||
@echo "#define YAP_SHLIB_SUFFIX \".\" \"$(SO)\"" >> $@%
|
@echo "#define SO_EXT \".\" \"$(SO)\"" >> $@%
|
||||||
@echo "#define YAP_TIMESTAMP \"`date +%s`\"" >> $@%
|
@echo "#define YAP_TIMESTAMP \"`date +%s`\"" >> $@%
|
||||||
@echo "#define YAP_SVERSION \"YAP $(VERSION) ($(ARCH)): `date`\"" >> $@%
|
@echo "#define YAP_SVERSION \"YAP $(VERSION) ($(ARCH)): `date`\"" >> $@%
|
||||||
@if cmp -s $@% $@; then rm $@%; else mv $@% $@; fi
|
@if cmp -s $@% $@; then rm $@%; else mv $@% $@; fi
|
||||||
@ -696,7 +698,7 @@ mycb: $(srcdir)/mycb.c
|
|||||||
|
|
||||||
all: startup.yss
|
all: startup.yss
|
||||||
@ENABLE_GECODE@ @INSTALL_DLLS@ (cd library/gecode; $(MAKE))
|
@ENABLE_GECODE@ @INSTALL_DLLS@ (cd library/gecode; $(MAKE))
|
||||||
@INSTALL_DLLS@ (cd library/lammpi; $(MAKE))
|
@INSTALL_MPI@ (cd library/lammpi; $(MAKE))
|
||||||
@INSTALL_MATLAB@ (cd library/matlab; $(MAKE))
|
@INSTALL_MATLAB@ (cd library/matlab; $(MAKE))
|
||||||
@INSTALL_DLLS@ (cd library/matrix; $(MAKE))
|
@INSTALL_DLLS@ (cd library/matrix; $(MAKE))
|
||||||
@INSTALL_DLLS@ (cd library/random; $(MAKE))
|
@INSTALL_DLLS@ (cd library/random; $(MAKE))
|
||||||
@ -772,7 +774,7 @@ install_unix: startup.yss libYap.a
|
|||||||
$(INSTALL) $(srcdir)/README $(DESTDIR)$(DOCSDIR)
|
$(INSTALL) $(srcdir)/README $(DESTDIR)$(DOCSDIR)
|
||||||
$(INSTALL) $(srcdir)/COPYING $(DESTDIR)$(DOCSDIR)
|
$(INSTALL) $(srcdir)/COPYING $(DESTDIR)$(DOCSDIR)
|
||||||
for f in $(PL_SOURCES); do $(INSTALL) $$f $(DESTDIR)$(SHAREDIR)/Yap/pl; done
|
for f in $(PL_SOURCES); do $(INSTALL) $$f $(DESTDIR)$(SHAREDIR)/Yap/pl; done
|
||||||
@INSTALL_DLLS@ (cd library/lammpi; $(MAKE) install)
|
@INSTALL_MPI@ (cd library/lammpi; $(MAKE) install)
|
||||||
@INSTALL_DLLS@ (cd library/matrix; $(MAKE) install)
|
@INSTALL_DLLS@ (cd library/matrix; $(MAKE) install)
|
||||||
@INSTALL_DLLS@ (cd library/random; $(MAKE) install)
|
@INSTALL_DLLS@ (cd library/random; $(MAKE) install)
|
||||||
@INSTALL_DLLS@ (cd library/regex; $(MAKE) install)
|
@INSTALL_DLLS@ (cd library/regex; $(MAKE) install)
|
||||||
@ -915,7 +917,7 @@ depend: $(HEADERS) $(C_SOURCES)
|
|||||||
clean: clean_docs
|
clean: clean_docs
|
||||||
rm -f *.o *~ *.BAK *.a
|
rm -f *.o *~ *.BAK *.a
|
||||||
@ENABLE_GECODE@ @INSTALL_DLLS@ (cd library/gecode; $(MAKE) clean)
|
@ENABLE_GECODE@ @INSTALL_DLLS@ (cd library/gecode; $(MAKE) clean)
|
||||||
@INSTALL_DLLS@ (cd library/lammpi; $(MAKE) clean)
|
@INSTALL_MPI@ (cd library/lammpi; $(MAKE) clean)
|
||||||
@INSTALL_MATLAB@ (cd library/matlab; $(MAKE) clean)
|
@INSTALL_MATLAB@ (cd library/matlab; $(MAKE) clean)
|
||||||
@INSTALL_DLLS@ (cd library/matrix; $(MAKE) clean)
|
@INSTALL_DLLS@ (cd library/matrix; $(MAKE) clean)
|
||||||
@INSTALL_DLLS@ (cd library/random; $(MAKE) clean)
|
@INSTALL_DLLS@ (cd library/random; $(MAKE) clean)
|
||||||
|
@ -198,6 +198,7 @@
|
|||||||
#undef HAVE_GETHOSTNAME
|
#undef HAVE_GETHOSTNAME
|
||||||
#undef HAVE_GETHRTIME
|
#undef HAVE_GETHRTIME
|
||||||
#undef HAVE_GETPAGESIZE
|
#undef HAVE_GETPAGESIZE
|
||||||
|
#undef HAVE_GETPID
|
||||||
#undef HAVE_GETPWNAM
|
#undef HAVE_GETPWNAM
|
||||||
#undef HAVE_GETRUSAGE
|
#undef HAVE_GETRUSAGE
|
||||||
#undef HAVE_GETTIMEOFDAY
|
#undef HAVE_GETTIMEOFDAY
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "pl-incl.h"
|
#include "pl-incl.h"
|
||||||
#ifdef __YAP_PROLOG__
|
#ifdef __YAP_PROLOG__
|
||||||
#include "pl-ctype.h"
|
#include "pl-ctype.h"
|
||||||
|
#include "eval.h"
|
||||||
#else
|
#else
|
||||||
#include "os/pl-ctype.h"
|
#include "os/pl-ctype.h"
|
||||||
#endif
|
#endif
|
||||||
@ -1049,32 +1050,48 @@ initPrologFlagTable(void)
|
|||||||
void
|
void
|
||||||
initPrologFlags(void)
|
initPrologFlags(void)
|
||||||
{ GET_LD
|
{ GET_LD
|
||||||
#ifndef __YAP_PROLOG__
|
|
||||||
setPrologFlag("iso", FT_BOOL, FALSE, PLFLAG_ISO);
|
setPrologFlag("iso", FT_BOOL, FALSE, PLFLAG_ISO);
|
||||||
|
#ifdef __YAP_PROLOG__
|
||||||
|
setPrologFlag("arch", FT_ATOM|FF_READONLY, YAP_ARCH);
|
||||||
|
#else
|
||||||
setPrologFlag("arch", FT_ATOM|FF_READONLY, PLARCH);
|
setPrologFlag("arch", FT_ATOM|FF_READONLY, PLARCH);
|
||||||
|
#endif
|
||||||
#if __WINDOWS__
|
#if __WINDOWS__
|
||||||
setPrologFlag("windows", FT_BOOL|FF_READONLY, TRUE, 0);
|
setPrologFlag("windows", FT_BOOL|FF_READONLY, TRUE, 0);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef __YAP_PROLOG__
|
||||||
setPrologFlag("version", FT_INTEGER|FF_READONLY, PLVERSION);
|
setPrologFlag("version", FT_INTEGER|FF_READONLY, PLVERSION);
|
||||||
setPrologFlag("dialect", FT_ATOM|FF_READONLY, "swi");
|
setPrologFlag("dialect", FT_ATOM|FF_READONLY, "swi");
|
||||||
if ( systemDefaults.home )
|
if ( systemDefaults.home )
|
||||||
setPrologFlag("home", FT_ATOM|FF_READONLY, systemDefaults.home);
|
setPrologFlag("home", FT_ATOM|FF_READONLY, systemDefaults.home);
|
||||||
if ( GD->paths.executable )
|
if ( GD->paths.executable )
|
||||||
setPrologFlag("executable", FT_ATOM|FF_READONLY, GD->paths.executable);
|
setPrologFlag("executable", FT_ATOM|FF_READONLY, GD->paths.executable);
|
||||||
|
#else
|
||||||
|
setPrologFlag("dialect", FT_ATOM|FF_READONLY, "yap");
|
||||||
|
setPrologFlag("home", FT_ATOM|FF_READONLY, YAP_ROOTDIR);
|
||||||
|
if (GLOBAL_argv && GLOBAL_argv[0]) {
|
||||||
|
Yap_TrueFileName (GLOBAL_argv[0], LOCAL_FileNameBuf, FALSE);
|
||||||
|
setPrologFlag("executable", FT_ATOM|FF_READONLY, LOCAL_FileNameBuf);
|
||||||
|
} else
|
||||||
|
setPrologFlag("executable", FT_ATOM|FF_READONLY, Yap_FindExecutable());
|
||||||
|
#endif
|
||||||
#if defined(HAVE_GETPID) || defined(EMULATE_GETPID)
|
#if defined(HAVE_GETPID) || defined(EMULATE_GETPID)
|
||||||
setPrologFlag("pid", FT_INTEGER|FF_READONLY, getpid());
|
setPrologFlag("pid", FT_INTEGER|FF_READONLY, getpid());
|
||||||
#endif
|
#endif
|
||||||
setPrologFlag("optimise", FT_BOOL, GD->cmdline.optimise, PLFLAG_OPTIMISE);
|
setPrologFlag("optimise", FT_BOOL, GD->cmdline.optimise, PLFLAG_OPTIMISE);
|
||||||
setPrologFlag("generate_debug_info", FT_BOOL,
|
setPrologFlag("generate_debug_info", FT_BOOL,
|
||||||
truePrologFlag(PLFLAG_DEBUGINFO), PLFLAG_DEBUGINFO);
|
truePrologFlag(PLFLAG_DEBUGINFO), PLFLAG_DEBUGINFO);
|
||||||
|
#ifndef __YAP_PROLOG__
|
||||||
setPrologFlag("last_call_optimisation", FT_BOOL, TRUE, PLFLAG_LASTCALL);
|
setPrologFlag("last_call_optimisation", FT_BOOL, TRUE, PLFLAG_LASTCALL);
|
||||||
setPrologFlag("warn_override_implicit_import", FT_BOOL, TRUE,
|
setPrologFlag("warn_override_implicit_import", FT_BOOL, TRUE,
|
||||||
PLFLAG_WARN_OVERRIDE_IMPLICIT_IMPORT);
|
PLFLAG_WARN_OVERRIDE_IMPLICIT_IMPORT);
|
||||||
|
#endif
|
||||||
setPrologFlag("c_cc", FT_ATOM, C_CC);
|
setPrologFlag("c_cc", FT_ATOM, C_CC);
|
||||||
setPrologFlag("c_libs", FT_ATOM, C_LIBS);
|
setPrologFlag("c_libs", FT_ATOM, C_LIBS);
|
||||||
setPrologFlag("c_libplso", FT_ATOM, C_LIBPLSO);
|
setPrologFlag("c_libplso", FT_ATOM, C_LIBPLSO);
|
||||||
setPrologFlag("c_ldflags", FT_ATOM, C_LDFLAGS);
|
setPrologFlag("c_ldflags", FT_ATOM, C_LDFLAGS);
|
||||||
setPrologFlag("c_cflags", FT_ATOM, C_CFLAGS);
|
setPrologFlag("c_cflags", FT_ATOM, C_CFLAGS);
|
||||||
|
#ifndef __YAP_PROLOG__
|
||||||
#if defined(O_LARGEFILES) || SIZEOF_LONG == 8
|
#if defined(O_LARGEFILES) || SIZEOF_LONG == 8
|
||||||
setPrologFlag("large_files", FT_BOOL|FF_READONLY, TRUE, 0);
|
setPrologFlag("large_files", FT_BOOL|FF_READONLY, TRUE, 0);
|
||||||
#endif
|
#endif
|
||||||
@ -1083,6 +1100,7 @@ initPrologFlags(void)
|
|||||||
#ifdef O_ATOMGC
|
#ifdef O_ATOMGC
|
||||||
setPrologFlag("agc_margin",FT_INTEGER, GD->atoms.margin);
|
setPrologFlag("agc_margin",FT_INTEGER, GD->atoms.margin);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#if defined(HAVE_DLOPEN) || defined(HAVE_SHL_LOAD) || defined(EMULATE_DLOPEN)
|
#if defined(HAVE_DLOPEN) || defined(HAVE_SHL_LOAD) || defined(EMULATE_DLOPEN)
|
||||||
setPrologFlag("open_shared_object", FT_BOOL|FF_READONLY, TRUE, 0);
|
setPrologFlag("open_shared_object", FT_BOOL|FF_READONLY, TRUE, 0);
|
||||||
setPrologFlag("shared_object_extension", FT_ATOM|FF_READONLY, SO_EXT);
|
setPrologFlag("shared_object_extension", FT_ATOM|FF_READONLY, SO_EXT);
|
||||||
@ -1123,8 +1141,13 @@ initPrologFlags(void)
|
|||||||
setPrologFlag("max_integer", FT_INT64|FF_READONLY, PLMAXINT);
|
setPrologFlag("max_integer", FT_INT64|FF_READONLY, PLMAXINT);
|
||||||
setPrologFlag("min_integer", FT_INT64|FF_READONLY, PLMININT);
|
setPrologFlag("min_integer", FT_INT64|FF_READONLY, PLMININT);
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef __YAP_PROLOG__
|
||||||
setPrologFlag("max_tagged_integer", FT_INTEGER|FF_READONLY, PLMAXTAGGEDINT);
|
setPrologFlag("max_tagged_integer", FT_INTEGER|FF_READONLY, PLMAXTAGGEDINT);
|
||||||
setPrologFlag("min_tagged_integer", FT_INTEGER|FF_READONLY, PLMINTAGGEDINT);
|
setPrologFlag("min_tagged_integer", FT_INTEGER|FF_READONLY, PLMINTAGGEDINT);
|
||||||
|
#else
|
||||||
|
setPrologFlag("max_tagged_integer", FT_INTEGER|FF_READONLY, Int_MAX);
|
||||||
|
setPrologFlag("min_tagged_integer", FT_INTEGER|FF_READONLY, Int_MIN);
|
||||||
|
#endif
|
||||||
#ifdef O_GMP
|
#ifdef O_GMP
|
||||||
setPrologFlag("bounded", FT_BOOL|FF_READONLY, FALSE, 0);
|
setPrologFlag("bounded", FT_BOOL|FF_READONLY, FALSE, 0);
|
||||||
#ifdef __GNU_MP__
|
#ifdef __GNU_MP__
|
||||||
@ -1148,6 +1171,7 @@ initPrologFlags(void)
|
|||||||
setPrologFlag("occurs_check", FT_ATOM, "false");
|
setPrologFlag("occurs_check", FT_ATOM, "false");
|
||||||
setPrologFlag("access_level", FT_ATOM, "user");
|
setPrologFlag("access_level", FT_ATOM, "user");
|
||||||
setPrologFlag("double_quotes", FT_ATOM, "codes");
|
setPrologFlag("double_quotes", FT_ATOM, "codes");
|
||||||
|
#ifndef __YAP_PROLOG__
|
||||||
setPrologFlag("unknown", FT_ATOM, "error");
|
setPrologFlag("unknown", FT_ATOM, "error");
|
||||||
setPrologFlag("debug", FT_BOOL, FALSE, 0);
|
setPrologFlag("debug", FT_BOOL, FALSE, 0);
|
||||||
setPrologFlag("verbose", FT_ATOM|FF_KEEP, GD->options.silent ? "silent" : "normal");
|
setPrologFlag("verbose", FT_ATOM|FF_KEEP, GD->options.silent ? "silent" : "normal");
|
||||||
@ -1161,6 +1185,7 @@ initPrologFlags(void)
|
|||||||
setPrologFlag("toplevel_prompt", FT_ATOM, "~m~d~l~! ?- ");
|
setPrologFlag("toplevel_prompt", FT_ATOM, "~m~d~l~! ?- ");
|
||||||
setPrologFlag("file_name_variables", FT_BOOL, FALSE, PLFLAG_FILEVARS);
|
setPrologFlag("file_name_variables", FT_BOOL, FALSE, PLFLAG_FILEVARS);
|
||||||
setPrologFlag("fileerrors", FT_BOOL, TRUE, PLFLAG_FILEERRORS);
|
setPrologFlag("fileerrors", FT_BOOL, TRUE, PLFLAG_FILEERRORS);
|
||||||
|
#endif
|
||||||
#ifdef __unix__
|
#ifdef __unix__
|
||||||
setPrologFlag("unix", FT_BOOL|FF_READONLY, TRUE, 0);
|
setPrologFlag("unix", FT_BOOL|FF_READONLY, TRUE, 0);
|
||||||
#endif
|
#endif
|
||||||
@ -1184,7 +1209,6 @@ initPrologFlags(void)
|
|||||||
setPrologFlag("compiled_at", FT_ATOM|FF_READONLY, buf);
|
setPrologFlag("compiled_at", FT_ATOM|FF_READONLY, buf);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* YAP_PROLOG */
|
|
||||||
/* Flags copied by YAP */
|
/* Flags copied by YAP */
|
||||||
setPrologFlag("optimise", FT_BOOL, GD->cmdline.optimise, PLFLAG_OPTIMISE);
|
setPrologFlag("optimise", FT_BOOL, GD->cmdline.optimise, PLFLAG_OPTIMISE);
|
||||||
/* FLAGS used by PLStream */
|
/* FLAGS used by PLStream */
|
||||||
|
@ -997,6 +997,9 @@ atom_to_term(term_t atom, term_t term, term_t bindings)
|
|||||||
{ GET_LD
|
{ GET_LD
|
||||||
PL_chars_t txt;
|
PL_chars_t txt;
|
||||||
|
|
||||||
|
{ FILE *f=fopen("/home/vsc/coutput.txt", "append");
|
||||||
|
fprintf(f, "IN: %ld\n", bindings);
|
||||||
|
fclose(f); }
|
||||||
if ( !bindings && PL_is_variable(atom) ) /* term_to_atom(+, -) */
|
if ( !bindings && PL_is_variable(atom) ) /* term_to_atom(+, -) */
|
||||||
{ char buf[1024];
|
{ char buf[1024];
|
||||||
size_t bufsize = sizeof(buf);
|
size_t bufsize = sizeof(buf);
|
||||||
@ -1015,6 +1018,9 @@ atom_to_term(term_t atom, term_t term, term_t bindings)
|
|||||||
txt.storage = PL_CHARS_HEAP;
|
txt.storage = PL_CHARS_HEAP;
|
||||||
txt.encoding = ENC_UTF8;
|
txt.encoding = ENC_UTF8;
|
||||||
txt.canonical = FALSE;
|
txt.canonical = FALSE;
|
||||||
|
{ FILE *f=fopen("/home/vsc/coutput.txt", "append");
|
||||||
|
fprintf(f, "SUCCESS: %s\n", buf);
|
||||||
|
fclose(f); }
|
||||||
rval = PL_unify_text(atom, 0, &txt, PL_ATOM);
|
rval = PL_unify_text(atom, 0, &txt, PL_ATOM);
|
||||||
|
|
||||||
Sclose(stream);
|
Sclose(stream);
|
||||||
|
@ -2256,8 +2256,10 @@ int
|
|||||||
Svdprintf(const char *fm, va_list args)
|
Svdprintf(const char *fm, va_list args)
|
||||||
{ int rval;
|
{ int rval;
|
||||||
IOSTREAM *s = Serror;
|
IOSTREAM *s = Serror;
|
||||||
|
//IOSTREAM *s = Sopen_file("/home/vsc/cout.txt", "append");
|
||||||
|
|
||||||
Slock(s);
|
|
||||||
|
//Slock(s);
|
||||||
rval = Svfprintf(s, fm, args);
|
rval = Svfprintf(s, fm, args);
|
||||||
#if defined(_DEBUG) && defined(__WINDOWS__)
|
#if defined(_DEBUG) && defined(__WINDOWS__)
|
||||||
Sputc('\0', s);
|
Sputc('\0', s);
|
||||||
@ -2266,7 +2268,8 @@ Svdprintf(const char *fm, va_list args)
|
|||||||
#endif
|
#endif
|
||||||
if ( Sflush(s) != 0 )
|
if ( Sflush(s) != 0 )
|
||||||
rval = -1;
|
rval = -1;
|
||||||
Sunlock(s);
|
//Sunlock(s);
|
||||||
|
//Sclose(s);
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
@ -107,8 +107,25 @@ compile-time
|
|||||||
simpleMutexUnlock(&(cm)->mutex); \
|
simpleMutexUnlock(&(cm)->mutex); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
//#define O_DEBUG_MT
|
||||||
|
#ifdef O_DEBUG_MT
|
||||||
|
#define PL_LOCK(id) \
|
||||||
|
do { Sdprintf("[%d] %s:%d: LOCK(%s)\n", \
|
||||||
|
pthread_self(), \
|
||||||
|
__BASE_FILE__, __LINE__, #id); \
|
||||||
|
countingMutexLock(&_PL_mutexes[id]); \
|
||||||
|
} while(0)
|
||||||
|
#define PL_UNLOCK(id) \
|
||||||
|
do { Sdprintf("[%d] %s:%d: UNLOCK(%s)\n", \
|
||||||
|
pthread_self(), \
|
||||||
|
__BASE_FILE__, __LINE__, #id); \
|
||||||
|
countingMutexUnlock(&_PL_mutexes[id]); \
|
||||||
|
} while(0)
|
||||||
|
#else
|
||||||
#define PL_LOCK(id) IF_MT(id, countingMutexLock(&_PL_mutexes[id]))
|
#define PL_LOCK(id) IF_MT(id, countingMutexLock(&_PL_mutexes[id]))
|
||||||
#define PL_UNLOCK(id) IF_MT(id, countingMutexUnlock(&_PL_mutexes[id]))
|
#define PL_UNLOCK(id) IF_MT(id, countingMutexUnlock(&_PL_mutexes[id]))
|
||||||
|
#endif
|
||||||
|
#undef O_DEBUG_MT
|
||||||
|
|
||||||
#define IOLOCK recursiveMutex
|
#define IOLOCK recursiveMutex
|
||||||
|
|
||||||
|
15
pl/boot.yap
15
pl/boot.yap
@ -94,22 +94,15 @@ true :- true.
|
|||||||
|
|
||||||
'$init_globals' :-
|
'$init_globals' :-
|
||||||
'$init_consult',
|
'$init_consult',
|
||||||
nb_setval('$chr_toplevel_show_store',false),
|
|
||||||
nb_setval('$break',0),
|
nb_setval('$break',0),
|
||||||
% '$set_read_error_handler'(error), let the user do that
|
% '$set_read_error_handler'(error), let the user do that
|
||||||
nb_setval('$open_expands_filename',true),
|
|
||||||
nb_setval('$trace',off),
|
|
||||||
nb_setval('$system_mode',off),
|
nb_setval('$system_mode',off),
|
||||||
nb_setval('$chr_toplevel_show_store',false),
|
nb_setval('$chr_toplevel_show_store',false).
|
||||||
nb_setval('$assert_all',off),
|
|
||||||
nb_setval('$if_skip_mode',no_skip),
|
|
||||||
b_setval('$spy_glist',[]),
|
|
||||||
nb_setval('$spy_gn',1),
|
|
||||||
nb_setval('$debug_run',off),
|
|
||||||
nb_setval('$debug_jump',off).
|
|
||||||
|
|
||||||
'$init_consult' :-
|
'$init_consult' :-
|
||||||
|
set_value('$open_expands_filename',true),
|
||||||
set_value('$lf_verbose',informational),
|
set_value('$lf_verbose',informational),
|
||||||
|
nb_setval('$assert_all',off),
|
||||||
nb_setval('$if_level',0),
|
nb_setval('$if_level',0),
|
||||||
nb_setval('$endif',off),
|
nb_setval('$endif',off),
|
||||||
nb_setval('$consulting_file',[]),
|
nb_setval('$consulting_file',[]),
|
||||||
@ -1263,7 +1256,7 @@ catch_ball(C, C).
|
|||||||
'$execute_outside_system_mode'(G2, M, CP)
|
'$execute_outside_system_mode'(G2, M, CP)
|
||||||
).
|
).
|
||||||
'$execute_outside_system_mode'(G, M, CP) :-
|
'$execute_outside_system_mode'(G, M, CP) :-
|
||||||
nb_getval('$trace', on), !,
|
'$nb_getval'('$trace', on, fail), !,
|
||||||
(
|
(
|
||||||
'$$save_by'(CP1),
|
'$$save_by'(CP1),
|
||||||
'$do_spy'(G, M, CP, meta_creep),
|
'$do_spy'(G, M, CP, meta_creep),
|
||||||
|
@ -923,20 +923,20 @@ absolute_file_name(File,Opts,TrueFileName) :-
|
|||||||
'$get_if'(Level0),
|
'$get_if'(Level0),
|
||||||
Level is Level0 + 1,
|
Level is Level0 + 1,
|
||||||
nb_setval('$if_level',Level),
|
nb_setval('$if_level',Level),
|
||||||
nb_getval('$endif',OldEndif),
|
'$nb_getval'('$endif', OldEndif, OldEndif=top),
|
||||||
nb_getval('$if_skip_mode',Mode),
|
'$nb_getval'('$if_skip_mode', Mode, Mode=run),
|
||||||
nb_setval('$endif',elif(Level,OldEndif,Mode)),
|
nb_setval('$endif',elif(Level,OldEndif,Mode)),
|
||||||
fail.
|
fail.
|
||||||
% we are in skip mode, ignore....
|
% we are in skip mode, ignore....
|
||||||
'$if'(Goal,_) :-
|
'$if'(Goal,_) :-
|
||||||
nb_getval('$endif',elif(Level, OldEndif, skip)), !,
|
'$nb_getval'('$endif',elif(Level, OldEndif, skip), fail), !,
|
||||||
nb_setval('$endif',endif(Level, OldEndif, skip)).
|
nb_setval('$endif',endif(Level, OldEndif, skip)).
|
||||||
% we are in non skip mode, check....
|
% we are in non skip mode, check....
|
||||||
'$if'(Goal,_) :-
|
'$if'(Goal,_) :-
|
||||||
('$if_call'(Goal)
|
('$if_call'(Goal)
|
||||||
->
|
->
|
||||||
% we will execute this branch, and later enter skip
|
% we will execute this branch, and later enter skip
|
||||||
nb_getval('$endif',elif(Level,OldEndif,Mode)),
|
'$nb_getval'('$endif', elif(Level,OldEndif,Mode), fail),
|
||||||
nb_setval('$endif',endif(Level,OldEndif,Mode))
|
nb_setval('$endif',endif(Level,OldEndif,Mode))
|
||||||
;
|
;
|
||||||
% we are now in skip, but can start an elif.
|
% we are now in skip, but can start an elif.
|
||||||
|
@ -320,6 +320,7 @@ b_getval(GlobalVariable, Val) :-
|
|||||||
debugger state */
|
debugger state */
|
||||||
|
|
||||||
break :-
|
break :-
|
||||||
|
'$init_debugger',
|
||||||
nb_getval('$system_mode',SystemMode),
|
nb_getval('$system_mode',SystemMode),
|
||||||
nb_getval('$trace',Trace),
|
nb_getval('$trace',Trace),
|
||||||
nb_setval('$trace',off),
|
nb_setval('$trace',off),
|
||||||
|
25
pl/debug.yap
25
pl/debug.yap
@ -11,7 +11,7 @@
|
|||||||
* File: debug.pl *
|
* File: debug.pl *
|
||||||
* Last rev: *
|
* Last rev: *
|
||||||
* mods: *
|
* mods: *
|
||||||
* comments: YAP's debugger *
|
* comments: YAP debugger *
|
||||||
* *
|
* *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
@ -23,6 +23,16 @@
|
|||||||
|
|
||||||
:- op(900,fx,[spy,nospy]).
|
:- op(900,fx,[spy,nospy]).
|
||||||
|
|
||||||
|
'$init_debugger' :-
|
||||||
|
nb_getval('$trace', _, fail), !.
|
||||||
|
'$init_debugger' :-
|
||||||
|
nb_setval('$trace',off),
|
||||||
|
nb_setval('$if_skip_mode',no_skip),
|
||||||
|
b_setval('$spy_glist',[]),
|
||||||
|
nb_setval('$spy_gn',1),
|
||||||
|
nb_setval('$debug_run',off),
|
||||||
|
nb_setval('$debug_jump',off).
|
||||||
|
|
||||||
|
|
||||||
% First part : setting and reseting spy points
|
% First part : setting and reseting spy points
|
||||||
|
|
||||||
@ -123,6 +133,7 @@
|
|||||||
recorded('$spy','$spy'(G,M),_), !.
|
recorded('$spy','$spy'(G,M),_), !.
|
||||||
|
|
||||||
spy Spec :-
|
spy Spec :-
|
||||||
|
'$init_debugger',
|
||||||
prolog:debug_action_hook(spy(Spec)), !.
|
prolog:debug_action_hook(spy(Spec)), !.
|
||||||
spy L :-
|
spy L :-
|
||||||
'$current_module'(M),
|
'$current_module'(M),
|
||||||
@ -130,6 +141,7 @@ spy L :-
|
|||||||
spy _ :- debug.
|
spy _ :- debug.
|
||||||
|
|
||||||
nospy Spec :-
|
nospy Spec :-
|
||||||
|
'$init_debugger',
|
||||||
prolog:debug_action_hook(nospy(Spec)), !.
|
prolog:debug_action_hook(nospy(Spec)), !.
|
||||||
nospy L :-
|
nospy L :-
|
||||||
'$current_module'(M),
|
'$current_module'(M),
|
||||||
@ -137,6 +149,7 @@ nospy L :-
|
|||||||
nospy _.
|
nospy _.
|
||||||
|
|
||||||
nospyall :-
|
nospyall :-
|
||||||
|
'$init_debugger',
|
||||||
prolog:debug_action_hook(nospyall), !.
|
prolog:debug_action_hook(nospyall), !.
|
||||||
nospyall :-
|
nospyall :-
|
||||||
recorded('$spy','$spy'(T,M),_), functor(T,F,N), '$suspy'(F/N,nospy,M), fail.
|
recorded('$spy','$spy'(T,M),_), functor(T,F,N), '$suspy'(F/N,nospy,M), fail.
|
||||||
@ -145,6 +158,7 @@ nospyall.
|
|||||||
% debug mode -> debug flag = 1
|
% debug mode -> debug flag = 1
|
||||||
|
|
||||||
debug :-
|
debug :-
|
||||||
|
'$init_debugger',
|
||||||
( nb_getval('$spy_gn',L) -> true ; nb_setval('$spy_gn',1) ),
|
( nb_getval('$spy_gn',L) -> true ; nb_setval('$spy_gn',1) ),
|
||||||
'$start_debugging'(on),
|
'$start_debugging'(on),
|
||||||
print_message(informational,debug(debug)).
|
print_message(informational,debug(debug)).
|
||||||
@ -159,6 +173,7 @@ debug :-
|
|||||||
nb_setval('$debug_jump',false).
|
nb_setval('$debug_jump',false).
|
||||||
|
|
||||||
nodebug :-
|
nodebug :-
|
||||||
|
'$init_debugger',
|
||||||
'$debug_on'(false),
|
'$debug_on'(false),
|
||||||
nb_setval('$trace',off),
|
nb_setval('$trace',off),
|
||||||
print_message(informational,debug(off)).
|
print_message(informational,debug(off)).
|
||||||
@ -168,7 +183,8 @@ nodebug :-
|
|||||||
%
|
%
|
||||||
|
|
||||||
trace :-
|
trace :-
|
||||||
nb_getval('$trace',on), !.
|
'$init_debugger',
|
||||||
|
'$nb_getval'('$trace', on, fail), !.
|
||||||
trace :-
|
trace :-
|
||||||
nb_setval('$trace',on),
|
nb_setval('$trace',on),
|
||||||
'$start_debugging'(on),
|
'$start_debugging'(on),
|
||||||
@ -176,7 +192,7 @@ trace :-
|
|||||||
'$meta_creep'.
|
'$meta_creep'.
|
||||||
|
|
||||||
'$do_trace' :-
|
'$do_trace' :-
|
||||||
nb_getval('$trace',on), !.
|
'$nb_getval'('$trace', on, fail), !.
|
||||||
'$do_trace' :-
|
'$do_trace' :-
|
||||||
nb_setval('$trace',on),
|
nb_setval('$trace',on),
|
||||||
'$start_debugging'(on),
|
'$start_debugging'(on),
|
||||||
@ -184,6 +200,7 @@ trace :-
|
|||||||
'$creep'.
|
'$creep'.
|
||||||
|
|
||||||
notrace :-
|
notrace :-
|
||||||
|
'$init_debugger',
|
||||||
nodebug.
|
nodebug.
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
@ -196,6 +213,7 @@ notrace :-
|
|||||||
leash(X) :- var(X),
|
leash(X) :- var(X),
|
||||||
'$do_error'(instantiation_error,leash(X)).
|
'$do_error'(instantiation_error,leash(X)).
|
||||||
leash(X) :-
|
leash(X) :-
|
||||||
|
'$init_debugger',
|
||||||
'$leashcode'(X,Code),
|
'$leashcode'(X,Code),
|
||||||
set_value('$leash',Code),
|
set_value('$leash',Code),
|
||||||
'$show_leash'(informational,Code), !.
|
'$show_leash'(informational,Code), !.
|
||||||
@ -243,6 +261,7 @@ leash(X) :-
|
|||||||
|
|
||||||
|
|
||||||
debugging :-
|
debugging :-
|
||||||
|
'$init_debugger',
|
||||||
prolog:debug_action_hook(nospyall), !.
|
prolog:debug_action_hook(nospyall), !.
|
||||||
debugging :-
|
debugging :-
|
||||||
( '$debug_on'(true) ->
|
( '$debug_on'(true) ->
|
||||||
|
120
pl/flags.yap
120
pl/flags.yap
@ -58,9 +58,6 @@ yap_flag(autoload,false) :-
|
|||||||
% do or do not machine code
|
% do or do not machine code
|
||||||
yap_flag(argv,L) :- '$argv'(L).
|
yap_flag(argv,L) :- '$argv'(L).
|
||||||
|
|
||||||
% do or do not machine code
|
|
||||||
yap_flag(executable,L) :- '$executable'(L).
|
|
||||||
|
|
||||||
% hide/unhide atoms
|
% hide/unhide atoms
|
||||||
yap_flag(hide,Atom) :- !, hide(Atom).
|
yap_flag(hide,Atom) :- !, hide(Atom).
|
||||||
yap_flag(unhide,Atom) :- !, unhide(Atom).
|
yap_flag(unhide,Atom) :- !, unhide(Atom).
|
||||||
@ -212,16 +209,6 @@ yap_flag(associate,X) :-
|
|||||||
yap_flag(associate,X) :-
|
yap_flag(associate,X) :-
|
||||||
'$do_error'(type_error(atom,X),associate(X)).
|
'$do_error'(type_error(atom,X),associate(X)).
|
||||||
|
|
||||||
yap_flag(bounded,X) :-
|
|
||||||
var(X), !,
|
|
||||||
'$access_yap_flags'(0, X1),
|
|
||||||
'$transl_to_true_false'(X1,X).
|
|
||||||
yap_flag(bounded,X) :-
|
|
||||||
(X = true ; X = false), !,
|
|
||||||
'$do_error'(permission_error(modify,flag,bounded),yap_flag(bounded,X)).
|
|
||||||
yap_flag(bounded,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,bounded+X),yap_flag(bounded,X)).
|
|
||||||
|
|
||||||
% do or do not indexation
|
% do or do not indexation
|
||||||
yap_flag(index,X) :- var(X),
|
yap_flag(index,X) :- var(X),
|
||||||
'$access_yap_flags'(19, X1),
|
'$access_yap_flags'(19, X1),
|
||||||
@ -244,9 +231,6 @@ yap_flag(index_sub_term_search_depth,X,X) :-
|
|||||||
yap_flag(index_sub_term_search_depth,X,X) :-
|
yap_flag(index_sub_term_search_depth,X,X) :-
|
||||||
'$do_error'(domain_error(out_of_range,index_sub_term_search_depth+X),yap_flag(index_sub_term_search_depth,X)).
|
'$do_error'(domain_error(out_of_range,index_sub_term_search_depth+X),yap_flag(index_sub_term_search_depth,X)).
|
||||||
|
|
||||||
yap_flag(home,X) :-
|
|
||||||
'$yap_home'(X).
|
|
||||||
|
|
||||||
% should match definitions in Yap.h
|
% should match definitions in Yap.h
|
||||||
'$transl_to_index_mode'(0, off).
|
'$transl_to_index_mode'(0, off).
|
||||||
'$transl_to_index_mode'(1, single).
|
'$transl_to_index_mode'(1, single).
|
||||||
@ -312,58 +296,12 @@ yap_flag(integer_rounding_function,X) :-
|
|||||||
yap_flag(integer_rounding_function,X) :-
|
yap_flag(integer_rounding_function,X) :-
|
||||||
'$do_error'(domain_error(flag_value,integer_rounding_function+X),yap_flag(integer_rounding_function,X)).
|
'$do_error'(domain_error(flag_value,integer_rounding_function+X),yap_flag(integer_rounding_function,X)).
|
||||||
|
|
||||||
yap_flag(max_arity,X) :-
|
|
||||||
var(X), !,
|
|
||||||
'$access_yap_flags'(1, X1),
|
|
||||||
'$transl_to_arity'(X1,X).
|
|
||||||
yap_flag(max_arity,X) :-
|
|
||||||
integer(X), X > 0, !,
|
|
||||||
'$do_error'(permission_error(modify,flag,max_arity),yap_flag(max_arity,X)).
|
|
||||||
yap_flag(max_arity,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,max_arity+X),yap_flag(max_arity,X)).
|
|
||||||
|
|
||||||
yap_flag(version,X) :-
|
yap_flag(version,X) :-
|
||||||
var(X), !,
|
var(X), !,
|
||||||
get_value('$version_name',X).
|
get_value('$version_name',X).
|
||||||
yap_flag(version,X) :-
|
yap_flag(version,X) :-
|
||||||
'$do_error'(permission_error(modify,flag,version),yap_flag(version,X)).
|
'$do_error'(permission_error(modify,flag,version),yap_flag(version,X)).
|
||||||
|
|
||||||
yap_flag(max_integer,X) :-
|
|
||||||
var(X), !,
|
|
||||||
'$access_yap_flags'(0, 1),
|
|
||||||
'$access_yap_flags'(3, X).
|
|
||||||
yap_flag(max_integer,X) :-
|
|
||||||
integer(X), X > 0, !,
|
|
||||||
'$do_error'(permission_error(modify,flag,max_integer),yap_flag(max_integer,X)).
|
|
||||||
yap_flag(max_integer,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,max_integer+X),yap_flag(max_integer,X)).
|
|
||||||
|
|
||||||
yap_flag(max_tagged_integer,X) :-
|
|
||||||
'$max_tagged_integer'(X), !.
|
|
||||||
yap_flag(max_tagged_integer,X) :-
|
|
||||||
integer(X), X > 0, !,
|
|
||||||
'$do_error'(permission_error(modify,flag,max_tagged_integer),yap_flag(max_tagged_integer,X)).
|
|
||||||
yap_flag(max_tagged_integer,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,max_tagged_integer+X),yap_flag(max_tagged_integer,X)).
|
|
||||||
|
|
||||||
yap_flag(min_integer,X) :-
|
|
||||||
var(X), !,
|
|
||||||
'$access_yap_flags'(0, 1),
|
|
||||||
'$access_yap_flags'(4, X).
|
|
||||||
yap_flag(min_integer,X) :-
|
|
||||||
integer(X), X < 0, !,
|
|
||||||
'$do_error'(permission_error(modify,flag,min_integer),yap_flag(min_integer,X)).
|
|
||||||
yap_flag(min_integer,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,min_integer+X),yap_flag(min_integer,X)).
|
|
||||||
|
|
||||||
yap_flag(min_tagged_integer,X) :-
|
|
||||||
'$min_tagged_integer'( X), !.
|
|
||||||
yap_flag(min_tagged_integer,X) :-
|
|
||||||
integer(X), X > 0, !,
|
|
||||||
'$do_error'(permission_error(modify,flag,min_tagged_integer),yap_flag(min_tagged_integer,X)).
|
|
||||||
yap_flag(min_tagged_integer,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,min_tagged_integer+X),yap_flag(min_tagged_integer,X)).
|
|
||||||
|
|
||||||
/* ISO Core Revision DTR: new float flags
|
/* ISO Core Revision DTR: new float flags
|
||||||
|
|
||||||
yap_flag(float_mantissa_digits,X) :-
|
yap_flag(float_mantissa_digits,X) :-
|
||||||
@ -419,16 +357,6 @@ yap_flag(char_conversion,X) :-
|
|||||||
yap_flag(char_conversion,X) :-
|
yap_flag(char_conversion,X) :-
|
||||||
'$do_error'(domain_error(flag_value,char_conversion+X),yap_flag(char_conversion,X)).
|
'$do_error'(domain_error(flag_value,char_conversion+X),yap_flag(char_conversion,X)).
|
||||||
|
|
||||||
yap_flag(double_quotes,X) :-
|
|
||||||
var(X), !,
|
|
||||||
'$access_yap_flags'(6, X1),
|
|
||||||
'$transl_to_trl_types'(X1,X).
|
|
||||||
yap_flag(double_quotes,X) :-
|
|
||||||
'$transl_to_trl_types'(X1,X), !,
|
|
||||||
'$set_yap_flags'(6,X1).
|
|
||||||
yap_flag(double_quotes,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,double_quotes+X),yap_flag(double_quotes,X)).
|
|
||||||
|
|
||||||
yap_flag(n_of_integer_keys_in_db,X) :-
|
yap_flag(n_of_integer_keys_in_db,X) :-
|
||||||
var(X), !,
|
var(X), !,
|
||||||
'$resize_int_keys'(X).
|
'$resize_int_keys'(X).
|
||||||
@ -514,13 +442,6 @@ yap_flag(discontiguous_warnings,X) :-
|
|||||||
yap_flag(discontiguous_warnings,X) :-
|
yap_flag(discontiguous_warnings,X) :-
|
||||||
'$do_error'(domain_error(flag_value,discontiguous_warnings+X),yap_flag(discontiguous_warnings,X)).
|
'$do_error'(domain_error(flag_value,discontiguous_warnings+X),yap_flag(discontiguous_warnings,X)).
|
||||||
|
|
||||||
yap_flag(occurs_check,X) :-
|
|
||||||
X = false, !.
|
|
||||||
yap_flag(occurs_check,true) :- !,
|
|
||||||
fail.
|
|
||||||
yap_flag(occurs_check,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,occurs_check+X),yap_flag(occurs_check,X)).
|
|
||||||
|
|
||||||
yap_flag(redefine_warnings,X) :-
|
yap_flag(redefine_warnings,X) :-
|
||||||
var(X), !,
|
var(X), !,
|
||||||
'$syntax_check_multiple'(X,X).
|
'$syntax_check_multiple'(X,X).
|
||||||
@ -536,7 +457,7 @@ yap_flag(redefine_warnings,X) :-
|
|||||||
|
|
||||||
yap_flag(chr_toplevel_show_store,X) :-
|
yap_flag(chr_toplevel_show_store,X) :-
|
||||||
var(X), !,
|
var(X), !,
|
||||||
nb_getval('$chr_toplevel_show_store',X).
|
'$nb_getval'('$chr_toplevel_show_store', X, fail).
|
||||||
yap_flag(chr_toplevel_show_store,X) :-
|
yap_flag(chr_toplevel_show_store,X) :-
|
||||||
(X = true ; X = false), !,
|
(X = true ; X = false), !,
|
||||||
nb_setval('$chr_toplevel_show_store',X).
|
nb_setval('$chr_toplevel_show_store',X).
|
||||||
@ -581,8 +502,6 @@ yap_flag(system_options,X) :-
|
|||||||
'$swi_current_prolog_flag'(readline, true).
|
'$swi_current_prolog_flag'(readline, true).
|
||||||
'$system_options'(tabling) :-
|
'$system_options'(tabling) :-
|
||||||
\+ '$undefined'('$c_table'(_,_,_), prolog).
|
\+ '$undefined'('$c_table'(_,_,_), prolog).
|
||||||
'$system_options'(threads) :-
|
|
||||||
\+ '$no_threads'.
|
|
||||||
'$system_options'(wam_profiler) :-
|
'$system_options'(wam_profiler) :-
|
||||||
\+ '$undefined'(reset_op_counters, prolog).
|
\+ '$undefined'(reset_op_counters, prolog).
|
||||||
|
|
||||||
@ -630,14 +549,6 @@ yap_flag(toplevel_hook,G) :-
|
|||||||
yap_flag(toplevel_hook,G) :- !,
|
yap_flag(toplevel_hook,G) :- !,
|
||||||
'$set_toplevel_hook'(G).
|
'$set_toplevel_hook'(G).
|
||||||
|
|
||||||
yap_flag(unix,true) :-
|
|
||||||
'$unix', !.
|
|
||||||
yap_flag(unix,false).
|
|
||||||
|
|
||||||
yap_flag(windows,true) :-
|
|
||||||
'$win32', !.
|
|
||||||
yap_flag(windows,false).
|
|
||||||
|
|
||||||
yap_flag(shared_object_search_path,P) :-
|
yap_flag(shared_object_search_path,P) :-
|
||||||
'$ld_path'(P).
|
'$ld_path'(P).
|
||||||
|
|
||||||
@ -788,35 +699,19 @@ yap_flag(max_threads,X) :-
|
|||||||
yap_flag(max_threads,X) :-
|
yap_flag(max_threads,X) :-
|
||||||
'$do_error'(domain_error(flag_value,max_threads+X),yap_flag(max_threads,X)).
|
'$do_error'(domain_error(flag_value,max_threads+X),yap_flag(max_threads,X)).
|
||||||
|
|
||||||
yap_flag(address_bits,X) :-
|
|
||||||
var(X), !,
|
|
||||||
'$address_bits'(X).
|
|
||||||
yap_flag(address_bits,X) :-
|
|
||||||
integer(X), X > 0, !,
|
|
||||||
'$do_error'(permission_error(modify,flag,address_bits),yap_flag(address_bits,X)).
|
|
||||||
yap_flag(address_bits,X) :-
|
|
||||||
'$do_error'(domain_error(flag_value,address_bits+X),yap_flag(address_bits,X)).
|
|
||||||
|
|
||||||
yap_flag(dialect,yap).
|
|
||||||
|
|
||||||
'$yap_system_flag'(address_bits).
|
|
||||||
'$yap_system_flag'(agc_margin).
|
'$yap_system_flag'(agc_margin).
|
||||||
'$yap_system_flag'(answer_format).
|
'$yap_system_flag'(answer_format).
|
||||||
'$yap_system_flag'(argv).
|
'$yap_system_flag'(argv).
|
||||||
'$yap_system_flag'(autoload).
|
'$yap_system_flag'(autoload).
|
||||||
'$yap_system_flag'(bounded).
|
|
||||||
'$yap_system_flag'(char_conversion).
|
'$yap_system_flag'(char_conversion).
|
||||||
'$yap_system_flag'(character_escapes).
|
'$yap_system_flag'(character_escapes).
|
||||||
'$yap_system_flag'(chr_toplevel_show_store).
|
'$yap_system_flag'(chr_toplevel_show_store).
|
||||||
'$yap_system_flag'(debug).
|
'$yap_system_flag'(debug).
|
||||||
'$yap_system_flag'(debug_on_error ).
|
'$yap_system_flag'(debug_on_error ).
|
||||||
'$yap_system_flag'(debugger_print_options).
|
'$yap_system_flag'(debugger_print_options).
|
||||||
'$yap_system_flag'(dialect).
|
|
||||||
'$yap_system_flag'(discontiguous_warnings).
|
'$yap_system_flag'(discontiguous_warnings).
|
||||||
'$yap_system_flag'(dollar_as_lower_case).
|
'$yap_system_flag'(dollar_as_lower_case).
|
||||||
'$yap_system_flag'(double_quotes).
|
'$yap_system_flag'(double_quotes).
|
||||||
% '$yap_system_flag'(encoding).
|
|
||||||
'$yap_system_flag'(executable).
|
|
||||||
% V = fast ;
|
% V = fast ;
|
||||||
% '$yap_system_flag'(file_name_variables).
|
% '$yap_system_flag'(file_name_variables).
|
||||||
% '$yap_system_flag'(fileerrors ).
|
% '$yap_system_flag'(fileerrors ).
|
||||||
@ -830,7 +725,6 @@ yap_flag(dialect,yap).
|
|||||||
'$yap_system_flag'(gc_trace ).
|
'$yap_system_flag'(gc_trace ).
|
||||||
'$yap_system_flag'(generate_debug_info ).
|
'$yap_system_flag'(generate_debug_info ).
|
||||||
% V = hide ;
|
% V = hide ;
|
||||||
'$yap_system_flag'(home ).
|
|
||||||
'$yap_system_flag'(host_type ).
|
'$yap_system_flag'(host_type ).
|
||||||
'$yap_system_flag'(index).
|
'$yap_system_flag'(index).
|
||||||
'$yap_system_flag'(index_sub_term_search_depth).
|
'$yap_system_flag'(index_sub_term_search_depth).
|
||||||
@ -838,15 +732,9 @@ yap_flag(dialect,yap).
|
|||||||
'$yap_system_flag'(informational_messages).
|
'$yap_system_flag'(informational_messages).
|
||||||
'$yap_system_flag'(integer_rounding_function).
|
'$yap_system_flag'(integer_rounding_function).
|
||||||
'$yap_system_flag'(language).
|
'$yap_system_flag'(language).
|
||||||
'$yap_system_flag'(max_arity).
|
|
||||||
'$yap_system_flag'(max_integer).
|
|
||||||
'$yap_system_flag'(max_tagged_integer).
|
|
||||||
'$yap_system_flag'(max_workers).
|
'$yap_system_flag'(max_workers).
|
||||||
'$yap_system_flag'(max_threads).
|
'$yap_system_flag'(max_threads).
|
||||||
'$yap_system_flag'(min_integer).
|
|
||||||
'$yap_system_flag'(min_tagged_integer).
|
|
||||||
'$yap_system_flag'(n_of_integer_keys_in_db).
|
'$yap_system_flag'(n_of_integer_keys_in_db).
|
||||||
'$yap_system_flag'(occurs_check).
|
|
||||||
'$yap_system_flag'(open_expands_filename).
|
'$yap_system_flag'(open_expands_filename).
|
||||||
'$yap_system_flag'(open_shared_object).
|
'$yap_system_flag'(open_shared_object).
|
||||||
% '$yap_system_flag'(optimise).
|
% '$yap_system_flag'(optimise).
|
||||||
@ -866,7 +754,6 @@ yap_flag(dialect,yap).
|
|||||||
'$yap_system_flag'(toplevel_hook).
|
'$yap_system_flag'(toplevel_hook).
|
||||||
'$yap_system_flag'(toplevel_print_options).
|
'$yap_system_flag'(toplevel_print_options).
|
||||||
'$yap_system_flag'(typein_module).
|
'$yap_system_flag'(typein_module).
|
||||||
'$yap_system_flag'(unix).
|
|
||||||
'$yap_system_flag'(unknown).
|
'$yap_system_flag'(unknown).
|
||||||
'$yap_system_flag'(update_semantics).
|
'$yap_system_flag'(update_semantics).
|
||||||
'$yap_system_flag'(user_error).
|
'$yap_system_flag'(user_error).
|
||||||
@ -878,7 +765,6 @@ yap_flag(dialect,yap).
|
|||||||
'$yap_system_flag'(verbose_load).
|
'$yap_system_flag'(verbose_load).
|
||||||
'$yap_system_flag'(verbose_auto_load).
|
'$yap_system_flag'(verbose_auto_load).
|
||||||
'$yap_system_flag'(version).
|
'$yap_system_flag'(version).
|
||||||
'$yap_system_flag'(windows).
|
|
||||||
'$yap_system_flag'(write_strings).
|
'$yap_system_flag'(write_strings).
|
||||||
|
|
||||||
'$show_yap_flag_opts'(V,Out) :-
|
'$show_yap_flag_opts'(V,Out) :-
|
||||||
@ -957,10 +843,6 @@ yap_flag(dialect,yap).
|
|||||||
'$transl_to_rounding_function'(0,toward_zero).
|
'$transl_to_rounding_function'(0,toward_zero).
|
||||||
'$transl_to_rounding_function'(1,down).
|
'$transl_to_rounding_function'(1,down).
|
||||||
|
|
||||||
'$transl_to_trl_types'(0,chars).
|
|
||||||
'$transl_to_trl_types'(1,codes).
|
|
||||||
'$transl_to_trl_types'(2,atom).
|
|
||||||
|
|
||||||
'$yap_flag_show_gc_tracing'(true, _, _, on) :- !.
|
'$yap_flag_show_gc_tracing'(true, _, _, on) :- !.
|
||||||
'$yap_flag_show_gc_tracing'(_, true, _, verbose) :- !.
|
'$yap_flag_show_gc_tracing'(_, true, _, verbose) :- !.
|
||||||
'$yap_flag_show_gc_tracing'(_, _, on, very_verbose) :- !.
|
'$yap_flag_show_gc_tracing'(_, _, on, very_verbose) :- !.
|
||||||
|
@ -364,6 +364,7 @@ thread_exit(Term) :-
|
|||||||
fail.
|
fail.
|
||||||
'$run_at_thread_exit'(Id0) :-
|
'$run_at_thread_exit'(Id0) :-
|
||||||
recorded('$thread_exit_hook',[Id0|Hook],R), erase(R),
|
recorded('$thread_exit_hook',[Id0|Hook],R), erase(R),
|
||||||
|
open('/home/vsc/coutput.txt', append, W), writeln(hook:Hook), close(W),
|
||||||
catch(once(Hook),_,fail),
|
catch(once(Hook),_,fail),
|
||||||
fail.
|
fail.
|
||||||
'$run_at_thread_exit'(_).
|
'$run_at_thread_exit'(_).
|
||||||
@ -374,7 +375,8 @@ thread_at_exit(Goal) :-
|
|||||||
recordz('$thread_exit_hook',[Id0|Goal],_).
|
recordz('$thread_exit_hook',[Id0|Goal],_).
|
||||||
|
|
||||||
current_thread(Id, Status) :-
|
current_thread(Id, Status) :-
|
||||||
thread_property(Id, status(Status)).
|
catch(thread_property(Id, status(Status)),
|
||||||
|
error(existence_error(_,_),_), fail).
|
||||||
|
|
||||||
|
|
||||||
'$thread_id_alias'(Id, Alias) :-
|
'$thread_id_alias'(Id, Alias) :-
|
||||||
|
@ -368,12 +368,12 @@ stream_position_data(Prop, Term, Value) :-
|
|||||||
|
|
||||||
|
|
||||||
'$default_expand'(Expand) :-
|
'$default_expand'(Expand) :-
|
||||||
nb_getval('$open_expands_filename',Expand).
|
get_value('$open_expands_filename',Expand).
|
||||||
|
|
||||||
'$set_default_expand'(true) :- !,
|
'$set_default_expand'(true) :- !,
|
||||||
nb_setval('$open_expands_filename',true).
|
set_value('$open_expands_filename',true).
|
||||||
'$set_default_expand'(false) :- !,
|
'$set_default_expand'(false) :- !,
|
||||||
nb_setval('$open_expands_filename',false).
|
set_value('$open_expands_filename',false).
|
||||||
'$set_default_expand'(V) :- !,
|
'$set_default_expand'(V) :- !,
|
||||||
'$do_error'(domain_error(flag_value,V),yap_flag(open_expands_file_name,X)).
|
'$do_error'(domain_error(flag_value,V),yap_flag(open_expands_file_name,X)).
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user