fix pl-tai

This commit is contained in:
Vitor Santos Costa 2011-03-09 13:05:03 +00:00
parent 752fa4fc53
commit 5418f55d74
78 changed files with 344 additions and 419 deletions

View File

@ -210,6 +210,7 @@ IOLIB_SOURCES=$(srcdir)/packages/PLStream/pl-buffer.c $(srcdir)/packages/PLStrea
$(srcdir)/packages/PLStream/pl-rl.c \
$(srcdir)/packages/PLStream/pl-stream.c $(srcdir)/packages/PLStream/pl-string.c \
$(srcdir)/packages/PLStream/pl-table.c \
$(srcdir)/packages/PLStream/pl-tai.c \
$(srcdir)/packages/PLStream/pl-text.c \
$(srcdir)/packages/PLStream/pl-write.c \
$(srcdir)/packages/PLStream/pl-yap.c @ENABLE_WINCONSOLE@ $(srcdir)/packages/PLStream/popen.c $(srcdir)/packages/PLStream/windows/windows.c
@ -328,7 +329,7 @@ IOLIB_OBJECTS=pl-buffer.o pl-codelist.o pl-ctype.o pl-dtoa.o pl-error.o \
pl-read.o \
pl-rl.o \
pl-stream.o pl-string.o pl-table.o \
pl-text.o pl-utf8.o \
pl-tai.o pl-text.o pl-utf8.o \
pl-write.o \
pl-yap.o @ENABLE_WINCONSOLE@ uxnt.o
@ -351,6 +352,16 @@ ENGINE_OBJECTS = \
write.o \
blobs.o swi.o ypstdio.o $(IOLIB_OBJECTS) @MPI_OBJS@
LIBTAI_OBJECTS = \
tai_add.o tai_now.o tai_pack.o \
tai_sub.o tai_unpack.o taia_add.o taia_approx.o \
taia_fmtfrac.o taia_frac.o taia_half.o taia_less.o \
taia_now.o taia_pack.o taia_sub.o taia_tai.o taia_unpack.o \
caldate_fmt.o caldate_scan.o caldate_fmjd.o caldate_mjd.o \
caldate_norm.o caldate_ster.o leapsecs_read.o \
leapsecs_init.o leapsecs_add.o leapsecs_sub.o caltime_fmt.o \
caltime_scan.o caltime_tai.o caltime_utc.o
C_INTERFACE_OBJECTS = \
load_foreign.o load_dl.o load_dld.o load_dyld.o \
load_none.o load_aout.o load_aix.o load_dll.o load_shl.o \
@ -548,76 +559,80 @@ pl-ntcon.o: $(srcdir)/console/LGPL/pl-ntcon.c config.h
$(CC) -c $(CFLAGS) -I$(srcdir)/include $(srcdir)/console/LGPL/pl-ntcon.c -o $@
pl-ntconsole.o: $(srcdir)/console/LGPL/pl-ntconsole.c config.h
$(CC) -c $(CFLAGS) -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/packages/PLStream $(srcdir)/console/LGPL/pl-ntconsole.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir) -I$(srcdir)/include -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/console/LGPL/pl-ntconsole.c -o $@
pl-ntmain.o: $(srcdir)/console/LGPL/pl-ntmain.c config.h
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream $(srcdir)/console/LGPL/pl-ntmain.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ < $(srcdir)/console/LGPL/pl-ntmain.c -o $@
pl-buffer.o: $(srcdir)/packages/PLStream/pl-buffer.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-buffer.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-buffer.c -o $@
pl-codelist.o: $(srcdir)/packages/PLStream/pl-codelist.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-codelist.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-codelist.c -o $@
pl-ctype.o: $(srcdir)/packages/PLStream/pl-ctype.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-ctype.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-ctype.c -o $@
pl-dtoa.o: $(srcdir)/packages/PLStream/pl-dtoa.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-dtoa.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-dtoa.c -o $@
pl-error.o: $(srcdir)/packages/PLStream/pl-error.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-error.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-error.c -o $@
pl-file.o: $(srcdir)/packages/PLStream/pl-file.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-file.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-file.c -o $@
pl-files.o: $(srcdir)/packages/PLStream/pl-files.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-files.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-files.c -o $@
pl-fmt.o: $(srcdir)/packages/PLStream/pl-fmt.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-fmt.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-fmt.c -o $@
pl-glob.o: $(srcdir)/packages/PLStream/pl-glob.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-glob.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-glob.c -o $@
pl-option.o: $(srcdir)/packages/PLStream/pl-option.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-option.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-option.c -o $@
pl-os.o: $(srcdir)/packages/PLStream/pl-os.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-os.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-os.c -o $@
pl-privitf.o: $(srcdir)/packages/PLStream/pl-privitf.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-privitf.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-privitf.c -o $@
pl-rl.o: $(srcdir)/packages/PLStream/pl-rl.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-rl.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-rl.c -o $@
pl-read.o: $(srcdir)/packages/PLStream/pl-read.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-read.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-read.c -o $@
pl-stream.o: $(srcdir)/packages/PLStream/pl-stream.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-stream.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-stream.c -o $@
pl-string.o: $(srcdir)/packages/PLStream/pl-string.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-string.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-string.c -o $@
pl-table.o: $(srcdir)/packages/PLStream/pl-table.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-table.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-table.c -o $@
pl-text.o: $(srcdir)/packages/PLStream/pl-text.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-text.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-text.c -o $@
pl-utf8.o: $(srcdir)/packages/PLStream/pl-utf8.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-utf8.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-utf8.c -o $@
pl-write.o: $(srcdir)/packages/PLStream/pl-write.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-write.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-write.c -o $@
pl-yap.o: $(srcdir)/packages/PLStream/pl-yap.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/pl-yap.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-yap.c -o $@
pl-tai.o: $(srcdir)/packages/PLStream/pl-tai.c
( cd packages/PLStream/libtai ; make )
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/pl-tai.c -o $@
uxnt.o: $(srcdir)/packages/PLStream/windows/uxnt.c
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream -I$(srcdir)/packages/PLStream/windows $(srcdir)/packages/PLStream/windows/uxnt.c -o $@
$(CC) -c $(CFLAGS) -I$(srcdir)/include -I$(srcdir) -I$(srcdir)/packages/PLStream @EXTRA_INCLUDES_FOR_WIN32@ $(srcdir)/packages/PLStream/windows/uxnt.c -o $@
# default rule
%.o : $(srcdir)/C/%.c config.h
@ -657,7 +672,6 @@ all: startup.yss
@INSTALL_DLLS@ (cd packages/sgml; $(MAKE))
@USE_MINISAT@ (cd packages/CLPBN/clpbn/bp ; $(MAKE))
@USE_MINISAT@ (cd packages/swi-minisat2/C; $(MAKE))
@INSTALL_DLLS@ (cd packages/tai; $(MAKE))
@INSTALL_DLLS@ (cd packages/zlib; $(MAKE))
@ENABLE_CPLINT@ (cd packages/cplint/approx/simplecuddLPADs; $(MAKE))
@ENABLE_CPLINT@ (cd packages/cplint; $(MAKE))
@ -675,13 +689,13 @@ pl-yap@EXEC_SUFFIX@: $(PLCONS_OBJECTS) LGPL/swi_console/plterm.dll packages/PLST
(cd LGPL/swi_console; $(MAKE))
$(MPI_CC) $(EXECUTABLE_CFLAGS) $(LDFLAGS) -o pl-yap $(PLCONS_OBJECTS) LGPL/swi_console/plterm.dll packages/PLSTream/libplstream.dll @YAPLIB@ $(LIBS) @MPI_LIBS@
libYap.a: $(LIB_OBJECTS)
libYap.a: $(LIB_OBJECTS)
-rm -f libYap.a
$(AR) rc libYap.a $(LIB_OBJECTS)
$(AR) rc libYap.a $(addprefix packages/PLStream/libtai/,$(LIBTAI_OBJECTS)) $(LIB_OBJECTS)
$(RANLIB) libYap.a
@DYNYAPLIB@: $(LIB_OBJECTS)
@YAPLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS) $(LDFLAGS) $(SONAMEFLAG)
@YAPLIB_LD@ -o @YAPLIB@ packages/PLStream/libtai/libtai.a $(LIB_OBJECTS) $(LIBS) $(LDFLAGS) $(SONAMEFLAG)
install: install_bin install_data
@ -713,7 +727,6 @@ install_unix: startup.yss libYap.a
@INSTALL_DLLS@ (cd packages/sgml; $(MAKE) install)
@INSTALL_DLLS@ (cd packages/RDF; $(MAKE) install)
@INSTALL_DLLS@ (cd packages/semweb; $(MAKE) install)
@INSTALL_DLLS@ (cd packages/tai; $(MAKE) install)
@INSTALL_DLLS@ (cd packages/zlib; $(MAKE) @ZLIB_INSTALL@)
@INSTALL_DLLS@ (cd packages/CLPBN/clpbn/bp ; $(MAKE) install)
@USE_MINISAT@ (cd packages/swi-minisat2/C; $(MAKE) install)
@ -759,7 +772,6 @@ install_win32: startup.yss
@ENABLE_WINCONSOLE@ (cd LGPL/swi_console; $(MAKE) install)
@INSTALL_MATLAB@ (cd library/matlab; $(MAKE) install)
(cd library/tries; $(MAKE) install)
(cd packages/tai; $(MAKE) install)
(cd packages/clib; $(MAKE) install)
(cd packages/plunit; $(MAKE) install)
(cd packages/http; $(MAKE) install)
@ -825,7 +837,7 @@ clean: clean_docs
@INSTALL_DLLS@ (cd packages/sgml; $(MAKE) clean)
@USE_MINISAT@ (cd packages/swi-minisat2; $(MAKE) clean)
@USE_MINISAT@ (cd packages/CLPBN/clpbn/bp; $(MAKE) clean)
@INSTALL_DLLS@ (cd packages/tai; $(MAKE) clean)
@INSTALL_DLLS@ (cd packages/tai/libtai; $(MAKE) clean)
@INSTALL_DLLS@ (cd packages/zlib; $(MAKE) clean)
@ENABLE_CPLINT@ (cd packages/cplint/approx/simplecuddLPADs; $(MAKE) clean)
@ENABLE_CPLINT@ (cd packages/cplint; $(MAKE) clean)

