Edit file File name : slshfun-13.html Content :<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.69"> <TITLE> SLSH Library Reference (version 2.3.0): SLSH intrinsic functions</TITLE> <LINK HREF="slshfun-12.html" REL=previous> <LINK HREF="slshfun.html#toc13" REL=contents> </HEAD> <BODY> Next <A HREF="slshfun-12.html">Previous</A> <A HREF="slshfun.html#toc13">Contents</A> <HR> <H2><A NAME="s13">13.</A> <A HREF="slshfun.html#toc13">SLSH intrinsic functions</A></H2> <H2><A NAME="slsh_readline_init"></A> <A NAME="ss13.1">13.1</A> <A HREF="slshfun.html#toc13.1"><B>slsh_readline_init</B></A> </H2> <P> <DL> <DT><B> Synopsis </B><DD> <P>Initialize the S-Lang readline routines</P> <DT><B> Usage </B><DD> <P><CODE>slsh_readline_init (String_Type appname)</CODE></P> <DT><B> Description </B><DD> <P>The <CODE>slsh_readline_init</CODE> function is used to initialize the <B>S-Lang</B> readline interface for use by an slsh-based application with name <CODE>appname</CODE>. If defines an intrinsic variable called <CODE>__RL_APP__</CODE> whose value is given by <CODE>appname</CODE>. If the file <CODE>$HOME/.slrlinerc</CODE> file exists, it will be loaded into the interpreter. This file together with the <CODE>__RL_APP__</CODE> variable may be used by the user to customize the interface by, e.g., reading previous history files, etc.</P> <DT><B> See Also </B><DD> <P><CODE>slsh_readline_new, rline_set_history</CODE></P> </DL> </P> <H2><A NAME="slsh_readline_new"></A> <A NAME="ss13.2">13.2</A> <A HREF="slshfun.html#toc13.2"><B>slsh_readline_new</B></A> </H2> <P> <DL> <DT><B> Synopsis </B><DD> <P>Instantiate a readline object</P> <DT><B> Usage </B><DD> <P><CODE>RLine_Type slsh_readline_new (String_Type name)</CODE></P> <DT><B> Description </B><DD> <P>This function instantiates a new readline object with the specified name and returns it.</P> <P>If a function called <CODE>name</CODE>_rline_open_hook exists, it will be called with no arguments.</P> <DT><B> See Also </B><DD> <P><CODE>slsh_readline_init</CODE></P> </DL> </P> <H2><A NAME="slsh_readline"></A> <A NAME="ss13.3">13.3</A> <A HREF="slshfun.html#toc13.3"><B>slsh_readline</B></A> </H2> <P> <DL> <DT><B> Synopsis </B><DD> <P>Get input from the user with command line editing</P> <DT><B> Usage </B><DD> <P><CODE>String_Type slsh_readline ([RLine_Type r,] String_Type prompt)</CODE></P> <DT><B> Description </B><DD> <P>The <CODE>slsh_readline</CODE> function utilizes the <B>S-Lang</B> readline interface to read input from the terminal using the specified prompt. If two parameters are given, the value of the first one must be a <CODE>RLine_Type</CODE> object obtained previously from the <CODE>slsh_readline_new</CODE> function.</P> <DT><B> See Also </B><DD> <P><CODE>slsh_readline_new, slsh_readline_init</CODE></P> </DL> </P> <H2><A NAME="slsh_readline_noecho"></A> <A NAME="ss13.4">13.4</A> <A HREF="slshfun.html#toc13.4"><B>slsh_readline_noecho</B></A> </H2> <P> <DL> <DT><B> Synopsis </B><DD> <P>Get input from the user with command line editing without echo</P> <DT><B> Usage </B><DD> <P><CODE>String_Type slsh_readline ([RLine_Type r,] String_Type prompt)</CODE></P> <DT><B> Description </B><DD> <P>This function is like <CODE>slsh_readline</CODE> except that the input is not echoed to the display. This makes it useful for reading passwords, etc.</P> <DT><B> See Also </B><DD> <P><CODE>slsh_readline, slsh_readline_new, slsh_readline_init</CODE></P> </DL> </P> <H2><A NAME="slsh_set_readline_update_hook"></A> <A NAME="ss13.5">13.5</A> <A HREF="slshfun.html#toc13.5"><B>slsh_set_readline_update_hook</B></A> </H2> <P> <DL> <DT><B> Synopsis </B><DD> <P>Specify an alternate display update function for a readline object</P> <DT><B> Usage </B><DD> <P><CODE>slsh_set_readline_update_hook(RLine_Type rl [,&func [,funcdata]])</CODE></P> <DT><B> Description </B><DD> <P>This function may be used to implement an alternative update hook for the specified readline object. The hook must have one of the following signatures, depending upon whether or not the optional <CODE>funcdata</CODE> was given: <BLOCKQUOTE><CODE> <PRE> define func (rl, prompt, editbuf, editpoint) {...} define func (rl, prompt, editbuf, editpoint, funcdata) {...} </PRE> </CODE></BLOCKQUOTE> The hook function is not expected to return anything.</P> <P>If <CODE>slsh_set_readline_update_hook</CODE> is called with a single argument, then any update hook associated with it will be set to the default value.</P> <DT><B> See Also </B><DD> <P><CODE>slsh_readline_init, slsh_readline_new, slsh_readline</CODE></P> </DL> </P> <H2><A NAME="slsh_set_update_preread_cb"></A> <A NAME="ss13.6">13.6</A> <A HREF="slshfun.html#toc13.6"><B>slsh_set_update_preread_cb</B></A> </H2> <P> <DL> <DT><B> Synopsis </B><DD> <P>Specify a function to be called prior to reading via readline</P> <DT><B> Usage </B><DD> <P><CODE>slsh_set_update_preread_cb (RLine_Type rl, Ref_Type func)</CODE></P> <DT><B> Description </B><DD> <P>This function may be used to specify a function to be called by <CODE>slsh_readline</CODE> prior to the editing loop. It must have one of the following signatures: <BLOCKQUOTE><CODE> <PRE> define func (rl) {...} define func (rl, funcdata); </PRE> </CODE></BLOCKQUOTE> The second form must be used if a <CODE>funcdata</CODE> argument was passed to the <CODE>slsh_set_readline_update_hook</CODE> function.</P> <P>If the <CODE>func</CODE> argument is <CODE>NULL</CODE>, then the callback function will be cleared.</P> <DT><B> See Also </B><DD> <P><CODE>slsh_set_readline_update_hook, slsh_set_update_postread_cb</CODE></P> </DL> </P> <H2><A NAME="slsh_set_update_postread_cb"></A> <A NAME="ss13.7">13.7</A> <A HREF="slshfun.html#toc13.7"><B>slsh_set_update_postread_cb</B></A> </H2> <P> <DL> <DT><B> Synopsis </B><DD> <P>Specify a function to be called after reading via readline</P> <DT><B> Usage </B><DD> <P><CODE>slsh_set_update_postread_cb (RLine_Type rl ,Ref_Type func)</CODE></P> <DT><B> Description </B><DD> <P>This function may be used to specify a function to be called by <CODE>slsh_readline</CODE> after to the editing loop before returning to the caller. It must have one of the following signatures: <BLOCKQUOTE><CODE> <PRE> define func (rl) {...} define func (rl, funcdata); </PRE> </CODE></BLOCKQUOTE> The second form must be used if a <CODE>funcdata</CODE> argument was passed to the <CODE>slsh_set_readline_update_hook</CODE> function.</P> <P>If the <CODE>func</CODE> argument is <CODE>NULL</CODE>, then the callback function will be cleared.</P> <DT><B> See Also </B><DD> <P><CODE>slsh_set_readline_update_hook, slsh_set_update_postread_cb</CODE></P> </DL> </P> <H2><A NAME="slsh_set_update_width_cb"></A> <A NAME="ss13.8">13.8</A> <A HREF="slshfun.html#toc13.8"><B>slsh_set_update_width_cb</B></A> </H2> <P> <DL> <DT><B> Synopsis </B><DD> <P>Specify a callback function to be called when the display width changes</P> <DT><B> Usage </B><DD> <P><CODE>slsh_set_update_width_cb (RLine_Type rl, Ref_Type func)</CODE></P> <DT><B> Description </B><DD> <P>This function is used to set a callback function that will get called when the readline routines sense that the display width has changed. It must have one of the following signatures: <BLOCKQUOTE><CODE> <PRE> define func (rl, width) {...} define func (rl, width, funcdata); </PRE> </CODE></BLOCKQUOTE> The second form must be used if a <CODE>funcdata</CODE> argument was passed to the <CODE>slsh_set_readline_update_hook</CODE> function. The <CODE>width</CODE> argument to the callback function in an integer that specifies the new width.</P> <P>If the <CODE>func</CODE> argument is <CODE>NULL</CODE>, then the callback function will be cleared.</P> <DT><B> See Also </B><DD> <P><CODE>slsh_set_readline_update_hook, slsh_readline</CODE></P> </DL> </P> <HR> Next <A HREF="slshfun-12.html">Previous</A> <A HREF="slshfun.html#toc13">Contents</A> </BODY> </HTML> Save