| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.4.10 Utility Functions
- Function: int rl_save_state (struct readline_state *sp)
Save a snapshot of Readline’s internal state to sp. The contents of the readline_state structure are documented in ‘readline.h’. The caller is responsible for allocating the structure.
- Function: int rl_restore_state (struct readline_state *sp)
Restore Readline’s internal state to that stored in sp, which must have been saved by a call to
rl_save_state. The contents of the readline_state structure are documented in ‘readline.h’. The caller is responsible for freeing the structure.
- Function: void rl_free (void *mem)
Deallocate the memory pointed to by mem. mem must have been allocated by
malloc.
- Function: void rl_replace_line (const char *text, int clear_undo)
Replace the contents of
rl_line_bufferwith text. The point and mark are preserved, if possible. If clear_undo is non-zero, the undo list associated with the current line is cleared.
- Function: void rl_extend_line_buffer (int len)
Ensure that
rl_line_bufferhas enough space to hold len characters, possibly reallocating it if necessary.
- Function: int rl_initialize (void)
Initialize or re-initialize Readline’s internal state. It’s not strictly necessary to call this;
readline()calls it before reading any input.
- Function: void rl_display_match_list (char **matches, int len, int max)
A convenience function for displaying a list of strings in columnar format on Readline’s output stream.
matchesis the list of strings, in argv format, such as a list of completion matches.lenis the number of strings inmatches, andmaxis the length of the longest string inmatches. This function uses the setting ofprint-completions-horizontallyto select how the matches are displayed (see section Readline Init File Syntax). When displaying completions, this function sets the number of columns used for display to the value ofcompletion-display-width, the value of the environment variableCOLUMNS, or the screen width, in that order.
The following are implemented as macros, defined in chardefs.h.
Applications should refrain from using them.
- Function: int _rl_to_upper (int c)
If c is a lowercase alphabetic character, return the corresponding uppercase character.
- Function: int _rl_to_lower (int c)
If c is an uppercase alphabetic character, return the corresponding lowercase character.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
