Home | History | Annotate | Download | only in hci

Lines Matching defs:string

22 #include <string.h>
37 static void sync_console ( struct edit_string *string ) __nonnull;
40 * Synchronise console with edited string
42 * @v string Editable string
44 static void sync_console ( struct edit_string *string ) {
45 unsigned int mod_start = string->mod_start;
46 unsigned int mod_end = string->mod_end;
47 unsigned int cursor = string->last_cursor;
48 size_t len = strlen ( string->buf );
51 if ( mod_start > string->last_cursor )
52 mod_start = string->last_cursor;
55 if ( mod_end < string->cursor )
56 mod_end = string->cursor;
66 putchar ( ( cursor >= len ) ? ' ' : string->buf[cursor] );
71 while ( cursor > string->cursor ) {
80 * @v prompt Prompt string
88 struct edit_string string;
95 memset ( &string, 0, sizeof ( string ) );
96 string.buf = buf;
97 string.len = sizeof ( buf );
101 key = edit_string ( &string, getkey() );
102 sync_console ( &string );