From 6a6dd5c4524774a6a32cb5c49713ae3250f98da0 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 29 Mar 2011 16:34:07 +0100 Subject: [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 --- src/include/ipxe/editstring.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/include') diff --git a/src/include/ipxe/editstring.h b/src/include/ipxe/editstring.h index 5c1a18bea..26cb434cf 100644 --- a/src/include/ipxe/editstring.h +++ b/src/include/ipxe/editstring.h @@ -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 */ -- cgit v1.2.3-55-g7522