summaryrefslogtreecommitdiff
path: root/lib/include/util.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-03-25 01:55:08 +0100
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-03-25 01:55:08 +0100
commitf97add9041c7cf330d2743b1dca9267676bdaa72 (patch)
tree7b1a5b4418367e1462d912cdff17a1b2d1173c37 /lib/include/util.h
parent9257f12e68794a557496637e2fa951738a37af26 (diff)
Add file with service enum conversion functions
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib/include/util.h')
-rw-r--r--lib/include/util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/include/util.h b/lib/include/util.h
index ed5dac2..9ba9ffb 100644
--- a/lib/include/util.h
+++ b/lib/include/util.h
@@ -70,6 +70,13 @@ int splitkv(char *line, char **key, char **value);
const enum_map_t *enum_by_name(const enum_map_t *map, const char *name);
/*
+ Search through an array of enum_map_t entries to resolve a numeric
+ value to a string name. The end of the map is indicated by a sentinel
+ entry with the name set to NULL.
+*/
+const char *enum_to_name(const enum_map_t *map, int value);
+
+/*
Create a copy of the input string inp, but replace all occourances
of %<number> with argv[number] if the number is within the bounds
specified by argc.