Logo Search packages:      
Sourcecode: iterm version File versions  Download package

void VT100_register_sequence ( VT100 vt100,
unsigned char *  sequence,
state_t  next_state_t,
callback_func  func,
void *  object 
)

register escape sequence to VT100 object

Parameters:
vt100 reference to VT100 object
sequene NULL terminated character sequence
next_state_t next state vt100 transits after processing this sequence
func callback function when vt100 takes this sequence
object passed to callback function as a first parameter

Definition at line 145 of file vt100.c.

References _VT100::all_states, _Handler::next_state, and _State::sequence.

{
  State *state = &vt100->all_states[GROUND_STATE];
  State *next_state;
  int i;
  int len = strlen(sequence)-1;

  for(i=0;i<len;i++)
  {
    if(state->sequence[sequence[i]].next_state != NULL)
        state = state->sequence[sequence[i]].next_state;
  }
  if(state == NULL)
      return;

  if( next_state_t == NO_MOVE)
      next_state = NULL;
  else
      next_state = &vt100->all_states[next_state_t];
  
  State_register_char(state,next_state,sequence[i],func,object);
}


Generated by  Doxygen 1.6.0   Back to index