aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/editstring.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2011-03-29 16:34:07 +0100
committerMichael Brown <mcb30@ipxe.org>2011-03-30 17:12:10 +0100
commit6a6dd5c4524774a6a32cb5c49713ae3250f98da0 (patch)
treeaf7b2cf99aa3ed157d5af18d97c2dba54d92f5c2 /src/include/ipxe/editstring.h
parent293e347a2e1bae19842704b60b1788ccaf401075 (diff)
downloadipxe-6a6dd5c4524774a6a32cb5c49713ae3250f98da0.tar.gz
[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>
Diffstat (limited to 'src/include/ipxe/editstring.h')
-rw-r--r--src/include/ipxe/editstring.h13
1 files changed, 13 insertions, 0 deletions
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 */