ct_state_to_string(uint32_t state)
{
    switch (state) {
#define CS_STATE(ENUM, INDEX, NAME) case CS_##ENUM: return NAME;
        CS_STATES
#undef CS_STATE
    default:
        return NULL;
    }
}
ct_state_to_string(uint32_t state)
{
    switch (state) {
#define CS_STATE(ENUM, INDEX, NAME) case CS_##ENUM: return NAME;
        CS_STATES
#undef CS_STATE
    default:
        return NULL;
    }
}