0
config.guess vendored Normal file → Executable file
View File

0
config.sub vendored Normal file → Executable file
View File

474
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -565,12 +565,14 @@ then
then
AC_CHECK_LIB(ws2_32,main)
EXTRA_LIBS_FOR_DLLS="-lws2_32 \$(abs_top_builddir)/yap.dll"
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
elif test "$target_os" = "cygwin"
then
CC="${CC} -mno-cygwin"
CXX="${CXX} -mno-cygwin"
AC_CHECK_LIB(wsock32,main)
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
else
AC_CHECK_LIB(wsock32,main)
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
@ -597,6 +599,7 @@ then
ENABLE_WINCONSOLE="#"
LIBS="-lcygwin"
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
fi
else
INSTALL_COMMAND="install_unix"
@ -1510,6 +1513,7 @@ AC_SUBST(LAMOBJS)
AC_SUBST(MAX_WORKERS)
AC_SUBST(STATIC_MODE)
AC_SUBST(ENABLE_WINCONSOLE)
AC_SUBST(EXTRA_INCLUDES_FOR_WIN32)
AC_SUBST(USE_CUDD)
AC_SUBST(CUDD_LDFLAGS)
@ -1952,8 +1956,8 @@ mkdir -p packages/jpl/src/java/jpl/test
mkdir -p packages/jpl/examples
mkdir -p packages/jpl/examples/java
mkdir -p packages/meld
mkdir -p packages/tai
mkdir -p packages/tai/libtai
mkdir -p packages/PLStream
mkdir -p packages/PLStream/libtai
mkdir -p packages/plunit
mkdir -p packages/ProbLog
mkdir -p packages/ProbLog/simplecudd
@ -1988,8 +1992,7 @@ AC_CONFIG_FILES([packages/cplint/Makefile])
AC_CONFIG_FILES([packages/cplint/approx/simplecuddLPADs/Makefile])
AC_CONFIG_FILES([packages/http/Makefile])
AC_CONFIG_FILES([packages/meld/Makefile])
AC_CONFIG_FILES([packages/tai/Makefile])
AC_CONFIG_FILES([packages/tai/libtai/Makefile])
AC_CONFIG_FILES([packages/PLStream/libtai/Makefile])
AC_CONFIG_FILES([packages/plunit/Makefile])
AC_CONFIG_FILES([packages/ProbLog/Makefile ])
AC_CONFIG_FILES([packages/RDF/Makefile])

