mirror of
https://github.com/pygos/init.git
synced 2024-11-05 04:07:10 +01:00
16 lines
240 B
C
16 lines
240 B
C
|
#include <string.h>
|
||
|
|
||
|
#include "util.h"
|
||
|
|
||
|
const enum_map_t *enum_by_name(const enum_map_t *map, const char *name)
|
||
|
{
|
||
|
size_t i;
|
||
|
|
||
|
for (i = 0; map[i].name != NULL; ++i) {
|
||
|
if (!strcmp(map[i].name, name))
|
||
|
return map + i;
|
||
|
}
|
||
|
|
||
|
return NULL;
|
||
|
}
|