mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
[readline] Add init_editstring() wrapper function
Standardise on using init_editstring() to initialise an embedded editable string, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -28,6 +28,19 @@ struct edit_string {
|
||||
unsigned int mod_end;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialise editable string
|
||||
*
|
||||
* @v string Editable string
|
||||
* @v buf Buffer for string
|
||||
* @v len Length of buffer
|
||||
*/
|
||||
static inline void init_editstring ( struct edit_string *string, char *buf,
|
||||
size_t len ) {
|
||||
string->buf = buf;
|
||||
string->len = len;
|
||||
}
|
||||
|
||||
extern int edit_string ( struct edit_string *string, int key ) __nonnull;
|
||||
|
||||
#endif /* _IPXE_EDITSTRING_H */
|
||||
|
||||
Reference in New Issue
Block a user