diff options
author | Thomas Haller <thaller@redhat.com> | 2016-01-24 11:35:26 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-01-24 14:20:57 +0100 |
commit | 8956ea661c1f591eba73a8a775ce56eff986003d (patch) | |
tree | b0816d7e0690328651db810924ca222b0a604d3f /src/NetworkManagerUtils.h | |
parent | 0ce83890bfb8653e06e3882aed3f9e28234642c8 (diff) | |
download | NetworkManager-8956ea661c1f591eba73a8a775ce56eff986003d.tar.gz |
utils: add NM_UTILS_STRING_LOOKUP_TABLE_ITEM() macro
Diffstat (limited to 'src/NetworkManagerUtils.h')
-rw-r--r-- | src/NetworkManagerUtils.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h index 1920c3d5bb..d6676481ee 100644 --- a/src/NetworkManagerUtils.h +++ b/src/NetworkManagerUtils.h @@ -260,6 +260,9 @@ const char *nm_utils_enum2str (const NMUtilsEnum2StrDesc *descs, /*****************************************************************************/ +#define NM_UTILS_STRING_LOOKUP_TABLE_ITEM(v, n) [v] = n +#define NM_UTILS_STRING_LOOKUP_TABLE_ITEM_S(v, n) NM_UTILS_STRING_LOOKUP_TABLE_ITEM(v, ""n"") + #define _NM_UTILS_STRING_LOOKUP_TABLE_DEFINE(scope, fcn_name, lookup_type, unknown_val, ...) \ scope const char * \ fcn_name (lookup_type idx) \ |