View File

@ -97,8 +97,6 @@
:- set_prolog_flag(user_flags,silent).
:- load_foreign_files(['pl-tai'], [], install).
% Time is given as a float in SWI-Prolog.
swi_get_time(FSecs) :- datime(Datime), mktime(Datime, Secs), FSecs is Secs*1.0.
@ -120,128 +118,6 @@ goal_expansion(directory_files(A,B),system:swi_directory_files(A,B)).
goal_expansion(exists_file(A), system:swi_exists_file(A)).
goal_expansion(exists_directory(A), system:swi_exists_directory(A)).
:- dynamic swi_io/0.
goal_expansion(open(A,B,C,D),system:swi_open(A,B,C,D)) :- swi_io.
goal_expansion(open(A,B,C), system:swi_open(A,B,C)) :- swi_io.
goal_expansion(close(A), system:swi_close(A)) :- swi_io.
goal_expansion(close(A,B), system:swi_close(A,B)) :- swi_io.
goal_expansion(set_input(A), system:swi_set_input(A)) :- swi_io.
goal_expansion(set_output(A), system:swi_set_output(A)) :- swi_io.
goal_expansion(current_input(A), system:swi_current_input(A)) :- swi_io.
goal_expansion(current_output(A), system:swi_current_output(A)) :- swi_io.
goal_expansion(get_code(A,B),system:swi_get_code(A,B)) :- swi_io.
goal_expansion(get_code(A), system:swi_get_code(A)) :- swi_io.
goal_expansion(get_char(A,B),system:swi_get_char(A,B)) :- swi_io.
goal_expansion(get_char(A), system:swi_get_char(A)) :- swi_io.
goal_expansion(get_byte(A,B),system:swi_get_byte(A,B)) :- swi_io.
goal_expansion(get_byte(A), system:swi_get_byte(A)) :- swi_io.
goal_expansion(peek_code(A,B),system:swi_peek_code(A,B)) :- swi_io.
goal_expansion(peek_code(A), system:swi_peek_code(A)) :- swi_io.
goal_expansion(peek_char(A,B),system:swi_peek_char(A,B)) :- swi_io.
goal_expansion(peek_char(A), system:swi_peek_char(A)) :- swi_io.
goal_expansion(peek_byte(A,B),system:swi_peek_byte(A,B)) :- swi_io.
goal_expansion(peek_byte(A), system:swi_peek_byte(A)) :- swi_io.
goal_expansion(put_byte(A,B),system:swi_put_byte(A,B)) :- swi_io.
goal_expansion(put_byte(A), system:swi_put_byte(A)) :- swi_io.
goal_expansion(put_code(A,B),system:swi_put_code(A,B)) :- swi_io.
goal_expansion(put_code(A), system:swi_put_code(A)) :- swi_io.
goal_expansion(put_char(A,B),system:swi_put_char(A,B)) :- swi_io.
goal_expansion(put_char(A), system:swi_put_char(A)) :- swi_io.
goal_expansion(flush_output, system:swi_flush_output).
goal_expansion(flush_output(A), system:swi_flush_output(A)) :- swi_io.
goal_expansion(at_end_of_stream(A), system:swi_at_end_of_stream(A)) :- swi_io.
goal_expansion(at_end_of_stream, system:swi_at_end_of_stream).
goal_expansion(stream_property(A,B),system:swi_stream_property(A,B)) :- swi_io.
goal_expansion(set_stream_position(A,B),system:swi_set_stream_position(A,B)) :- swi_io.
/* edinburgh IO */
goal_expansion(see(A), system:swi_see(A)) :- swi_io.
goal_expansion(seen, system:swi_seen).
goal_expansion(seeing(A), system:swi_seeing(A)) :- swi_io.
goal_expansion(tell(A), system:swi_tell(A)) :- swi_io.
goal_expansion(append(A), system:swi_append(A)) :- swi_io.
goal_expansion(told, system:swi_told).
goal_expansion(telling(A), system:swi_telling(A)) :- swi_io.
goal_expansion(put(A,B),system:swi_put(A,B)) :- swi_io.
goal_expansion(put(A), system:swi_put(A)) :- swi_io.
goal_expansion(skip(A), system:swi_skip(A)) :- swi_io.
goal_expansion(skip(A,B),system:swi_skip(A,B)) :- swi_io.
goal_expansion(get(A), system:swi_get(A)) :- swi_io.
goal_expansion(get(A,B),system:swi_get(A,B)) :- swi_io.
goal_expansion(get0(A,B),system:swi_get0(A,B)) :- swi_io.
goal_expansion(get0(A), system:swi_get0(A)) :- swi_io.
goal_expansion(ttyflush, system:swi_ttyflush).
goal_expansion(prompt(A,B),system:swi_prompt(A,B)) :- swi_io.
goal_expansion(tab(A,B),system:swi_tab(A,B)) :- swi_io.
goal_expansion(tab(A), system:swi_tab(A)) :- swi_io.
/* Quintus IO */
goal_expansion(byte_count(A,B),system:swi_byte_count(A,B)) :- swi_io.
goal_expansion(character_count(A,B),system:swi_character_count(A,B)) :- swi_io.
goal_expansion(line_count(A,B),system:swi_line_count(A,B)) :- swi_io.
goal_expansion(line_position(A,B),system:swi_line_position(A,B)) :- swi_io.
goal_expansion(open_null_stream(A), system:swi_open_null_stream(A)) :- swi_io.
/* SWI specific */
goal_expansion(is_stream(A), system:swi_is_stream(A)) :- swi_io.
goal_expansion(set_stream(A,B),system:swi_set_stream(A,B)) :- swi_io.
% careful: with_output_to/2 requires setting user_output, and this
% confuses emulation.
goal_expansion(with_output_to(A,B),system:swi_with_output_to(A,NB)) :- swi_io,
expand_goal(B, NB).
goal_expansion(set_prolog_IO(A,B,C), system:swi_set_prolog_IO(A,B,C)) :- swi_io.
goal_expansion(protocol(A), system:swi_protocol(A)) :- swi_io.
goal_expansion(protocola(A), system:swi_protocola(A)) :- swi_io.
goal_expansion(noprotocol, noprotocol).
goal_expansion(protocolling(A), system:swi_protocolling(A)) :- swi_io.
goal_expansion(prompt1(A), system:swi_prompt1(A)) :- swi_io.
goal_expansion(seek(A,B,C,D),system:swi_seek(A,B,C,D)) :- swi_io.
goal_expansion(wait_for_input(A,B,C), system:swi_wait_for_input(A,B,C)) :- swi_io.
goal_expansion(get_single_char(A), system:swi_get_single_char(A)) :- swi_io.
goal_expansion(read_pending_input(A,B,C), system:swi_read_pending_input(A,B,C)) :- swi_io.
goal_expansion(source_location(A,B),system:swi_source_location(A,B)) :- swi_io.
goal_expansion(copy_stream_data(A,B,C), system:swi_copy_stream_data(A,B,C)) :- swi_io.
goal_expansion(copy_stream_data(A,B),system:swi_copy_stream_data(A,B)) :- swi_io.
/* SWI internal */
goal_expansion('$push_input_context', system:'swi_$push_input_context').
goal_expansion('$pop_input_context', system:'swi_$pop_input_context').
goal_expansion('$size_stream'(A,B),system:'swi_$size_stream'(A,B)) :- swi_io.
goal_expansion(access_file(A,B),system:swi_access_file(A,B)) :- swi_io.
goal_expansion(size_file(A,B),system:swi_size_file(A,B)) :- swi_io.
goal_expansion(read_link(A,B,C), system:swi_read_link(A,B,C)) :- swi_io.
goal_expansion(tmp_file(A,B),system:swi_tmp_file(A,B)) :- swi_io.
goal_expansion(tmp_file_stream(A,B,C), system:swi_tmp_file_stream(A,B,C)) :- swi_io.
goal_expansion(delete_file(A), delete_file(A)) :- swi_io.
goal_expansion(delete_directory(A), delete_directory(A)) :- swi_io.
goal_expansion(make_directory(A), make_directory(A)) :- swi_io.
goal_expansion(same_file(A,B),system:swi_same_file(A,B)) :- swi_io.
goal_expansion(rename_file(A,B),system:swi_rename_file(A,B)) :- swi_io.
goal_expansion(file_base_name(A,B),system:swi_file_base_name(A,B)) :- swi_io.
goal_expansion(file_directory_name(A,B),system:swi_file_directory_name(A,B)) :- swi_io.
goal_expansion('$mark_executable'(A), system:'swi_is_absolute_file_name'(A)) :- swi_io.
goal_expansion('$absolute_file_name'(A,B),system:'swi_$absolute_file_name'(A,B)) :- swi_io.
goal_expansion(nl(A),system:swi_nl(A)) :- swi_io.
goal_expansion(nl,system:swi_nl) :- swi_io.
goal_expansion(write(A),write_term(user_output,A,[swi(true)])) :- swi_io.
goal_expansion(write(S,A),write_term(S,A,[swi(true)])) :- swi_io.
goal_expansion(writeq(A),write_term(user_output,A,[swi(true),quoted(true)])) :- swi_io.
goal_expansion(writeq(S,A),write_term(S,A,[swi(true),quoted(true)])) :- swi_io.
goal_expansion(display(A),write_term(user_output,A,[swi(true),ignore_ops(true)])) :- swi_io.
goal_expansion(display(S,A),write_term(S,A,[swi(true),ignore_ops(true),quoted(true)])) :- swi_io.
goal_expansion(write_canonical(A),write_term(user_output,A,[swi(true),ignore_ops(true),quoted(true)])) :- swi_io.
goal_expansion(write_canonical(S,A),write_term(S,A,[swi(true),ignore_ops(true)])) :- swi_io.
goal_expansion(print(A),write_term(user_output,A,[swi(true),portray(true),numbervars(true)])) :- swi_io.
goal_expansion(print(S,A),write_term(S,A,[swi(true),portray(true),numbervars(true)])) :- swi_io.
goal_expansion(write_term(A,Opts),write_term(user_output,A,Opts,[swi(true)|Opts])) :- swi_io.
goal_expansion(write_term(S,A,Opts),write_term(S,A,[swi(true)|Opts])) :- swi_io, \+ member(swi(_), Opts).
goal_expansion(format(A),system:swi_format(user_output,A,[])) :- swi_io.
goal_expansion(format(A,Args),system:swi_format(user_output,A,Args)) :- swi_io.
goal_expansion(format(S,A,Args),system:swi_format(S,A,Args)) :- swi_io.
goal_expansion(writeln(A),system:swi_format(user_output,'~w~n',[A])) :- swi_io.
% make sure we also use
:- user:library_directory(X),
atom(X),

