readutil library
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1681 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
aa361faba0
commit
d7b73e6886
62
library/readutil.yap
Normal file
62
library/readutil.yap
Normal file
@ -0,0 +1,62 @@
|
||||
/*************************************************************************
|
||||
* *
|
||||
* YAP Prolog *
|
||||
* *
|
||||
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
||||
* *
|
||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
||||
* *
|
||||
**************************************************************************
|
||||
* *
|
||||
* File: readutil.yap *
|
||||
* Last rev: 5/12/99 *
|
||||
* mods: *
|
||||
* comments: SWI compatible read utilities *
|
||||
* *
|
||||
*************************************************************************/
|
||||
|
||||
:- module(readutil, [
|
||||
read_line_to_codes/2,
|
||||
read_line_to_codes/3,
|
||||
read_stream_to_codes/2,
|
||||
read_stream_to_codes/3,
|
||||
read_file_to_codes/2,
|
||||
read_file_to_codes/3,
|
||||
read_file_to_terms/2,
|
||||
read_file_to_terms/3
|
||||
]).
|
||||
|
||||
|
||||
read_stream_to_codes(Stream, Codes) :-
|
||||
read_stream_to_codes(Stream, Codes, []).
|
||||
|
||||
read_file_to_codes(File, Codes) :-
|
||||
open(File, read, Stream),
|
||||
read_stream_to_codes(Stream, Codes, []),
|
||||
close(Stream).
|
||||
|
||||
read_file_to_codes(File, Codes, _) :-
|
||||
open(File, read, Stream),
|
||||
read_stream_to_codes(Stream, Codes, []),
|
||||
close(Stream).
|
||||
|
||||
read_file_to_codes(File, Codes) :-
|
||||
open(File, read, Stream),
|
||||
read_stream_to_terms(Stream, Codes, []),
|
||||
close(Stream).
|
||||
|
||||
read_file_to_terms(File, Codes, _) :-
|
||||
open(File, read, Stream),
|
||||
read_stream_to_terms(Stream, Codes, []),
|
||||
close(Stream).
|
||||
|
||||
read_file_to_terms(File, Codes) :-
|
||||
open(File, read, Stream),
|
||||
read_stream_to_terms(Stream, Codes, []),
|
||||
close(Stream).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user