<HTML> <HEAD> <!-- Created by texi2html 1.56k + clip patches and <A href="http://www.clip.dia.fi.upm.es/Software">lpdoc</A> from ciao.texi on 28 January 2007 --> <LINK rel="stylesheet" href="ciao.css" type="text/css"> <TITLE>The Ciao Prolog System - Fast reading and writing of terms</TITLE> </HEAD> <BODY> Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_74.html">previous</A>, <A HREF="ciao_76.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>. <P><HR><P> <H1><A NAME="SEC323" HREF="ciao_toc.html#TOC323">Fast reading and writing of terms</A></H1> <P> <A NAME="IDX4482"></A> <P> <STRONG>Author(s):</STRONG> Daniel Cabeza, Oscar Portela Arjona. <P> <STRONG>Version:</STRONG> 1.10#7 (2006/4/26, 19:22:13 CEST) <P> <STRONG>Version of last change:</STRONG> 1.7#16 (2000/8/29, 13:44:18 CEST) <P> This library provides predicates to support reading / writing of terms on a format designed to be handled on read faster than standard representation. <UL> <LI><A HREF="ciao_75.html#SEC324">Usage and interface (fastrw)</A> <LI><A HREF="ciao_75.html#SEC325">Documentation on exports (fastrw)</A> <LI><A HREF="ciao_75.html#SEC326">Known bugs and planned improvements (fastrw)</A> </UL> <H2><A NAME="SEC324" HREF="ciao_toc.html#TOC324">Usage and interface (<CODE>fastrw</CODE>)</A></H2> <div class="cartouche"> <UL> <LI><STRONG>Library usage:</STRONG> <CODE>:- use_module(library(fastrw)).</CODE> <LI><STRONG>Exports:</STRONG> <UL> <LI><EM>Predicates:</EM> <A NAME="IDX4483"></A> <CODE>fast_read/1</CODE>, <A NAME="IDX4484"></A> <CODE>fast_write/1</CODE>, <A NAME="IDX4485"></A> <CODE>fast_read/2</CODE>, <A NAME="IDX4486"></A> <CODE>fast_write/2</CODE>, <A NAME="IDX4487"></A> <CODE>fast_write_to_string/3</CODE>. </UL> <LI><STRONG>Other modules used:</STRONG> <UL> <LI><EM>System library modules:</EM> <A NAME="IDX4488"></A> <CODE>dict</CODE>. </UL> </UL> </div class="cartouche"> <H2><A NAME="SEC325" HREF="ciao_toc.html#TOC325">Documentation on exports (<CODE>fastrw</CODE>)</A></H2> <P> <A NAME="IDX4489"></A> <A NAME="IDX4490"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>fast_read/1:</B> <DD><A NAME="IDX4491"></A> <P> <CODE>fast_read(Term)</CODE> <P> The next term is read from current standard input and is unified with <CODE>Term</CODE>. The syntax of the term must agree with fast_read / fast_write format. If the end of the input has been reached, <CODE>Term</CODE> is unified with the term 'end_of_file'. Further calls to <A NAME="IDX4492"></A> <CODE>fast_read/1</CODE> will then cause an error. </DL> <P> <A NAME="IDX4493"></A> <A NAME="IDX4494"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>fast_write/1:</B> <DD><A NAME="IDX4495"></A> <P> <CODE>fast_write(Term)</CODE> <P> Output <CODE>Term</CODE> in a way that <A NAME="IDX4496"></A> <CODE>fast_read/1</CODE> and <A NAME="IDX4497"></A> <CODE>fast_read/2</CODE> will be able to read it back. </DL> <P> <A NAME="IDX4498"></A> <A NAME="IDX4499"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>fast_read/2:</B> <DD><A NAME="IDX4500"></A> <P> <CODE>fast_read(Stream, Term)</CODE> <P> The next term is read from <CODE>Stream</CODE> and unified with <CODE>Term</CODE>. The syntax of the term must agree with fast_read / fast_write format. If the end of the input has been reached, <CODE>Term</CODE> is unified with the term 'end_of_file'. Further calls to <A NAME="IDX4501"></A> <CODE>fast_read/2</CODE> will then cause an error. </DL> <P> <A NAME="IDX4502"></A> <A NAME="IDX4503"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>fast_write/2:</B> <DD><A NAME="IDX4504"></A> <P> <CODE>fast_write(Stream, Term)</CODE> <P> Output <CODE>Term</CODE> to <CODE>Stream</CODE> in a way that <A NAME="IDX4505"></A> <CODE>fast_read/1</CODE> and <A NAME="IDX4506"></A> <CODE>fast_read/2</CODE> will be able to read it back. </DL> <P> <A NAME="IDX4507"></A> <A NAME="IDX4508"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>fast_write_to_string/3:</B> <DD><A NAME="IDX4509"></A> <P> No further documentation available for this predicate. </DL> <H2><A NAME="SEC326" HREF="ciao_toc.html#TOC326">Known bugs and planned improvements (<CODE>fastrw</CODE>)</A></H2> <UL> <LI> Both <A NAME="IDX4510"></A> <CODE>fast_read/2</CODE> and <A NAME="IDX4511"></A> <CODE>fast_write/2</CODE> simply set the current output/input and call <A NAME="IDX4512"></A> <CODE>fast_read/1</CODE> and <A NAME="IDX4513"></A> <CODE>fast_write/1</CODE>. Therefore, in the event an error hapens during its execution, the current input / output streams may be left pointing to the <CODE>Stream</CODE> </UL> <P><HR><P> Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_74.html">previous</A>, <A HREF="ciao_76.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>. </BODY> </HTML>