make zlib load zlib.so
add delete_file/1 as default.
This commit is contained in:
parent
36973f93ba
commit
d59fa6c28b
@ -66,6 +66,7 @@
|
||||
[datime/1,
|
||||
mktime/2,
|
||||
file_property/2,
|
||||
delete_file/1,
|
||||
sleep/1]).
|
||||
|
||||
:- reexport(library(arg),
|
||||
@ -379,4 +380,3 @@ required_predicate(Na/Ar, M) :-
|
||||
).
|
||||
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
ifeq (@PROLOG_SYSTEM@,yap)
|
||||
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
ROOTDIR = $(prefix)
|
||||
@ -35,6 +36,7 @@ LN_S=@LN_S@
|
||||
CC=@CC@
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -D_YAP_NOT_INSTALLED_=1 -I$(srcdir) -I../.. -I$(srcdir)/../../include @CPPFLAGS@
|
||||
MKINDEX=true
|
||||
LIBS=@LIBS@ @ZLIBS@
|
||||
|
||||
|
||||
SO=@SO@
|
||||
@ -72,7 +74,7 @@ CWFLAGS=@CWFLAGS@
|
||||
CMFLAGS=@CMFLAGS@
|
||||
CIFLAGS=
|
||||
CFLAGS=$(COFLAGS) $(CWFLAGS) $(CMFLAGS) $(CIFLAGS) @DEFS@
|
||||
LIBS=@LIBS@ @ZLIBS@
|
||||
LIBS=@LIBS@ @ZLIBS@
|
||||
|
||||
DOCTOTEX=$(PCEHOME)/bin/doc2tex
|
||||
PLTOTEX=$(PCEHOME)/bin/pl2tex
|
||||
|
@ -13,6 +13,10 @@
|
||||
:- use_module(library(socket)).
|
||||
:- use_module(library(debug)).
|
||||
|
||||
:- expects_dialect(swi).
|
||||
:- assert(system:swi_io).
|
||||
|
||||
|
||||
test_zlib :-
|
||||
run_tests([ zlib
|
||||
]).
|
||||
@ -27,7 +31,7 @@ test(gunzip,
|
||||
]) :-
|
||||
gzopen('plunit-tmp.gz', read, ZIn),
|
||||
call_cleanup(read_stream_to_codes(ZIn, Codes0), close(ZIn)),
|
||||
read_file_to_codes('test_zlib.pl', Codes1),
|
||||
myread_file_to_codes('test_zlib.pl', Codes1),
|
||||
Codes0 == Codes1.
|
||||
|
||||
% gzip: Can gunzip read our compressed file
|
||||
@ -35,11 +39,11 @@ test(gunzip,
|
||||
test(gzip,
|
||||
[ cleanup(delete_file('plunit-tmp.gz'))
|
||||
]) :-
|
||||
read_file_to_codes('test_zlib.pl', Codes),
|
||||
myread_file_to_codes('test_zlib.pl', Codes),
|
||||
gzopen('plunit-tmp.gz', write, ZOut),
|
||||
format(ZOut, '~s', [Codes]),
|
||||
close(ZOut),
|
||||
read_file_to_codes(pipe('gunzip < plunit-tmp.gz'), Codes1),
|
||||
myread_file_to_codes(pipe('gunzip < plunit-tmp.gz'), Codes1),
|
||||
Codes == Codes1.
|
||||
|
||||
% deflate: test read/write of deflate format
|
||||
@ -47,7 +51,7 @@ test(gzip,
|
||||
test(deflate,
|
||||
[ cleanup(delete_file('plunit-tmp.z'))
|
||||
]) :-
|
||||
read_file_to_codes('test_zlib.pl', Codes),
|
||||
myread_file_to_codes('test_zlib.pl', Codes),
|
||||
open('plunit-tmp.z', write, Out),
|
||||
zopen(Out, ZOut, []),
|
||||
format(ZOut, '~s', [Codes]),
|
||||
@ -198,7 +202,9 @@ get_data(ZIn, N) :-
|
||||
* UTIL *
|
||||
*******************************/
|
||||
|
||||
read_file_to_codes(File, Codes) :-
|
||||
myread_file_to_codes(File, Codes) :-
|
||||
open(File, read, In),
|
||||
call_cleanup(read_stream_to_codes(In, Codes), close(In)).
|
||||
|
||||
:- retract(system:swi_io).
|
||||
|
||||
|
Reference in New Issue
Block a user