0
library/mpi/examples/mk_gmiconf.awk Normal file → Executable file
View File

0
misc/tkyap Normal file → Executable file
View File

View File

@ -4716,6 +4716,7 @@ init_yap(void)
PL_register_extensions(PL_predicates_from_glob);
PL_register_extensions(PL_predicates_from_write);
PL_register_extensions(PL_predicates_from_read);
PL_register_extensions(PL_predicates_from_tai);
PL_register_extensions(foreigns);
fileerrors = TRUE;
SinitStreams();

View File

@ -63,6 +63,7 @@ LastModifiedFile(const char *file)
if ( statfunc(OsPath(file, tmp), &buf) < 0 )
return (time_t)-1;
fprintf(stderr,"buf.st_mtime=%ld\n",buf.st_mtime);
return buf.st_mtime;
}

View File

@ -840,6 +840,7 @@ extern const PL_extension PL_predicates_from_ctype[];
extern const PL_extension PL_predicates_from_file[];
extern const PL_extension PL_predicates_from_files[];
extern const PL_extension PL_predicates_from_glob[];
extern const PL_extension PL_predicates_from_write[];
extern const PL_extension PL_predicates_from_read[];
extern const PL_extension PL_predicates_from_tai[];
extern const PL_extension PL_predicates_from_write[];

