Пример #1
0
/***************************************************************************
 * Read and process output from the application
 ***************************************************************************/
void get_token()
{
   unsigned int c;	/* magic token GCC_NULL is 0x100 so need an int*/ 


   /* somewhat changed. Matthias */ 
   /* Wait for something to do! */
   c = get_com_char(0);
   do {
     /* Got a character. Figure out what to do with it. */
      if(c>=' ' || c == '\n' || c == '\r' || c == '\t') 
	read_string();
      else
	{
	  switch(c)
	    {
	    case 0:         /* NUL does nothing */
	      break;
	    case EOF:
	      clean_exit(0);
	      break;
	    case 5:
	      cprintf("\033[?1;2c");/* I'm a VT100 w/ advanced video options */
	      break;
	    case 0xb:
	      scr_index(1);
	      break;
	    case 0xc:
	      scr_index(1);
	      break;
	    case ESC:
	      process_escape_sequence();
	      break;
	    case '\b' :
	      scr_backspace();
	      break;
	    case '\007' :	/* bell */
#ifdef MAPALERT
	      if (map_alert) XMapWindow(display,main_win);
#endif
	      XBell(display,0);
	      break;
	    case '\016':
	      scr_choose_charset(1);
	      break;
	    case '\017':
	      scr_choose_charset(0);
	      break;
	    }
	}
      c = get_com_char(1);
   }while(c != (unsigned int) GCC_NULL);
}
Пример #2
0
condcode    scr_pos( parm parms[MAX_FUN_PARMS], size_t parmcount, char * * result, int32_t ressize )
{
    char            *   pwk;

    if( parmcount < 2 ) {
        return( neg );
    }

    pwk = parms[0].a;
    parms[0].a = parms[1].a;
    parms[1].a = pwk;

    pwk = parms[0].e;
    parms[0].e = parms[1].e;
    parms[1].e = pwk;

    return( scr_index( parms, parmcount, result, ressize ) );
}
Пример #3
0
void process_escape_sequence()
{
  int c,a;

  c = get_com_char(0);
  switch(c)
    {
    case '[':
      process_csi_sequence();
      break;
    case ']':
      process_xterm_sequence();
      break;
    case '(':
      scr_set_charset(0,get_com_char(0));
      break;
    case ')':
      scr_set_charset(1,get_com_char(0));
      break;
    case '7':
      scr_save_cursor();
      break;
    case '8' :
      scr_restore_cursor();
      break;
    case '=' :
      app_kp_keys = 1;
      break;
    case '>' :
      app_kp_keys = 0;
      break;
    case 'D' :
      scr_index(1);
      break;
    case 'E':
      scr_add_lines("\n\r",1,2);
      break;
    case 'M' :
      scr_index(-1);
      break;
    case 'Z' :
      /* cprintf("\033[?6c"); */	/* I am a VT102 */
      cprintf("\033[?1;2c");	/* changed to vt100 (Matthias) */ 
      break;
    case 'c' :                  /* restore power-on values */
      scr_power_on();
      break;
    case '#':                /* set character size */
      a=get_com_char(0);
      if(a=='8')
	scr_E();
      break;
    case 'H' :               /* horizontal tab set */
      scr_set_tab(1);
      break;
    case 'G' :
      process_robs_sequence();
    default:
      return;
    }
}