Get enum name from value. If no match is found NULL is returned. */
| 282 | |
| 283 | /* Get enum name from value. If no match is found NULL is returned. */ |
| 284 | const char *configEnumGetName(configEnum *ce, int val) { |
| 285 | while(ce->name != NULL) { |
| 286 | if (ce->val == val) return ce->name; |
| 287 | ce++; |
| 288 | } |
| 289 | return NULL; |
| 290 | } |
| 291 | |
| 292 | /* Wrapper for configEnumGetName() returning "unknown" instead of NULL if |
| 293 | * there is no match. */ |
no outgoing calls
no test coverage detected