ct_state_from_string(const char *s)
{
#define CS_STATE(ENUM, INDEX, NAME) \
    if (!strcmp(s, NAME)) {         \
        return CS_##ENUM;           \
    }
    CS_STATES
#undef CS_STATE
    return 0;
}
ct_state_from_string(const char *s)
{
#define CS_STATE(ENUM, INDEX, NAME) \
    if (!strcmp(s, NAME)) {         \
        return CS_##ENUM;           \
    }
    CS_STATES
#undef CS_STATE
    return 0;
}