[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.2 Custom Functions
Readline provides many functions for manipulating the text of the line, but it isn’t possible to anticipate the needs of all programs. This section describes the various functions and variables defined within the Readline library which allow a user program to add customized functionality to Readline.
Before declaring any functions that customize Readline’s behavior, or
using any functionality Readline provides in other code, an
application writer should include the file <readline/readline.h>
in any file that uses Readline’s features. Since some of the definitions
in readline.h
use the stdio
library, the file
<stdio.h>
should be included before readline.h
.
readline.h
defines a C preprocessor variable that should
be treated as an integer, RL_READLINE_VERSION
, which may
be used to conditionally compile application code depending on
the installed Readline version. The value is a hexadecimal
encoding of the major and minor version numbers of the library,
of the form 0xMMmm. MM is the two-digit major
version number; mm is the two-digit minor version number.
For Readline 4.2, for example, the value of
RL_READLINE_VERSION
would be 0x0402
.
2.2.1 Readline Typedefs | C declarations to make code readable. | |
2.2.2 Writing a New Function | Variables and calling conventions. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |