Get enum name from value. If no match is found NULL is returned. */
| 268 | |
| 269 | /* Get enum name from value. If no match is found NULL is returned. */ |
| 270 | const char *configEnumGetName(configEnum *ce, int val) { |
| 271 | while(ce->name != NULL) { |
| 272 | if (ce->val == val) return ce->name; |
| 273 | ce++; |
| 274 | } |
| 275 | return NULL; |
| 276 | } |
| 277 | |
| 278 | /* Wrapper for configEnumGetName() returning "unknown" instead of NULL if |
| 279 | * there is no match. */ |
no outgoing calls
no test coverage detected