View File

@ -3,9 +3,10 @@
Part of SWI-Prolog
Author: Jan Wielemaker
E-mail: wielemak@science.uva.nl
E-mail: J.Wielemaker@cs.vu.nl
WWW: http://www.swi-prolog.org
Copyright (C): 1985-2007, University of Amsterdam
Copyright (C): 1985-2010, University of Amsterdam
VU University Amsterdam
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -38,23 +39,22 @@ is supposed to give the POSIX standard one.
#include <stdio.h>
#include <ctype.h>
#if defined(__WINDOWS__) || defined (__CYGWIN__) || defined (__MINGW32__)
#define timezone _timezone
#ifndef _POSIX
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#if defined(__WINDOWS__) || defined (__CYGWIN__)
#define timezone _timezone
#ifndef HAVE_VAR_TIMEZONE
#define HAVE_VAR_TIMEZONE
#endif
#define localtime_r(_Time, _Tm) ({ struct tm *___tmp_tm = \
localtime((_Time)); \
if (___tmp_tm) { \
*(_Tm) = *___tmp_tm; \
___tmp_tm = (_Tm); \
} \
___tmp_tm; })
#define asctime_r(_Tm, _Buf) ({ char *___tmp_tm = asctime((_Tm)); \
if (___tmp_tm) \
___tmp_tm = \
strcpy((_Buf),___tmp_tm);\
___tmp_tm; })
#include <time.h>
#else
extern char *tzname[2];
#ifdef HAVE_VAR_TIMEZONE
@ -107,7 +107,7 @@ value is EAST and includes the DST offset.
static int
tz_offset()
{
#if defined(HAVE_VAR_TIMEZONE) || _WIN64 || _WIN32
#ifdef HAVE_VAR_TIMEZONE
do_tzset();
return timezone;
#else
@ -490,9 +490,14 @@ fmt_domain_error(const char *key, int value)
}
static int
fmt_not_implemented(const char *key)
fmt_not_implemented(int c)
{ GET_LD
term_t t = PL_new_term_ref();
char key[3];
key[0] = '%';
key[1] = c;
key[2] = 0;
PL_put_atom_chars(t, key);
@ -575,6 +580,7 @@ format_time(IOSTREAM *fd, const wchar_t *format, ftm *ftm, int posix)
while((c = *format++))
{ int arg = NOARG;
int altO = FALSE;
switch(c)
{ case '%':
@ -651,7 +657,7 @@ format_time(IOSTREAM *fd, const wchar_t *format, ftm *ftm, int posix)
OUT2DIGITS_SPC(fd, ftm->tm.tm_mday);
break;
case 'E': /* alternative format */
return fmt_not_implemented("%E");
return fmt_not_implemented(c);
case 'F': /* ISO 8601 date format */
SUBFORMAT(L"%Y-%m-%d");
break;
@ -720,7 +726,13 @@ format_time(IOSTREAM *fd, const wchar_t *format, ftm *ftm, int posix)
OUTCHR(fd, '\n');
break;
case 'O':
return fmt_not_implemented("%O");
case ':':
if ( format[0] == 'z' )
{ altO = TRUE;
goto fmt_next;
}
return fmt_not_implemented(c);
case 'r': /* The time in a.m./p.m. notation */
SUBFORMAT(L"%I:%M:%S %p"); /* TBD: :-separator locale handling */
break;
@ -798,6 +810,8 @@ format_time(IOSTREAM *fd, const wchar_t *format, ftm *ftm, int posix)
OUTCHR(fd, '-');
}
OUT2DIGITS(fd, min/60);
if ( altO )
OUTCHR(fd, ':');
OUT2DIGITS(fd, min%60);
break;
}
@ -827,6 +841,8 @@ format_time(IOSTREAM *fd, const wchar_t *format, ftm *ftm, int posix)
else
arg = arg*10+(c-'0');
goto fmt_next;
} else
{ return fmt_not_implemented(c);
}
}
break;
@ -939,17 +955,4 @@ BeginPredDefs(tai)
PRED_DEF("date_time_stamp", 2, date_time_stamp, 0)
PRED_DEF("format_time", 3, format_time3, 0)
PRED_DEF("format_time", 4, format_time4, 0)
PRED_DEF("swi_stamp_date_time", 3, stamp_date_time, 0)
PRED_DEF("swi_date_time_stamp", 2, date_time_stamp, 0)
PRED_DEF("swi_format_time", 3, format_time3, 0)
PRED_DEF("swi_format_time", 4, format_time4, 0)
EndPredDefs
#if _YAP_NOT_INSTALLED_
install_t
install(void)
{
PL_register_extensions(PL_predicates_from_tai);
}
#endif

0
packages/clib/demo/cgidemo.pl Normal file → Executable file
View File