<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 - Low level interface library to Tcl/Tk</TITLE> </HEAD> <BODY> Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_125.html">previous</A>, <A HREF="ciao_127.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="SEC541" HREF="ciao_toc.html#TOC541">Low level interface library to Tcl/Tk</A></H1> <P> <A NAME="IDX6065"></A> <P> <STRONG>Author(s):</STRONG> Montse Iglesias Urraca. <P> <STRONG>Version:</STRONG> 1.10#7 (2006/4/26, 19:22:13 CEST) <P> <STRONG>Version of last change:</STRONG> 1.9#348 (2004/6/8, 12:6:40 CEST) <P> The <A NAME="IDX6066"></A> <CODE>tcltk_low_level</CODE> library defines the low level interface used by the <A NAME="IDX6067"></A> <CODE>tcltk</CODE> library. Essentially it includes all the code related directly to the handling of sockets and processes. This library should normally not be used directly by user programs, which use <A NAME="IDX6068"></A> <CODE>tcltk</CODE> instead. On the other hand in some cases it may be useful to undertand how this library works in order to understand possible problems in programs that use the <A NAME="IDX6069"></A> <CODE>tcltk</CODE> library. <UL> <LI><A HREF="ciao_126.html#SEC542">Usage and interface (tcltk_low_level)</A> <LI><A HREF="ciao_126.html#SEC543">Documentation on exports (tcltk_low_level)</A> <LI><A HREF="ciao_126.html#SEC544">Documentation on internals (tcltk_low_level)</A> </UL> <H2><A NAME="SEC542" HREF="ciao_toc.html#TOC542">Usage and interface (<CODE>tcltk_low_level</CODE>)</A></H2> <div class="cartouche"> <UL> <LI><STRONG>Library usage:</STRONG> <CODE>:- use_module(library(tcltk_low_level)).</CODE> <LI><STRONG>Exports:</STRONG> <UL> <LI><EM>Predicates:</EM> <A NAME="IDX6070"></A> <CODE>new_interp/1</CODE>, <A NAME="IDX6071"></A> <CODE>new_interp/2</CODE>, <A NAME="IDX6072"></A> <CODE>new_interp_file/2</CODE>, <A NAME="IDX6073"></A> <CODE>tcltk/2</CODE>, <A NAME="IDX6074"></A> <CODE>tcltk_raw_code/2</CODE>, <A NAME="IDX6075"></A> <CODE>receive_result/2</CODE>, <A NAME="IDX6076"></A> <CODE>send_term/2</CODE>, <A NAME="IDX6077"></A> <CODE>receive_event/2</CODE>, <A NAME="IDX6078"></A> <CODE>receive_list/2</CODE>, <A NAME="IDX6079"></A> <CODE>receive_confirm/2</CODE>, <A NAME="IDX6080"></A> <CODE>delete/1</CODE>. </UL> <LI><STRONG>Other modules used:</STRONG> <UL> <LI><EM>System library modules:</EM> <A NAME="IDX6081"></A> <CODE>terms</CODE>, <A NAME="IDX6082"></A> <CODE>sockets/sockets</CODE>, <A NAME="IDX6083"></A> <CODE>system</CODE>, <A NAME="IDX6084"></A> <CODE>write</CODE>, <A NAME="IDX6085"></A> <CODE>read</CODE>, <A NAME="IDX6086"></A> <CODE>strings</CODE>, <A NAME="IDX6087"></A> <CODE>lists</CODE>, <A NAME="IDX6088"></A> <CODE>format</CODE>. </UL> </UL> </div class="cartouche"> <H2><A NAME="SEC543" HREF="ciao_toc.html#TOC543">Documentation on exports (<CODE>tcltk_low_level</CODE>)</A></H2> <P> <A NAME="IDX6089"></A> <A NAME="IDX6090"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>new_interp/1:</B> <DD><A NAME="IDX6091"></A> <P> <STRONG>Usage:</STRONG> <CODE>new_interp(-TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Creates two sockets to connect to the <EM>wish</EM> process, the term socket and the event socket, and opens a pipe to process <EM>wish</EM> in a new shell. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>-TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6092"></A> <A NAME="IDX6093"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>new_interp/2:</B> <DD><A NAME="IDX6094"></A> <P> <STRONG>Usage:</STRONG> <CODE>new_interp(-TclInterpreter, +Options)</CODE> <UL> <LI><EM>Description:</EM> Creates two sockets, the term socket and the event socket, and opens a pipe to process <EM>wish</EM> in a new shell invoked with the <CODE>Options</CODE>. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>-TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) <CODE>+Options</CODE> is currently instantiated to an atom. (<CODE>term_typing:atom/1</CODE>) </UL> </DL> <P> <A NAME="IDX6095"></A> <A NAME="IDX6096"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>new_interp_file/2:</B> <DD><A NAME="IDX6097"></A> <P> <STRONG>Usage:</STRONG> <CODE>new_interp_file(+FileName, -TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Creates two sockets, the term socket and the event socket, and opens a pipe to process <EM>wish</EM> in a new shell invoked with a <CODE>FileName</CODE>. <CODE>FileName</CODE> is treated as a name of a sript file <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+FileName</CODE> is a string (a list of character codes). (<CODE>basic_props:string/1</CODE>) <CODE>-TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6098"></A> <A NAME="IDX6099"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>tcltk/2:</B> <DD><A NAME="IDX6100"></A> <P> <STRONG>Usage:</STRONG> <CODE>tcltk(+Code, +TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Sends the <CODE>Code</CODE> converted to string to the <CODE>TclInterpreter</CODE> <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+Code</CODE> is a <EM>Tcl</EM> command. (<CODE>tcltk_low_level:tclCommand/1</CODE>) <CODE>+TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6101"></A> <A NAME="IDX6102"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>tcltk_raw_code/2:</B> <DD><A NAME="IDX6103"></A> <P> <STRONG>Usage:</STRONG> <CODE>tcltk_raw_code(+String, +TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Sends the tcltk code items of the <CODE>Stream</CODE> to the <CODE>TclInterpreter</CODE> <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+String</CODE> is a string (a list of character codes). (<CODE>basic_props:string/1</CODE>) <CODE>+TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6104"></A> <A NAME="IDX6105"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>receive_result/2:</B> <DD><A NAME="IDX6106"></A> <P> <STRONG>Usage:</STRONG> <CODE>receive_result(-Result, +TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Receives the <CODE>Result</CODE> of the last <EM>TclCommand</EM> into the <CODE>TclInterpreter</CODE>. If the <EM>TclCommand</EM> is not correct the <EM>wish</EM> process is terminated and a message appears showing the error <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>-Result</CODE> is a string (a list of character codes). (<CODE>basic_props:string/1</CODE>) <CODE>+TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6107"></A> <A NAME="IDX6108"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>send_term/2:</B> <DD><A NAME="IDX6109"></A> <P> <STRONG>Usage:</STRONG> <CODE>send_term(+String, +TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Sends the goal executed to the <CODE>TclInterpreter</CODE>. <CODE>String</CODE> has the predicate with unified variables <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+String</CODE> is a string (a list of character codes). (<CODE>basic_props:string/1</CODE>) <CODE>+TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6110"></A> <A NAME="IDX6111"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>receive_event/2:</B> <DD><A NAME="IDX6112"></A> <P> <STRONG>Usage:</STRONG> <CODE>receive_event(-Event, +TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Receives the <CODE>Event</CODE> from the event socket of the <CODE>TclInterpreter</CODE>. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>-Event</CODE> is a list. (<CODE>basic_props:list/1</CODE>) <CODE>+TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6113"></A> <A NAME="IDX6114"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>receive_list/2:</B> <DD><A NAME="IDX6115"></A> <P> <STRONG>Usage:</STRONG> <CODE>receive_list(-List, +TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Receives the <CODE>List</CODE> from the event socket of the <CODE>TclInterpreter</CODE>.The <CODE>List</CODE> has all the predicates that have been inserted from Tcl/Tk with the command prolog_event. It is a list of terms. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>-List</CODE> is a list. (<CODE>basic_props:list/1</CODE>) <CODE>+TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6116"></A> <A NAME="IDX6117"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>receive_confirm/2:</B> <DD><A NAME="IDX6118"></A> <P> <STRONG>Usage:</STRONG> <CODE>receive_confirm(-String, +TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Receives the <CODE>String</CODE> from the event socket of the <CODE>TclInterpreter</CODE> when a term inserted into the event queue is managed. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>-String</CODE> is a string (a list of character codes). (<CODE>basic_props:string/1</CODE>) <CODE>+TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <P> <A NAME="IDX6119"></A> <A NAME="IDX6120"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>delete/1:</B> <DD><A NAME="IDX6121"></A> <P> <STRONG>Usage:</STRONG> <CODE>delete(+TclInterpreter)</CODE> <UL> <LI><EM>Description:</EM> Terminates the <EM>wish</EM> process and closes the pipe, term socket and event socket. Deletes the interpreter <CODE>TclInterpreter</CODE> from the system <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+TclInterpreter</CODE> is a reference to a <EM>Tcl</EM> interpreter. (<CODE>tcltk_low_level:tclInterpreter/1</CODE>) </UL> </DL> <H2><A NAME="SEC544" HREF="ciao_toc.html#TOC544">Documentation on internals (<CODE>tcltk_low_level</CODE>)</A></H2> <P> <A NAME="IDX6122"></A> <A NAME="IDX6123"></A> <DL> <DT><span class="define">PREDICATE:</span> <B>core/1:</B> <DD><A NAME="IDX6124"></A> <P> <STRONG>Usage:</STRONG> <CODE>core(+String)</CODE> <UL> <LI><EM>Description:</EM> <A NAME="IDX6125"></A> <CODE>core/1</CODE> is a set of facts which contain <CODE>String</CODE>s to be sent to the Tcl/Tk interpreter on startup. They implement miscelaneous Tcl/Tk procedures which are used by the Tcl/Tk interface. <LI><EM>Call and exit should be <EM>compatible</EM> with:</EM> <CODE>+String</CODE> is a string (a list of character codes). (<CODE>basic_props:string/1</CODE>) </UL> </DL> <P><HR><P> Go to the <A HREF="ciao_1.html">first</A>, <A HREF="ciao_125.html">previous</A>, <A HREF="ciao_127.html">next</A>, <A HREF="ciao_241.html">last</A> section, <A HREF="ciao_toc.html">table of contents</A>. </BODY> </HTML>