Next Previous Contents

13. SLSH intrinsic functions

13.1 slsh_readline_init

Synopsis

Initialize the S-Lang readline routines

Usage

slsh_readline_init (String_Type appname)

Description

The slsh_readline_init function is used to initialize the S-Lang readline interface for use by an slsh-based application with name appname. If defines an intrinsic variable called __RL_APP__ whose value is given by appname. If the file $HOME/.slrlinerc file exists, it will be loaded into the interpreter. This file together with the __RL_APP__ variable may be used by the user to customize the interface by, e.g., reading previous history files, etc.

See Also

slsh_readline_new, rline_set_history

13.2 slsh_readline_new

Synopsis

Instantiate a readline object

Usage

RLine_Type slsh_readline_new (String_Type name)

Description

This function instantiates a new readline object with the specified name and returns it.

If a function called name_rline_open_hook exists, it will be called with no arguments.

See Also

slsh_readline_init

13.3 slsh_readline

Synopsis

Get input from the user with command line editing

Usage

String_Type slsh_readline ([RLine_Type r,] String_Type prompt)

Description

The slsh_readline function utilizes the S-Lang 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 RLine_Type object obtained previously from the slsh_readline_new function.

See Also

slsh_readline_new, slsh_readline_init

13.4 slsh_readline_noecho

Synopsis

Get input from the user with command line editing without echo

Usage

String_Type slsh_readline ([RLine_Type r,] String_Type prompt)

Description

This function is like slsh_readline except that the input is not echoed to the display. This makes it useful for reading passwords, etc.

See Also

slsh_readline, slsh_readline_new, slsh_readline_init

13.5 slsh_set_readline_update_hook

Synopsis

Specify an alternate display update function for a readline object

Usage

slsh_set_readline_update_hook(RLine_Type rl [,&func [,funcdata]])

Description

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 funcdata was given:

   define func (rl, prompt, editbuf, editpoint) {...}
   define func (rl, prompt, editbuf, editpoint, funcdata) {...}
The hook function is not expected to return anything.

If slsh_set_readline_update_hook is called with a single argument, then any update hook associated with it will be set to the default value.

See Also

slsh_readline_init, slsh_readline_new, slsh_readline

13.6 slsh_set_update_preread_cb

Syn