mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
libutil/util_fmt: Add util_fmt_type_to_name()
Add a function to get the textual name of an enum util_fmt_t value. To make this robust to changes in the order of elements in the format array initialize this using named indices. Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
e8550a4f8d
commit
8a4a4e0557
@@ -157,6 +157,16 @@ void util_fmt_exit(void);
|
||||
*/
|
||||
bool util_fmt_name_to_type(const char *name, enum util_fmt_t *type);
|
||||
|
||||
/**
|
||||
* util_fmt_type_to_name() - Get name of given format type identifier.
|
||||
* @type: Format type identifier
|
||||
*
|
||||
* Get the name corresponding to the given format type identifier.
|
||||
*
|
||||
* Return: name of the format type
|
||||
*/
|
||||
const char *util_fmt_type_to_name(enum util_fmt_t type);
|
||||
|
||||
/**
|
||||
* util_fmt_set_indent() - Set indentation parameters.
|
||||
* @base : Base indentation level to apply to all output lines (default 0)
|
||||
|
||||
Reference in New Issue
Block a user