 int _bnfa_list_get_next_state(bnfa_struct_t* bnfa, int state, int input) {     if ( state == 0 )   /* Full set of states  always */     {         bnfa_state_t* p = (bnfa_state_t*)bnfa->bnfaTransTable[0];         if (!p)         {             return 0;         }         return p[input];     }     else     {         bnfa_trans_node_t* t = bnfa->bnfaTransTable[state];         while ( t )         {             if ( t->key == (unsigned)input )             {                 return t->next_state;             }             t=t->next;         }         return BNFA_FAIL_STATE; /* Fail state */     } } 