iPXE
|
Editable strings. More...
Go to the source code of this file.
Data Structures | |
struct | edit_string |
An editable string. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | init_editstring (struct edit_string *string, char *buf, size_t len) |
Initialise editable string. More... | |
void | replace_string (struct edit_string *string, const char *replacement) __nonnull |
Replace editable string. More... | |
int | edit_string (struct edit_string *string, int key) __nonnull |
Edit editable string. More... | |
Editable strings.
Definition in file editstring.h.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Initialise editable string.
string | Editable string |
buf | Buffer for string |
len | Length of buffer |
Definition at line 38 of file editstring.h.
References len.
Referenced by init_editbox(), and readline_history().
void replace_string | ( | struct edit_string * | string, |
const char * | replacement | ||
) |
Replace editable string.
string | Editable string |
replacement | Replacement string |
Definition at line 173 of file editstring.c.
References insert_delete().
Referenced by readline_history().
int edit_string | ( | struct edit_string * | string, |
int | key | ||
) |
Edit editable string.
string | Editable string |
key | Key pressed by user |
key | Key returned to application, or zero |
Handles keypresses and updates the content of the editable string. Basic line editing facilities (delete/insert/cursor) are supported. If edit_string() understands and uses the keypress it will return zero, otherwise it will return the original key.
This function does not update the display in any way.
The string's edit history will be updated to allow the caller to efficiently bring the display into sync with the string content.
Definition at line 195 of file editstring.c.
References backspace(), CTRL_A, CTRL_B, CTRL_D, CTRL_E, CTRL_F, CTRL_K, CTRL_U, CTRL_W, delete_character(), insert_character(), key, KEY_BACKSPACE, KEY_DC, KEY_END, KEY_HOME, KEY_LEFT, KEY_RIGHT, kill_eol(), kill_sol(), kill_word(), len, retval, string, and strlen().
Referenced by edit_editbox(), and readline_history().