# HG changeset patch # User Myhailo Danylenko # Date 1345395209 -10800 # Node ID 2278dd806ad3a7ab195b4a744e7bfe125973e544 # Parent 4b9d1a7e68613e7e1ec7194817d1b1364f966b64 Add header to utils diff -r 4b9d1a7e6861 -r 2278dd806ad3 docs/api.mdwn --- a/docs/api.mdwn Sun Aug 19 15:43:14 2012 +0300 +++ b/docs/api.mdwn Sun Aug 19 19:53:29 2012 +0300 @@ -537,8 +537,12 @@ - - - + +## Utility Lua Routines +To handle conversion of enums and flag fields to/from human-readable strings. + -## argument enum field +### argument enum field String that will be converted to number or just plain number, that will be passed as is. Note, that if enum name is not recognized no error will be raised and default vale will be used. diff -r 4b9d1a7e6861 -r 2278dd806ad3 util.c --- a/util.c Sun Aug 19 15:43:14 2012 +0300 +++ b/util.c Sun Aug 19 19:53:29 2012 +0300 @@ -20,6 +20,9 @@ #include "util.h" +/// Utility Lua Routines +/// To handle conversion of enums and flag fields to/from human-readable strings. + enum_value_t string2enum (const char *string, const string2enum_t *set) { while (set->string) {