Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Term::ReadLine::Gnu.3
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Gnu 3"
.TH Gnu 3 "2002-03-30" "perl v5.8.0" "User Contributed Perl Documentation"
.SH "NAME"
Term::ReadLine::Gnu \- Perl extension for the GNU Readline/History Library
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 5
\& use Term::ReadLine;
\& $term = new Term::ReadLine 'ProgramName';
\& while ( defined ($_ = $term->readline('prompt>')) ) {
\& ...
\& }
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
.Sh "Overview"
.IX Subsection "Overview"
This is an implementation of Term::ReadLine using the \s-1GNU\s0
Readline/History Library.
.PP
For basic functions object oriented interface is provided. These are
described in the section \*(L"Standard Methods\*(R" and
"\f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR Functions".
.PP
This package also has the interface with the almost all functions and
variables which are documented in the \s-1GNU\s0 Readline/History Library
Manual. They are documented in the section
"\f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR Functions"
and
"\f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR Variables"
briefly. For more detail of the \s-1GNU\s0 Readline/History Library, see
\&'\s-1GNU\s0 Readline Library Manual' and '\s-1GNU\s0 History Library Manual'.
.PP
The sample programs under \f(CW\*(C`eg/\*(C'\fR directory and test programs under
\&\f(CW\*(C`t/\*(C'\fR directory in the \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR distribution include
many example of this module.
.Sh "Standard Methods"
.IX Subsection "Standard Methods"
These methods are standard methods defined by \fBTerm::ReadLine\fR.
.ie n .IP """ReadLine""" 4
.el .IP "\f(CWReadLine\fR" 4
.IX Item "ReadLine"
returns the actual package that executes the commands. If you have
installed this package, possible value is \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR.
.ie n .IP """new(NAME,[IN[,OUT]])""" 4
.el .IP "\f(CWnew(NAME,[IN[,OUT]])\fR" 4
.IX Item "new(NAME,[IN[,OUT]])"
returns the handle for subsequent calls to following functions.
Argument is the name of the application. Optionally can be followed
by two arguments for \f(CW\*(C`IN\*(C'\fR and \f(CW\*(C`OUT\*(C'\fR file handles. These arguments
should be globs.
.ie n .IP """readline(PROMPT[,PREPUT])""" 4
.el .IP "\f(CWreadline(PROMPT[,PREPUT])\fR" 4
.IX Item "readline(PROMPT[,PREPUT])"
gets an input line, with actual \f(CW\*(C`GNU Readline\*(C'\fR support. Trailing
newline is removed. Returns \f(CW\*(C`undef\*(C'\fR on \f(CW\*(C`EOF\*(C'\fR. \f(CW\*(C`PREPUT\*(C'\fR is an
optional argument meaning the initial value of input.
.Sp
The optional argument \f(CW\*(C`PREPUT\*(C'\fR is granted only if the value \f(CW\*(C`preput\*(C'\fR
is in \f(CW\*(C`Features\*(C'\fR.
.Sp
\&\f(CW\*(C`PROMPT\*(C'\fR may include some escape sequences. Use
\&\f(CW\*(C`RL_PROMPT_START_IGNORE\*(C'\fR to begin a sequence of non-printing
characters, and \f(CW\*(C`RL_PROMPT_END_IGNORE\*(C'\fR to end of such a sequence.
.ie n .IP """AddHistory(LINE1, LINE2, ...)""" 4
.el .IP "\f(CWAddHistory(LINE1, LINE2, ...)\fR" 4
.IX Item "AddHistory(LINE1, LINE2, ...)"
adds the lines to the history of input, from where it can be used if
the actual \f(CW\*(C`readline\*(C'\fR is present.
.ie n .IP """IN""\fR, \f(CW""OUT""" 4
.el .IP "\f(CWIN\fR, \f(CWOUT\fR" 4
.IX Item "IN, OUT"
return the file handles for input and output or \f(CW\*(C`undef\*(C'\fR if
\&\f(CW\*(C`readline\*(C'\fR input and output cannot be used for Perl.
.ie n .IP """MinLine([MAX])""" 4
.el .IP "\f(CWMinLine([MAX])\fR" 4
.IX Item "MinLine([MAX])"
If argument \f(CW\*(C`MAX\*(C'\fR is specified, it is an advice on minimal size of
line to be included into history. \f(CW\*(C`undef\*(C'\fR means do not include
anything into history. Returns the old value.
.ie n .IP """findConsole""" 4
.el .IP "\f(CWfindConsole\fR" 4
.IX Item "findConsole"
returns an array with two strings that give most appropriate names for
files for input and output using conventions \f(CW"<$in"\fR, \f(CW">$out"\fR.
.ie n .IP """Attribs""" 4
.el .IP "\f(CWAttribs\fR" 4
.IX Item "Attribs"
returns a reference to a hash which describes internal configuration
(variables) of the package. Names of keys in this hash conform to
standard conventions with the leading \f(CW\*(C`rl_\*(C'\fR stripped.
.Sp
See section \*(L"Variables\*(R" for supported variables.
.ie n .IP """Features""" 4
.el .IP "\f(CWFeatures\fR" 4
.IX Item "Features"
Returns a reference to a hash with keys being features present in
current implementation. Several optional features are used in the
minimal interface: \f(CW\*(C`appname\*(C'\fR should be present if the first argument
to \f(CW\*(C`new\*(C'\fR is recognized, and \f(CW\*(C`minline\*(C'\fR should be present if
\&\f(CW\*(C`MinLine\*(C'\fR method is not dummy. \f(CW\*(C`autohistory\*(C'\fR should be present if
lines are put into history automatically (maybe subject to
\&\f(CW\*(C`MinLine\*(C'\fR), and \f(CW\*(C`addHistory\*(C'\fR if \f(CW\*(C`AddHistory\*(C'\fR method is not dummy.
\&\f(CW\*(C`preput\*(C'\fR means the second argument to \f(CW\*(C`readline\*(C'\fR method is processed.
\&\f(CW\*(C`getHistory\*(C'\fR and \f(CW\*(C`setHistory\*(C'\fR denote that the corresponding methods are
present. \f(CW\*(C`tkRunning\*(C'\fR denotes that a Tk application may run while ReadLine
is getting input.
.ie n .Sh """Term::ReadLine::Gnu"" Functions"
.el .Sh "\f(CWTerm::ReadLine::Gnu\fP Functions"
.IX Subsection "Term::ReadLine::Gnu Functions"
All these \s-1GNU\s0 Readline/History Library functions are callable via
method interface and have names which conform to standard conventions
with the leading \f(CW\*(C`rl_\*(C'\fR stripped.
.PP
Almost methods have lower level functions in
\&\f(CW\*(C`Term::ReadLine::Gnu::XS\*(C'\fR package. To use them full qualified name
is required. Using method interface is preferred.
.IP "Readline Convenience Functions" 4
.IX Item "Readline Convenience Functions"
.RS 4
.PD 0
.IP "Naming Function" 4
.IX Item "Naming Function"
.RS 4
.ie n .IP """add_defun(NAME, FUNC [,KEY=\-1])""" 4
.el .IP "\f(CWadd_defun(NAME, FUNC [,KEY=\-1])\fR" 4
.IX Item "add_defun(NAME, FUNC [,KEY=-1])"
.PD
Add name to the Perl function \f(CW\*(C`FUNC\*(C'\fR. If optional argument \f(CW\*(C`KEY\*(C'\fR is
specified, bind it to the \f(CW\*(C`FUNC\*(C'\fR. Returns reference to
\&\f(CW\*(C`FunctionPtr\*(C'\fR.
.Sp
.Vb 4
\& Example:
\& # name name `reverse-line' to a function reverse_line(),
\& # and bind it to "\eC-t"
\& $term->add_defun('reverse-line', \e&reverse_line, ord "\ect");
.Ve
.RE
.RS 4
.RE
.IP "Selecting a Keymap" 4
.IX Item "Selecting a Keymap"
.RS 4
.PD 0
.ie n .IP """make_bare_keymap""" 4
.el .IP "\f(CWmake_bare_keymap\fR" 4
.IX Item "make_bare_keymap"
.PD
.Vb 1
\& Keymap rl_make_bare_keymap()
.Ve
.ie n .IP """copy_keymap(MAP)""" 4
.el .IP "\f(CWcopy_keymap(MAP)\fR" 4
.IX Item "copy_keymap(MAP)"
.Vb 1
\& Keymap rl_copy_keymap(Keymap|str map)
.Ve
.ie n .IP """make_keymap""" 4
.el .IP "\f(CWmake_keymap\fR" 4
.IX Item "make_keymap"
.Vb 1
\& Keymap rl_make_keymap()
.Ve
.ie n .IP """discard_keymap(MAP)""" 4
.el .IP "\f(CWdiscard_keymap(MAP)\fR" 4
.IX Item "discard_keymap(MAP)"
.Vb 1
\& Keymap rl_discard_keymap(Keymap|str map)
.Ve
.ie n .IP """get_keymap""" 4
.el .IP "\f(CWget_keymap\fR" 4
.IX Item "get_keymap"
.Vb 1
\& Keymap rl_get_keymap()
.Ve
.ie n .IP """set_keymap(MAP)""" 4
.el .IP "\f(CWset_keymap(MAP)\fR" 4
.IX Item "set_keymap(MAP)"
.Vb 1
\& Keymap rl_set_keymap(Keymap|str map)
.Ve
.ie n .IP """get_keymap_by_name(NAME)""" 4
.el .IP "\f(CWget_keymap_by_name(NAME)\fR" 4
.IX Item "get_keymap_by_name(NAME)"
.Vb 1
\& Keymap rl_get_keymap_by_name(str name)
.Ve
.ie n .IP """get_keymap_name(MAP)""" 4
.el .IP "\f(CWget_keymap_name(MAP)\fR" 4
.IX Item "get_keymap_name(MAP)"
.Vb 1
\& str rl_get_keymap_name(Keymap map)
.Ve
.RE
.RS 4
.RE
.IP "Binding Keys" 4
.IX Item "Binding Keys"
.RS 4
.PD 0
.ie n .IP """bind_key(KEY, FUNCTION [,MAP])""" 4
.el .IP "\f(CWbind_key(KEY, FUNCTION [,MAP])\fR" 4
.IX Item "bind_key(KEY, FUNCTION [,MAP])"
.PD
.Vb 2
\& int rl_bind_key(int key, FunctionPtr|str function,
\& Keymap|str map = rl_get_keymap())
.Ve
.Sp
Bind \f(CW\*(C`KEY\*(C'\fR to the \f(CW\*(C`FUNCTION\*(C'\fR. \f(CW\*(C`FUNCTION\*(C'\fR is the name added by the
\&\f(CW\*(C`add_defun\*(C'\fR method. If optional argument \f(CW\*(C`MAP\*(C'\fR is specified, binds
in \f(CW\*(C`MAP\*(C'\fR. Returns non-zero in case of error.
.ie n .IP """unbind_key(KEY [,MAP])""" 4
.el .IP "\f(CWunbind_key(KEY [,MAP])\fR" 4
.IX Item "unbind_key(KEY [,MAP])"
.Vb 1
\& int rl_unbind_key(int key, Keymap|str map = rl_get_keymap())
.Ve
.Sp
Bind \f(CW\*(C`KEY\*(C'\fR to the null function. Returns non-zero in case of error.
.ie n .IP """unbind_function(FUNCTION [,MAP])""" 4
.el .IP "\f(CWunbind_function(FUNCTION [,MAP])\fR" 4
.IX Item "unbind_function(FUNCTION [,MAP])"
.Vb 2
\& int rl_unbind_function(FunctionPtr|str function,
\& Keymap|str map = rl_get_keymap())
.Ve
.ie n .IP """unbind_command(COMMAND [,MAP])""" 4
.el .IP "\f(CWunbind_command(COMMAND [,MAP])\fR" 4
.IX Item "unbind_command(COMMAND [,MAP])"
.Vb 2
\& int rl_unbind_command(str command,
\& Keymap|str map = rl_get_keymap())
.Ve
.ie n .IP """set_key(KEYSEQ, FUNCTION [,MAP])""" 4
.el .IP "\f(CWset_key(KEYSEQ, FUNCTION [,MAP])\fR" 4
.IX Item "set_key(KEYSEQ, FUNCTION [,MAP])"
.Vb 2
\& int rl_set_key(str keyseq, FunctionPtr|str function,
\& Keymap|str map = rl_get_keymap())
.Ve
.ie n .IP """generic_bind(TYPE, KEYSEQ, DATA, [,MAP])""" 4
.el .IP "\f(CWgeneric_bind(TYPE, KEYSEQ, DATA, [,MAP])\fR" 4
.IX Item "generic_bind(TYPE, KEYSEQ, DATA, [,MAP])"
.Vb 3
\& int rl_generic_bind(int type, str keyseq,
\& FunctionPtr|Keymap|str data,
\& Keymap|str map = rl_get_keymap())
.Ve
.ie n .IP """parse_and_bind(LINE)""" 4
.el .IP "\f(CWparse_and_bind(LINE)\fR" 4
.IX Item "parse_and_bind(LINE)"
.Vb 1
\& void rl_parse_and_bind(str line)
.Ve
.Sp
Parse \f(CW\*(C`LINE\*(C'\fR as if it had been read from the \fI~/.inputrc\fR file and
perform any key bindings and variable assignments found. For more
detail see '\s-1GNU\s0 Readline Library Manual'.
.ie n .IP """read_init_file([FILENAME])""" 4
.el .IP "\f(CWread_init_file([FILENAME])\fR" 4
.IX Item "read_init_file([FILENAME])"
.Vb 1
\& int rl_read_init_file(str filename = '~/.inputrc')
.Ve
.RE
.RS 4
.RE
.IP "Associating Function Names and Bindings" 4
.IX Item "Associating Function Names and Bindings"
.RS 4
.PD 0
.ie n .IP """named_function(NAME)""" 4
.el .IP "\f(CWnamed_function(NAME)\fR" 4
.IX Item "named_function(NAME)"
.PD
.Vb 1
\& FunctionPtr rl_named_function(str name)
.Ve
.ie n .IP """get_function_name(FUNCTION)""" 4
.el .IP "\f(CWget_function_name(FUNCTION)\fR" 4
.IX Item "get_function_name(FUNCTION)"
.Vb 1
\& str rl_get_function_name(FunctionPtr function)
.Ve
.ie n .IP """function_of_keyseq(KEYMAP [,MAP])""" 4
.el .IP "\f(CWfunction_of_keyseq(KEYMAP [,MAP])\fR" 4
.IX Item "function_of_keyseq(KEYMAP [,MAP])"
.Vb 3
\& (FunctionPtr|Keymap|str data, int type)
\& rl_function_of_keyseq(str keyseq,
\& Keymap|str map = rl_get_keymap())
.Ve
.ie n .IP """invoking_keyseqs(FUNCTION [,MAP])""" 4
.el .IP "\f(CWinvoking_keyseqs(FUNCTION [,MAP])\fR" 4
.IX Item "invoking_keyseqs(FUNCTION [,MAP])"
.Vb 2
\& (@str) rl_invoking_keyseqs(FunctionPtr|str function,
\& Keymap|str map = rl_get_keymap())
.Ve
.ie n .IP """function_dumper([READABLE])""" 4
.el .IP "\f(CWfunction_dumper([READABLE])\fR" 4
.IX Item "function_dumper([READABLE])"
.Vb 1
\& void rl_function_dumper(int readable = 0)
.Ve
.ie n .IP """list_funmap_names""" 4
.el .IP "\f(CWlist_funmap_names\fR" 4
.IX Item "list_funmap_names"
.Vb 1
\& void rl_list_funmap_names()
.Ve
.ie n .IP """funmap_names""" 4
.el .IP "\f(CWfunmap_names\fR" 4
.IX Item "funmap_names"
.Vb 1
\& (@str) rl_funmap_names()
.Ve
.ie n .IP """add_funmap_entry(NAME, FUNCTION)""" 4
.el .IP "\f(CWadd_funmap_entry(NAME, FUNCTION)\fR" 4
.IX Item "add_funmap_entry(NAME, FUNCTION)"
.Vb 1
\& int rl_add_funmap_entry(char *name, FunctionPtr|str function)
.Ve
.RE
.RS 4
.RE
.IP "Allowing Undoing" 4
.IX Item "Allowing Undoing"
.RS 4
.PD 0
.ie n .IP """begin_undo_group""" 4
.el .IP "\f(CWbegin_undo_group\fR" 4
.IX Item "begin_undo_group"
.PD
.Vb 1
\& int rl_begin_undo_group()
.Ve
.ie n .IP """end_undo_group""" 4
.el .IP "\f(CWend_undo_group\fR" 4
.IX Item "end_undo_group"
.Vb 1
\& int rl_end_undo_group()
.Ve
.ie n .IP """add_undo(WHAT, START, END, TEXT)""" 4
.el .IP "\f(CWadd_undo(WHAT, START, END, TEXT)\fR" 4
.IX Item "add_undo(WHAT, START, END, TEXT)"
.Vb 1
\& int rl_add_undo(int what, int start, int end, str text)
.Ve
.ie n .IP """free_undo_list""" 4
.el .IP "\f(CWfree_undo_list\fR" 4
.IX Item "free_undo_list"
.Vb 1
\& void rl_free_undo_list()
.Ve
.ie n .IP """do_undo""" 4
.el .IP "\f(CWdo_undo\fR" 4
.IX Item "do_undo"
.Vb 1
\& int rl_do_undo()
.Ve
.ie n .IP """modifying([START [,END]])""" 4
.el .IP "\f(CWmodifying([START [,END]])\fR" 4
.IX Item "modifying([START [,END]])"
.Vb 1
\& int rl_modifying(int start = 0, int end = rl_end)
.Ve
.RE
.RS 4
.RE
.IP "Redisplay" 4
.IX Item "Redisplay"
.RS 4
.PD 0
.ie n .IP """redisplay""" 4
.el .IP "\f(CWredisplay\fR" 4
.IX Item "redisplay"
.PD
.Vb 1
\& void rl_redisplay()
.Ve
.ie n .IP """forced_update_display""" 4
.el .IP "\f(CWforced_update_display\fR" 4
.IX Item "forced_update_display"
.Vb 1
\& int rl_forced_update_display()
.Ve
.ie n .IP """on_new_line""" 4
.el .IP "\f(CWon_new_line\fR" 4
.IX Item "on_new_line"
.Vb 1
\& int rl_on_new_line()
.Ve
.ie n .IP """on_new_line_with_prompt""" 4
.el .IP "\f(CWon_new_line_with_prompt\fR" 4
.IX Item "on_new_line_with_prompt"
.Vb 1
\& int rl_on_new_line_with_prompt() # GRL 4.1
.Ve
.ie n .IP """reset_line_state""" 4
.el .IP "\f(CWreset_line_state\fR" 4
.IX Item "reset_line_state"
.Vb 1
\& int rl_reset_line_state()
.Ve
.ie n .IP "rl_show_char(C)" 4
.el .IP "\f(CWrl_show_char(C)\fR" 4
.IX Item "rl_show_char(C)"
.Vb 1
\& int rl_show_char(int c)
.Ve
.ie n .IP """message(FMT[, ...])""" 4
.el .IP "\f(CWmessage(FMT[, ...])\fR" 4
.IX Item "message(FMT[, ...])"
.Vb 1
\& int rl_message(str fmt, ...)
.Ve
.ie n .IP """crlf""" 4
.el .IP "\f(CWcrlf\fR" 4
.IX Item "crlf"
.Vb 1
\& int rl_crlf() # GRL 4.2
.Ve
.ie n .IP """clear_message""" 4
.el .IP "\f(CWclear_message\fR" 4
.IX Item "clear_message"
.Vb 1
\& int rl_clear_message()
.Ve
.ie n .IP """save_prompt""" 4
.el .IP "\f(CWsave_prompt\fR" 4
.IX Item "save_prompt"
.Vb 1
\& void rl_save_prompt()
.Ve
.ie n .IP """restore_prompt""" 4
.el .IP "\f(CWrestore_prompt\fR" 4
.IX Item "restore_prompt"
.Vb 1
\& void rl_restore_prompt()
.Ve
.ie n .IP """expand_prompt(PROMPT)""" 4
.el .IP "\f(CWexpand_prompt(PROMPT)\fR" 4
.IX Item "expand_prompt(PROMPT)"
.Vb 1
\& int rl_expand_prompt(str prompt) # GRL 4.2
.Ve
.ie n .IP """set_prompt(PROMPT)""" 4
.el .IP "\f(CWset_prompt(PROMPT)\fR" 4
.IX Item "set_prompt(PROMPT)"
.Vb 1
\& int rl_set_prompt(const str prompt) # GRL 4.2
.Ve
.RE
.RS 4
.RE
.IP "Modifying Text" 4
.IX Item "Modifying Text"
.RS 4
.PD 0
.ie n .IP """insert_text(TEXT)""" 4
.el .IP "\f(CWinsert_text(TEXT)\fR" 4
.IX Item "insert_text(TEXT)"
.PD
.Vb 1
\& int rl_insert_text(str text)
.Ve
.ie n .IP """delete_text([START [,END]])""" 4
.el .IP "\f(CWdelete_text([START [,END]])\fR" 4
.IX Item "delete_text([START [,END]])"
.Vb 1
\& int rl_delete_text(int start = 0, int end = rl_end)
.Ve
.ie n .IP """copy_text([START [,END]])""" 4
.el .IP "\f(CWcopy_text([START [,END]])\fR" 4
.IX Item "copy_text([START [,END]])"
.Vb 1
\& str rl_copy_text(int start = 0, int end = rl_end)
.Ve
.ie n .IP """kill_text([START [,END]])""" 4
.el .IP "\f(CWkill_text([START [,END]])\fR" 4
.IX Item "kill_text([START [,END]])"
.Vb 1
\& int rl_kill_text(int start = 0, int end = rl_end)
.Ve
.ie n .IP """push_macro_input(MACRO)""" 4
.el .IP "\f(CWpush_macro_input(MACRO)\fR" 4
.IX Item "push_macro_input(MACRO)"
.Vb 1
\& int rl_push_macro_input(str macro)
.Ve
.RE
.RS 4
.RE
.IP "Character Input" 4
.IX Item "Character Input"
.RS 4
.PD 0
.ie n .IP """read_key""" 4
.el .IP "\f(CWread_key\fR" 4
.IX Item "read_key"
.PD
.Vb 1
\& int rl_read_key()
.Ve
.ie n .IP """getc(STREAM)""" 4
.el .IP "\f(CWgetc(STREAM)\fR" 4
.IX Item "getc(STREAM)"
.Vb 1
\& int rl_getc(FILE *STREAM)
.Ve
.ie n .IP "stuff_char(C)" 4
.el .IP "\f(CWstuff_char(C)\fR" 4
.IX Item "stuff_char(C)"
.Vb 1
\& int rl_stuff_char(int c)
.Ve
.ie n .IP "execute_next(C)" 4
.el .IP "\f(CWexecute_next(C)\fR" 4
.IX Item "execute_next(C)"
.Vb 1
\& int rl_execute_next(int c) # GRL 4.2
.Ve
.ie n .IP """clear_pending_input()""" 4
.el .IP "\f(CWclear_pending_input()\fR" 4
.IX Item "clear_pending_input()"
.Vb 1
\& int rl_clear_pending_input() # GRL 4.2
.Ve
.ie n .IP """set_keyboard_input_timeout(uSEC)""" 4
.el .IP "\f(CWset_keyboard_input_timeout(uSEC)\fR" 4
.IX Item "set_keyboard_input_timeout(uSEC)"
.Vb 1
\& int rl_set_keyboard_input_timeout(int usec) # GRL 4.2
.Ve
.RE
.RS 4
.RE
.IP "Terminal Management" 4
.IX Item "Terminal Management"
.RS 4
.PD 0
.ie n .IP """prep_terminal(META_FLAG)""" 4
.el .IP "\f(CWprep_terminal(META_FLAG)\fR" 4
.IX Item "prep_terminal(META_FLAG)"
.PD
.Vb 1
\& void rl_prep_terminal(int META_FLAG) # GRL 4.2
.Ve
.ie n .IP """deprep_terminal()""" 4
.el .IP "\f(CWdeprep_terminal()\fR" 4
.IX Item "deprep_terminal()"
.Vb 1
\& void rl_deprep_terminal() # GRL 4.2
.Ve
.ie n .IP """tty_set_default_bindings(KMAP)""" 4
.el .IP "\f(CWtty_set_default_bindings(KMAP)\fR" 4
.IX Item "tty_set_default_bindings(KMAP)"
.Vb 1
\& void rl_tty_set_default_bindings([Keymap KMAP]) # GRL 4.2
.Ve
.ie n .IP """reset_terminal([TERMINAL_NAME])""" 4
.el .IP "\f(CWreset_terminal([TERMINAL_NAME])\fR" 4
.IX Item "reset_terminal([TERMINAL_NAME])"
.Vb 1
\& int rl_reset_terminal(str terminal_name = getenv($TERM)) # GRL 4.2
.Ve
.RE
.RS 4
.RE
.IP "Utility Functions" 4
.IX Item "Utility Functions"
.RS 4
.PD 0
.ie n .IP """initialize""" 4
.el .IP "\f(CWinitialize\fR" 4
.IX Item "initialize"
.PD
.Vb 1
\& int rl_initialize()
.Ve
.ie n .IP """ding""" 4
.el .IP "\f(CWding\fR" 4
.IX Item "ding"
.Vb 1
\& int rl_ding()
.Ve
.ie n .IP "alphabetic(C)" 4
.el .IP "\f(CWalphabetic(C)\fR" 4
.IX Item "alphabetic(C)"
.Vb 1
\& int rl_alphabetic(int C)
.Ve
.ie n .IP """display_match_list(MATCHES [,LEN [,MAX]])""" 4
.el .IP "\f(CWdisplay_match_list(MATCHES [,LEN [,MAX]])\fR" 4
.IX Item "display_match_list(MATCHES [,LEN [,MAX]])"
.Vb 1
\& void rl_display_match_list(\e@matches, len = $#maches, max) # GRL 4.0
.Ve
.Sp
Since the first element of an array \f(CW@matches\fR as treated as a possible
completion, it is not displayed. See the descriptions of
\&\f(CW\*(C`completion_matches()\*(C'\fR.
.Sp
When \f(CW\*(C`MAX\*(C'\fR is ommited, the max length of an item in \f(CW@matches\fR is used.
.RE
.RS 4
.RE
.IP "Miscellaneous Functions" 4
.IX Item "Miscellaneous Functions"
.RS 4
.PD 0
.ie n .IP """macro_bind(KEYSEQ, MACRO [,MAP])""" 4
.el .IP "\f(CWmacro_bind(KEYSEQ, MACRO [,MAP])\fR" 4
.IX Item "macro_bind(KEYSEQ, MACRO [,MAP])"
.PD
.Vb 1
\& int rl_macro_bind(const str keyseq, const str macro, Keymap map)
.Ve
.ie n .IP """macro_dumper(READABLE)""" 4
.el .IP "\f(CWmacro_dumper(READABLE)\fR" 4
.IX Item "macro_dumper(READABLE)"
.Vb 1
\& int rl_macro_dumper(int readline)
.Ve
.ie n .IP """variable_bind(VARIABLE, VALUE)""" 4
.el .IP "\f(CWvariable_bind(VARIABLE, VALUE)\fR" 4
.IX Item "variable_bind(VARIABLE, VALUE)"
.Vb 1
\& int rl_variable_bind(const str variable, const str value)
.Ve
.ie n .IP """variable_dumper(READABLE)""" 4
.el .IP "\f(CWvariable_dumper(READABLE)\fR" 4
.IX Item "variable_dumper(READABLE)"
.Vb 1
\& int rl_variable_dumper(int readline)
.Ve
.ie n .IP """set_paren_blink_timeout(uSEC)""" 4
.el .IP "\f(CWset_paren_blink_timeout(uSEC)\fR" 4
.IX Item "set_paren_blink_timeout(uSEC)"
.Vb 1
\& int rl_set_paren_blink_timeout(usec) # GRL 4.2
.Ve
.ie n .IP """get_termcap(cap)""" 4
.el .IP "\f(CWget_termcap(cap)\fR" 4
.IX Item "get_termcap(cap)"
.Vb 1
\& str rl_get_termcap(cap)
.Ve
.RE
.RS 4
.RE
.IP "Alternate Interface" 4
.IX Item "Alternate Interface"
.RS 4
.PD 0
.ie n .IP """callback_handler_install(PROMPT, LHANDLER)""" 4
.el .IP "\f(CWcallback_handler_install(PROMPT, LHANDLER)\fR" 4
.IX Item "callback_handler_install(PROMPT, LHANDLER)"
.PD
.Vb 1
\& void rl_callback_handler_install(str prompt, pfunc lhandler)
.Ve
.ie n .IP """callback_read_char""" 4
.el .IP "\f(CWcallback_read_char\fR" 4
.IX Item "callback_read_char"
.Vb 1
\& void rl_callback_read_char()
.Ve
.ie n .IP """callback_handler_remove""" 4
.el .IP "\f(CWcallback_handler_remove\fR" 4
.IX Item "callback_handler_remove"
.Vb 1
\& void rl_callback_handler_remove()
.Ve
.RE
.RS 4
.RE
.RE
.RS 4
.RE
.IP "Readline Signal Handling" 4
.IX Item "Readline Signal Handling"
.RS 4
.PD 0
.ie n .IP """cleanup_after_signal""" 4
.el .IP "\f(CWcleanup_after_signal\fR" 4
.IX Item "cleanup_after_signal"
.PD
.Vb 1
\& void rl_cleanup_after_signal() # GRL 4.0
.Ve
.ie n .IP """free_line_state""" 4
.el .IP "\f(CWfree_line_state\fR" 4
.IX Item "free_line_state"
.Vb 1
\& void rl_free_line_state() # GRL 4.0
.Ve
.ie n .IP """reset_after_signal""" 4
.el .IP "\f(CWreset_after_signal\fR" 4
.IX Item "reset_after_signal"
.Vb 1
\& void rl_reset_after_signal() # GRL 4.0
.Ve
.ie n .IP """resize_terminal""" 4
.el .IP "\f(CWresize_terminal\fR" 4
.IX Item "resize_terminal"
.Vb 1
\& void rl_resize_terminal() # GRL 4.0
.Ve
.ie n .IP """set_screen_size(ROWS, COLS)""" 4
.el .IP "\f(CWset_screen_size(ROWS, COLS)\fR" 4
.IX Item "set_screen_size(ROWS, COLS)"
.Vb 1
\& void rl_set_screen_size(int ROWS, int COLS) # GRL 4.2
.Ve
.ie n .IP """get_screen_size()""" 4
.el .IP "\f(CWget_screen_size()\fR" 4
.IX Item "get_screen_size()"
.Vb 1
\& (int rows, int cols) rl_get_screen_size() # GRL 4.2
.Ve
.ie n .IP """set_signals""" 4
.el .IP "\f(CWset_signals\fR" 4
.IX Item "set_signals"
.Vb 1
\& int rl_set_signals() # GRL 4.0
.Ve
.ie n .IP """clear_signals""" 4
.el .IP "\f(CWclear_signals\fR" 4
.IX Item "clear_signals"
.Vb 1
\& int rl_clear_signals() # GRL 4.0
.Ve
.RE
.RS 4
.RE
.IP "Completion Functions" 4
.IX Item "Completion Functions"
.RS 4
.PD 0
.ie n .IP """complete_internal([WHAT_TO_DO])""" 4
.el .IP "\f(CWcomplete_internal([WHAT_TO_DO])\fR" 4
.IX Item "complete_internal([WHAT_TO_DO])"
.PD
.Vb 1
\& int rl_complete_internal(int what_to_do = TAB)
.Ve
.ie n .IP """completion_matches(TEXT [,FUNC])""" 4
.el .IP "\f(CWcompletion_matches(TEXT [,FUNC])\fR" 4
.IX Item "completion_matches(TEXT [,FUNC])"
.Vb 2
\& (@str) rl_completion_matches(str text,
\& pfunc func = filename_completion_function)
.Ve
.ie n .IP """filename_completion_function(TEXT, STATE)""" 4
.el .IP "\f(CWfilename_completion_function(TEXT, STATE)\fR" 4
.IX Item "filename_completion_function(TEXT, STATE)"
.Vb 1
\& str rl_filename_completion_function(str text, int state)
.Ve
.ie n .IP """username_completion_function(TEXT, STATE)""" 4
.el .IP "\f(CWusername_completion_function(TEXT, STATE)\fR" 4
.IX Item "username_completion_function(TEXT, STATE)"
.Vb 1
\& str rl_username_completion_function(str text, int state)
.Ve
.ie n .IP """list_completion_function(TEXT, STATE)""" 4
.el .IP "\f(CWlist_completion_function(TEXT, STATE)\fR" 4
.IX Item "list_completion_function(TEXT, STATE)"
.Vb 1
\& str list_completion_function(str text, int state)
.Ve
.RE
.RS 4
.RE
.IP "History Functions" 4
.IX Item "History Functions"
.RS 4
.PD 0
.IP "Initializing History and State Management" 4
.IX Item "Initializing History and State Management"
.RS 4
.ie n .IP """using_history""" 4
.el .IP "\f(CWusing_history\fR" 4
.IX Item "using_history"
.PD
.Vb 1
\& void using_history()
.Ve
.RE
.RS 4
.RE
.IP "History List Management" 4
.IX Item "History List Management"
.RS 4
.PD 0
.ie n .IP """addhistory(STRING[, STRING, ...])""" 4
.el .IP "\f(CWaddhistory(STRING[, STRING, ...])\fR" 4
.IX Item "addhistory(STRING[, STRING, ...])"
.PD
.Vb 1
\& void add_history(str string)
.Ve
.ie n .IP """StifleHistory(MAX)""" 4
.el .IP "\f(CWStifleHistory(MAX)\fR" 4
.IX Item "StifleHistory(MAX)"
.Vb 1
\& int stifle_history(int max|undef)
.Ve
.Sp
stifles the history list, remembering only the last \f(CW\*(C`MAX\*(C'\fR entries.
If \f(CW\*(C`MAX\*(C'\fR is undef, remembers all entries. This is a replacement
of \fIunstifle_history()\fR.
.ie n .IP """unstifle_history""" 4
.el .IP "\f(CWunstifle_history\fR" 4
.IX Item "unstifle_history"
.Vb 1
\& int unstifle_history()
.Ve
.Sp
This is equivalent with 'stifle_history(undef)'.
.ie n .IP """SetHistory(LINE1 [, LINE2, ...])""" 4
.el .IP "\f(CWSetHistory(LINE1 [, LINE2, ...])\fR" 4
.IX Item "SetHistory(LINE1 [, LINE2, ...])"
sets the history of input, from where it can be used if the actual
\&\f(CW\*(C`readline\*(C'\fR is present.
.ie n .IP """remove_history(WHICH)""" 4
.el .IP "\f(CWremove_history(WHICH)\fR" 4
.IX Item "remove_history(WHICH)"
.Vb 1
\& str remove_history(int which)
.Ve
.ie n .IP """replace_history_entry(WHICH, LINE)""" 4
.el .IP "\f(CWreplace_history_entry(WHICH, LINE)\fR" 4
.IX Item "replace_history_entry(WHICH, LINE)"
.Vb 1
\& str replace_history_entry(int which, str line)
.Ve
.ie n .IP """clear_history""" 4
.el .IP "\f(CWclear_history\fR" 4
.IX Item "clear_history"
.Vb 1
\& void clear_history()
.Ve
.ie n .IP """history_is_stifled""" 4
.el .IP "\f(CWhistory_is_stifled\fR" 4
.IX Item "history_is_stifled"
.Vb 1
\& int history_is_stifled()
.Ve
.RE
.RS 4
.RE
.IP "Information About the History List" 4
.IX Item "Information About the History List"
.RS 4
.PD 0
.ie n .IP """where_history""" 4
.el .IP "\f(CWwhere_history\fR" 4
.IX Item "where_history"
.PD
.Vb 1
\& int where_history()
.Ve
.ie n .IP """current_history""" 4
.el .IP "\f(CWcurrent_history\fR" 4
.IX Item "current_history"
.Vb 1
\& str current_history()
.Ve
.ie n .IP """history_get(OFFSET)""" 4
.el .IP "\f(CWhistory_get(OFFSET)\fR" 4
.IX Item "history_get(OFFSET)"
.Vb 1
\& str history_get(offset)
.Ve
.ie n .IP """history_total_bytes""" 4
.el .IP "\f(CWhistory_total_bytes\fR" 4
.IX Item "history_total_bytes"
.Vb 1
\& int history_total_bytes()
.Ve
.ie n .IP """GetHistory""" 4
.el .IP "\f(CWGetHistory\fR" 4
.IX Item "GetHistory"
returns the history of input as a list, if actual \f(CW\*(C`readline\*(C'\fR is present.
.RE
.RS 4
.RE
.IP "Moving Around the History List" 4
.IX Item "Moving Around the History List"
.RS 4
.PD 0
.ie n .IP """history_set_pos(POS)""" 4
.el .IP "\f(CWhistory_set_pos(POS)\fR" 4
.IX Item "history_set_pos(POS)"
.PD
.Vb 1
\& int history_set_pos(int pos)
.Ve
.ie n .IP """previous_history""" 4
.el .IP "\f(CWprevious_history\fR" 4
.IX Item "previous_history"
.Vb 1
\& str previous_history()
.Ve
.ie n .IP """next_history""" 4
.el .IP "\f(CWnext_history\fR" 4
.IX Item "next_history"
.Vb 1
\& str next_history()
.Ve
.RE
.RS 4
.RE
.IP "Searching the History List" 4
.IX Item "Searching the History List"
.RS 4
.PD 0
.ie n .IP """history_search(STRING [,DIRECTION])""" 4
.el .IP "\f(CWhistory_search(STRING [,DIRECTION])\fR" 4
.IX Item "history_search(STRING [,DIRECTION])"
.PD
.Vb 1
\& int history_search(str string, int direction = -1)
.Ve
.ie n .IP """history_search_prefix(STRING [,DIRECTION])""" 4
.el .IP "\f(CWhistory_search_prefix(STRING [,DIRECTION])\fR" 4
.IX Item "history_search_prefix(STRING [,DIRECTION])"
.Vb 1
\& int history_search_prefix(str string, int direction = -1)
.Ve
.ie n .IP """history_search_pos(STRING [,DIRECTION [,POS]])""" 4
.el .IP "\f(CWhistory_search_pos(STRING [,DIRECTION [,POS]])\fR" 4
.IX Item "history_search_pos(STRING [,DIRECTION [,POS]])"
.Vb 3
\& int history_search_pos(str string,
\& int direction = -1,
\& int pos = where_history())
.Ve
.RE
.RS 4
.RE
.IP "Managing the History File" 4
.IX Item "Managing the History File"
.RS 4
.PD 0
.ie n .IP """ReadHistory([FILENAME [,FROM [,TO]]])""" 4
.el .IP "\f(CWReadHistory([FILENAME [,FROM [,TO]]])\fR" 4
.IX Item "ReadHistory([FILENAME [,FROM [,TO]]])"
.PD
.Vb 2
\& int read_history(str filename = '~/.history',
\& int from = 0, int to = -1)
.Ve
.Sp
.Vb 2
\& int read_history_range(str filename = '~/.history',
\& int from = 0, int to = -1)
.Ve
.Sp
adds the contents of \f(CW\*(C`FILENAME\*(C'\fR to the history list, a line at a
time. If \f(CW\*(C`FILENAME\*(C'\fR is false, then read from \fI~/.history\fR. Start
reading at line \f(CW\*(C`FROM\*(C'\fR and end at \f(CW\*(C`TO\*(C'\fR. If \f(CW\*(C`FROM\*(C'\fR is omitted or
zero, start at the beginning. If \f(CW\*(C`TO\*(C'\fR is omitted or less than
\&\f(CW\*(C`FROM\*(C'\fR, then read until the end of the file. Returns true if
successful, or false if not. \f(CW\*(C`read_history()\*(C'\fR is an aliase of
\&\f(CW\*(C`read_history_range()\*(C'\fR.
.ie n .IP """WriteHistory([FILENAME])""" 4
.el .IP "\f(CWWriteHistory([FILENAME])\fR" 4
.IX Item "WriteHistory([FILENAME])"
.Vb 1
\& int write_history(str filename = '~/.history')
.Ve
.Sp
writes the current history to \f(CW\*(C`FILENAME\*(C'\fR, overwriting \f(CW\*(C`FILENAME\*(C'\fR if
necessary. If \f(CW\*(C`FILENAME\*(C'\fR is false, then write the history list to
\&\fI~/.history\fR. Returns true if successful, or false if not.
.ie n .IP """append_history(NELEMENTS [,FILENAME])""" 4
.el .IP "\f(CWappend_history(NELEMENTS [,FILENAME])\fR" 4
.IX Item "append_history(NELEMENTS [,FILENAME])"
.Vb 1
\& int append_history(int nelements, str filename = '~/.history')
.Ve
.ie n .IP """history_truncate_file([FILENAME [,NLINES]])""" 4
.el .IP "\f(CWhistory_truncate_file([FILENAME [,NLINES]])\fR" 4
.IX Item "history_truncate_file([FILENAME [,NLINES]])"
.Vb 2
\& int history_truncate_file(str filename = '~/.history',
\& int nlines = 0)
.Ve
.RE
.RS 4
.RE
.IP "History Expansion" 4
.IX Item "History Expansion"
.RS 4
.PD 0
.ie n .IP """history_expand(LINE)""" 4
.el .IP "\f(CWhistory_expand(LINE)\fR" 4
.IX Item "history_expand(LINE)"
.PD
.Vb 1
\& (int result, str expansion) history_expand(str line)
.Ve
.Sp
Note that this function returns \f(CW\*(C`expansion\*(C'\fR in scalar context.
.ie n .IP """get_history_event(STRING, CINDEX [,QCHAR])""" 4
.el .IP "\f(CWget_history_event(STRING, CINDEX [,QCHAR])\fR" 4
.IX Item "get_history_event(STRING, CINDEX [,QCHAR])"
.Vb 3
\& (str text, int cindex) = get_history_event(str string,
\& int cindex,
\& char qchar = '\e0')
.Ve
.ie n .IP """history_tokenize(LINE)""" 4
.el .IP "\f(CWhistory_tokenize(LINE)\fR" 4
.IX Item "history_tokenize(LINE)"
.Vb 1
\& (@str) history_tokenize(str line)
.Ve
.ie n .IP """history_arg_extract(LINE, [FIRST [,LAST]])""" 4
.el .IP "\f(CWhistory_arg_extract(LINE, [FIRST [,LAST]])\fR" 4
.IX Item "history_arg_extract(LINE, [FIRST [,LAST]])"
.Vb 1
\& str history_arg_extract(str line, int first = 0, int last = '$')
.Ve
.RE
.RS 4
.RE
.RE
.RS 4
.RE
.ie n .Sh """Term::ReadLine::Gnu"" Variables"
.el .Sh "\f(CWTerm::ReadLine::Gnu\fP Variables"
.IX Subsection "Term::ReadLine::Gnu Variables"
Following \s-1GNU\s0 Readline/History Library variables can be accessed from
Perl program. See '\s-1GNU\s0 Readline Library Manual' and ' \s-1GNU\s0 History
Library Manual' for each variable. You can access them with
\&\f(CW\*(C`Attribs\*(C'\fR methods. Names of keys in this hash conform to standard
conventions with the leading \f(CW\*(C`rl_\*(C'\fR stripped.
.PP
Examples:
.PP
.Vb 3
\& $attribs = $term->Attribs;
\& $v = $attribs->{library_version}; # rl_library_version
\& $v = $attribs->{history_base}; # history_base
.Ve
.IP "Readline Variables" 4
.IX Item "Readline Variables"
.Vb 33
\& str rl_line_buffer
\& int rl_point
\& int rl_end
\& int rl_mark
\& int rl_done
\& int rl_num_chars_to_read (GRL 4.2)
\& int rl_pending_input
\& int rl_dispatching (GRL 4.2)
\& int rl_erase_empty_line (GRL 4.0)
\& str rl_prompt (read only)
\& int rl_already_prompted (GRL 4.1)
\& str rl_library_version (read only)
\& int rl_readline_version (read only)
\& int rl_gnu_readline_p (GRL 4.2)
\& str rl_terminal_name
\& str rl_readline_name
\& filehandle rl_instream
\& filehandle rl_outstream
\& pfunc rl_startup_hook
\& pfunc rl_pre_input_hook (GRL 4.0)
\& pfunc rl_event_hook
\& pfunc rl_getc_function
\& pfunc rl_redisplay_function
\& pfunc rl_prep_term_function (GRL 4.2)
\& pfunc rl_deprep_term_function (GRL 4.2)
\& pfunc rl_last_func (GRL 4.2)
\& Keymap rl_executing_keymap (read only)
\& Keymap rl_binding_keymap (read only)
\& str rl_executing_macro (GRL 4.2)
\& int rl_readline_state (GRL 4.2)
\& int rl_explicit_arg (GRL 4.2)
\& int rl_numeric_arg (GRL 4.2)
\& int rl_editing_mode (GRL 4.2)
.Ve
.IP "Signal Handling Variables" 4
.IX Item "Signal Handling Variables"
.Vb 2
\& int rl_catch_signals (GRL 4.0)
\& int rl_catch_sigwinch (GRL 4.0)
.Ve
.IP "Completion Variables" 4
.IX Item "Completion Variables"
.Vb 22
\& pfunc rl_completion_entry_function
\& pfunc rl_attempted_completion_function
\& pfunc rl_filename_quoting_function
\& pfunc rl_filename_dequoting_function
\& pfunc rl_char_is_quoted_p
\& int rl_completion_query_items
\& str rl_basic_word_break_characters
\& str rl_basic_quote_characters
\& str rl_completer_word_break_characters
\& str rl_completer_quote_characters
\& str rl_filename_quote_characters
\& str rl_special_prefixes
\& int rl_completion_append_character
\& int rl_ignore_completion_duplicates
\& int rl_filename_completion_desired
\& int rl_filename_quoting_desired
\& int rl_attempted_completion_over (GRL 4.2)
\& int rl_completion_type (GRL 4.2)
\& int rl_inhibit_completion
\& pfunc rl_ignore_some_completion_function
\& pfunc rl_directory_completion_hook
\& pfunc rl_completion_display_matches_hook (GRL 4.0)
.Ve
.IP "History Variables" 4
.IX Item "History Variables"
.Vb 11
\& int history_base
\& int history_length
\& int history_max_entries (called `max_input_history'. read only)
\& char history_expansion_char
\& char history_subst_char
\& char history_comment_char
\& str history_word_delimiters (GRL 4.2)
\& str history_no_expand_chars
\& str history_search_delimiter_chars
\& int history_quotes_inhibit_expansion
\& pfunc history_inhibit_expansion_function
.Ve
.IP "Function References" 4
.IX Item "Function References"
.Vb 9
\& rl_getc
\& rl_redisplay
\& rl_callback_read_char
\& rl_display_match_list
\& rl_filename_completion_function
\& rl_username_completion_function
\& list_completion_function
\& shadow_redisplay
\& Tk_getc
.Ve
.Sh "Custom Completion"
.IX Subsection "Custom Completion"
In this section variables and functions for custom completion is
described with examples.
.PP
Most of descriptions in this section is cited from \s-1GNU\s0 Readline
Library manual.
.ie n .IP """rl_completion_entry_function""" 4
.el .IP "\f(CWrl_completion_entry_function\fR" 4
.IX Item "rl_completion_entry_function"
This variable holds reference refers to a generator function for
\&\f(CW\*(C`completion_matches()\*(C'\fR.
.Sp
A generator function is called repeatedly from
\&\f(CW\*(C`completion_matches()\*(C'\fR, returning a string each time. The arguments
to the generator function are \f(CW\*(C`TEXT\*(C'\fR and \f(CW\*(C`STATE\*(C'\fR. \f(CW\*(C`TEXT\*(C'\fR is the
partial word to be completed. \f(CW\*(C`STATE\*(C'\fR is zero the first time the
function is called, allowing the generator to perform any necessary
initialization, and a positive non-zero integer for each subsequent
call. When the generator function returns \f(CW\*(C`undef\*(C'\fR this signals
\&\f(CW\*(C`completion_matches()\*(C'\fR that there are no more possibilities left.
.Sp
If the value is undef, built-in \f(CW\*(C`filename_completion_function\*(C'\fR is
used.
.Sp
A sample generator function, \f(CW\*(C`list_completion_function\*(C'\fR, is defined
in Gnu.pm. You can use it as follows;
.Sp
.Vb 11
\& use Term::ReadLine;
\& ...
\& my $term = new Term::ReadLine 'sample';
\& my $attribs = $term->Attribs;
\& ...
\& $attribs->{completion_entry_function} =
\& $attribs->{list_completion_function};
\& ...
\& $attribs->{completion_word} =
\& [qw(reference to a list of words which you want to use for completion)];
\& $term->readline("custom completion>");
.Ve
.Sp
See also \f(CW\*(C`completion_matches\*(C'\fR.
.ie n .IP """rl_attempted_completion_function""" 4
.el .IP "\f(CWrl_attempted_completion_function\fR" 4
.IX Item "rl_attempted_completion_function"
A reference to an alternative function to create matches.
.Sp
The function is called with \f(CW\*(C`TEXT\*(C'\fR, \f(CW\*(C`LINE_BUFFER\*(C'\fR, \f(CW\*(C`START\*(C'\fR, and
\&\f(CW\*(C`END\*(C'\fR. \f(CW\*(C`LINE_BUFFER\*(C'\fR is a current input buffer string. \f(CW\*(C`START\*(C'\fR
and \f(CW\*(C`END\*(C'\fR are indices in \f(CW\*(C`LINE_BUFFER\*(C'\fR saying what the boundaries of
\&\f(CW\*(C`TEXT\*(C'\fR are.
.Sp
If this function exists and returns null list or \f(CW\*(C`undef\*(C'\fR, or if this
variable is set to \f(CW\*(C`undef\*(C'\fR, then an internal function
\&\f(CW\*(C`rl_complete()\*(C'\fR will call the value of
\&\f(CW$rl_completion_entry_function\fR to generate matches, otherwise the
array of strings returned will be used.
.Sp
The default value of this variable is \f(CW\*(C`undef\*(C'\fR. You can use it as follows;
.Sp
.Vb 17
\& use Term::ReadLine;
\& ...
\& my $term = new Term::ReadLine 'sample';
\& my $attribs = $term->Attribs;
\& ...
\& sub sample_completion {
\& my ($text, $line, $start, $end) = @_;
\& # If first word then username completion, else filename completion
\& if (substr($line, 0, $start) =~ /^\es*$/) {
\& return $term->completion_matches($text,
\& $attribs->{'username_completion_function'});
\& } else {
\& return ();
\& }
\& }
\& ...
\& $attribs->{attempted_completion_function} = \e&sample_completion;
.Ve
.ie n .IP """completion_matches(TEXT, ENTRY_FUNC)""" 4
.el .IP "\f(CWcompletion_matches(TEXT, ENTRY_FUNC)\fR" 4
.IX Item "completion_matches(TEXT, ENTRY_FUNC)"
Returns an array of strings which is a list of completions for
\&\f(CW\*(C`TEXT\*(C'\fR. If there are no completions, returns \f(CW\*(C`undef\*(C'\fR. The first
entry in the returned array is the substitution for \f(CW\*(C`TEXT\*(C'\fR. The
remaining entries are the possible completions.
.Sp
\&\f(CW\*(C`ENTRY_FUNC\*(C'\fR is a generator function which has two arguments, and
returns a string. The first argument is \f(CW\*(C`TEXT\*(C'\fR. The second is a
state argument; it is zero on the first call, and non-zero on
subsequent calls. \f(CW\*(C`ENTRY_FUNC\*(C'\fR returns a \f(CW\*(C`undef\*(C'\fR to the caller when
there are no more matches.
.Sp
If the value of \f(CW\*(C`ENTRY_FUNC\*(C'\fR is undef, built-in
\&\f(CW\*(C`filename_completion_function\*(C'\fR is used.
.Sp
\&\f(CW\*(C`completion_matches\*(C'\fR is a Perl wrapper function of an internal
function \f(CW\*(C`completion_matches()\*(C'\fR. See also
\&\f(CW$rl_completion_entry_function\fR.
.ie n .IP """completion_function""" 4
.el .IP "\f(CWcompletion_function\fR" 4
.IX Item "completion_function"
A variable whose content is a reference to a function which returns a
list of candidates to complete.
.Sp
This variable is compatible with \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR and very easy
to use.
.Sp
.Vb 9
\& use Term::ReadLine;
\& ...
\& my $term = new Term::ReadLine 'sample';
\& my $attribs = $term->Attribs;
\& ...
\& $attribs->{completion_function} = sub {
\& my ($text, $line, $start) = @_;
\& return qw(a list of candidates to complete);
\& }
.Ve
.ie n .IP """list_completion_function(TEXT, STATE)""" 4
.el .IP "\f(CWlist_completion_function(TEXT, STATE)\fR" 4
.IX Item "list_completion_function(TEXT, STATE)"
A sample generator function defined by \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR.
Example code at \f(CW\*(C`rl_completion_entry_function\*(C'\fR shows how to use this
function.
.ie n .Sh """Term::ReadLine::Gnu"" Specific Features"
.el .Sh "\f(CWTerm::ReadLine::Gnu\fP Specific Features"
.IX Subsection "Term::ReadLine::Gnu Specific Features"
.ie n .IP """Term::ReadLine::Gnu"" Specific Functions" 4
.el .IP "\f(CWTerm::ReadLine::Gnu\fR Specific Functions" 4
.IX Item "Term::ReadLine::Gnu Specific Functions"
.RS 4
.PD 0
.ie n .IP """CallbackHandlerInstall(PROMPT, LHANDLER)""" 4
.el .IP "\f(CWCallbackHandlerInstall(PROMPT, LHANDLER)\fR" 4
.IX Item "CallbackHandlerInstall(PROMPT, LHANDLER)"
.PD
This method provides the function \f(CW\*(C`rl_callback_handler_install()\*(C'\fR
with the following addtional feature compatible with \f(CW\*(C`readline\*(C'\fR
method; ornament feature, \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR compatible
completion function, histroy expansion, and addition to history
buffer.
.ie n .IP """call_function(FUNCTION, [COUNT [,KEY]])""" 4
.el .IP "\f(CWcall_function(FUNCTION, [COUNT [,KEY]])\fR" 4
.IX Item "call_function(FUNCTION, [COUNT [,KEY]])"
.Vb 1
\& int rl_call_function(FunctionPtr|str function, count = 1, key = -1)
.Ve
.ie n .IP """rl_get_all_function_names""" 4
.el .IP "\f(CWrl_get_all_function_names\fR" 4
.IX Item "rl_get_all_function_names"
Returns a list of all function names.
.ie n .IP """shadow_redisplay""" 4
.el .IP "\f(CWshadow_redisplay\fR" 4
.IX Item "shadow_redisplay"
A redisplay function for password input. You can use it as follows;
.Sp
.Vb 2
\& $attribs->{redisplay_function} = $attribs->{shadow_redisplay};
\& $line = $term->readline("password> ");
.Ve
.ie n .IP """rl_filename_list""" 4
.el .IP "\f(CWrl_filename_list\fR" 4
.IX Item "rl_filename_list"
Returns candidates of filename to complete. This function can be used
with \f(CW\*(C`completion_function\*(C'\fR and is implemented for the compatibility
with \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR.
.ie n .IP """list_completion_function""" 4
.el .IP "\f(CWlist_completion_function\fR" 4
.IX Item "list_completion_function"
See the description of section \*(L"Custom Completion\*(R".
.RE
.RS 4
.RE
.ie n .IP """Term::ReadLine::Gnu"" Specific Variables" 4
.el .IP "\f(CWTerm::ReadLine::Gnu\fR Specific Variables" 4
.IX Item "Term::ReadLine::Gnu Specific Variables"
.RS 4
.PD 0
.ie n .IP """do_expand""" 4
.el .IP "\f(CWdo_expand\fR" 4
.IX Item "do_expand"
.PD
When true, the history expansion is enabled. By default false.
.ie n .IP """completion_function""" 4
.el .IP "\f(CWcompletion_function\fR" 4
.IX Item "completion_function"
See the description of section \*(L"Custom Completion\*(R".
.ie n .IP """completion_word""" 4
.el .IP "\f(CWcompletion_word\fR" 4
.IX Item "completion_word"
A reference to a list of candidates to complete for
\&\f(CW\*(C`list_completion_function\*(C'\fR.
.RE
.RS 4
.RE
.ie n .IP """Term::ReadLine::Gnu"" Specific Commands" 4
.el .IP "\f(CWTerm::ReadLine::Gnu\fR Specific Commands" 4
.IX Item "Term::ReadLine::Gnu Specific Commands"
.RS 4
.PD 0
.ie n .IP """history\-expand\-line""" 4
.el .IP "\f(CWhistory\-expand\-line\fR" 4
.IX Item "history-expand-line"
.PD
The equivalent of the Bash \f(CW\*(C`history\-expand\-line\*(C'\fR editing command.
.ie n .IP """operate\-and\-get\-next""" 4
.el .IP "\f(CWoperate\-and\-get\-next\fR" 4
.IX Item "operate-and-get-next"
The equivalent of the Korn shell \f(CW\*(C`operate\-and\-get\-next\-history\-line\*(C'\fR
editing command and the Bash \f(CW\*(C`operate\-and\-get\-next\*(C'\fR.
.Sp
This command is bound to \f(CW\*(C`\eC\-o\*(C'\fR by default for the compatibility with
the Bash and \f(CW\*(C`Term::ReadLine::Perl\*(C'\fR.
.ie n .IP """display\-readline\-version""" 4
.el .IP "\f(CWdisplay\-readline\-version\fR" 4
.IX Item "display-readline-version"
Shows the version of \f(CW\*(C`Term::ReadLine::Gnu\*(C'\fR and the one of the \s-1GNU\s0
Readline Library.
.ie n .IP """change\-ornaments""" 4
.el .IP "\f(CWchange\-ornaments\fR" 4
.IX Item "change-ornaments"
Change ornaments interactively.
.RE
.RS 4
.RE
.SH "FILES"
.IX Header "FILES"
.IP "\fI~/.inputrc\fR" 4
.IX Item "~/.inputrc"
Readline init file. Using this file it is possible that you would
like to use a different set of key bindings. When a program which
uses the Readline library starts up, the init file is read, and the
key bindings are set.
.Sp
Conditional key binding is also available. The program name which is
specified by the first argument of \f(CW\*(C`new\*(C'\fR method is used as the
application construct.
.Sp
For example, when your program call \f(CW\*(C`new\*(C'\fR method like this;
.Sp
.Vb 3
\& ...
\& $term = new Term::ReadLine 'PerlSh';
\& ...
.Ve
.Sp
your \fI~/.inputrc\fR can define key bindings only for it as follows;
.Sp
.Vb 7
\& ...
\& $if PerlSh
\& Meta-Rubout: backward-kill-word
\& "\eC-x\eC-r": re-read-init-file
\& "\ee[11~": "Function Key 1"
\& $endif
\& ...
.Ve
.SH "EXPORTS"
.IX Header "EXPORTS"
None.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
.IP "\s-1GNU\s0 Readline Library Manual" 4
.IX Item "GNU Readline Library Manual"
.PD 0
.IP "\s-1GNU\s0 History Library Manual" 4
.IX Item "GNU History Library Manual"
.ie n .IP """Term::ReadLine""" 4
.el .IP "\f(CWTerm::ReadLine\fR" 4
.IX Item "Term::ReadLine"
.ie n .IP """Term::ReadLine::Perl"" (Term\-ReadLine\-Perl\-xx.tar.gz)" 4
.el .IP "\f(CWTerm::ReadLine::Perl\fR (Term\-ReadLine\-Perl\-xx.tar.gz)" 4
.IX Item "Term::ReadLine::Perl (Term-ReadLine-Perl-xx.tar.gz)"
.IP "\fIeg/*\fR and \fIt/*\fR in the Term::ReadLine::Gnu distribution" 4
.IX Item "eg/* and t/* in the Term::ReadLine::Gnu distribution"
.IP "Articles related to Term::ReadLine::Gnu" 4
.IX Item "Articles related to Term::ReadLine::Gnu"
.RS 4
.IP "effective perl programming" 4
.IX Item "effective perl programming"
.PD
.Vb 1
\& http://www.usenix.org/publications/login/2000-7/features/effective.html
.Ve
.Sp
This article demonstrates how to integrate Term::ReadLine::Gnu into an
interactive command line program.
.IP "eijiro (Japanese)" 4
.IX Item "eijiro (Japanese)"
.Vb 1
\& http://bulknews.net/lib/columns/02_eijiro/column.html
.Ve
.Sp
A command line interface to Eijiro, Japanese-English dictionary
service on \s-1WWW\s0.
.RE
.RS 4
.RE
.IP "Works which use Term::ReadLine::Gnu" 4
.IX Item "Works which use Term::ReadLine::Gnu"
.RS 4
.PD 0
.IP "Perl Debugger" 4
.IX Item "Perl Debugger"
.PD
.Vb 1
\& perl -d
.Ve
.IP "The Perl Shell (psh)" 4
.IX Item "The Perl Shell (psh)"
.Vb 1
\& http://www.focusresearch.com/gregor/psh/
.Ve
.Sp
The Perl Shell is a shell that combines the interactive nature of a
Unix shell with the power of Perl.
.Sp
A programmable completion feature compatible with bash is implemented.
.IP "\s-1SPP\s0 (Synopsys Plus Perl)" 4
.IX Item "SPP (Synopsys Plus Perl)"
.Vb 1
\& http://www.stanford.edu/~jsolomon/SPP/
.Ve
.Sp
\&\s-1SPP\s0 (Synopsys Plus Perl) is a Perl module that wraps around Synopsys'
shell programs. \s-1SPP\s0 is inspired by the original dc_perl written by
Steve Golson, but it's an entirely new implementation. Why is it
called \s-1SPP\s0 and not dc_perl? Well, \s-1SPP\s0 was written to wrap around any
of Synopsys' shells.
.IP "\s-1PFM\s0 (Personal File Manager for Unix/Linux)" 4
.IX Item "PFM (Personal File Manager for Unix/Linux)"
.Vb 1
\& http://p-f-m.sourceforge.net/
.Ve
.Sp
Pfm is a terminal-based file manager written in Perl, based on \s-1PFM\s0.COM
for MS-DOS (originally by Paul Culley and Henk de Heer).
.IP "The soundgrab" 4
.IX Item "The soundgrab"
.Vb 1
\& http://rawrec.sourceforge.net/soundgrab/soundgrab.html
.Ve
.Sp
soundgrab is designed to help you slice up a big long raw audio file
(by default 44.1 kHz 2 channel signed sixteen bit little endian) and
save your favorite sections to other files. It does this by providing
you with a cassette player like command line interface.
.IP "\s-1PDL\s0 (The Perl Data Language)" 4
.IX Item "PDL (The Perl Data Language)"
.Vb 1
\& http://pdl.perl.org/index_en.html
.Ve
.Sp
\&\s-1PDL\s0 (``Perl Data Language'') gives standard Perl the ability to
compactly store and speedily manipulate the large N\-dimensional data
arrays which are the bread and butter of scientific computing.
.IP "\s-1PIQT\s0 (Perl Interactive \s-1DBI\s0 Query Tool)" 4
.IX Item "PIQT (Perl Interactive DBI Query Tool)"
.Vb 1
\& http://piqt.sourceforge.net/
.Ve
.Sp
\&\s-1PIQT\s0 is an interactive query tool using the Perl \s-1DBI\s0 database
interface. It supports ReadLine, provides a built in scripting language
with a Lisp like syntax, an online help system, and uses wrappers to
interface to the \s-1DBD\s0 modules.
.IP "Ghostscript Shell" 4
.IX Item "Ghostscript Shell"
.Vb 1
\& http://www.panix.com/~jdf/gshell/
.Ve
.Sp
It provides a friendly way to play with the Ghostscript interpreter,
including command history and auto-completion of Postscript font names
and reserved words.
.RE
.RS 4
.Sp
If you know any other works which can be listed here, please let me
know.
.RE
.SH "AUTHOR"
.IX Header "AUTHOR"
Hiroo Hayashi \f(CW\*(C`<hiroo.hayashi@computer.org>\*(C'\fR
.PP
\&\f(CW\*(C`http://www.perl.org/CPAN/authors/Hiroo_HAYASHI/\*(C'\fR
.SH "TODO"
.IX Header "TODO"
\&\s-1GTK+\s0 support in addition to Tk.
.SH "BUGS"
.IX Header "BUGS"
\&\f(CW\*(C`rl_add_defun()\*(C'\fR can define up to 16 functions.
.PP
Ornament feature works only on prompt strings. It requires very hard
hacking of \f(CW\*(C`display.c:rl_redisplay()\*(C'\fR in \s-1GNU\s0 Readline library to
ornament input line.
.PP
\&\f(CW\*(C`newTTY()\*(C'\fR is not tested yet.