예제 #1
0
파일: vt320.c 프로젝트: hharte/vttest
static void
show_ExtendedCursorPosition(char *report)
{
  int pos = 0;
  int Pl = scan_any(report, &pos, 'R');
  int Pc = scan_any(report, &pos, 'R');
  int Pp = scan_any(report, &pos, 'R');

  if (Pl != 0 && Pc != 0) {
    if (Pp != 0)
      show_result("Line %d, Column %d, Page %d", Pl, Pc, Pp);
    else
      show_result("Line %d, Column %d (Page?)", Pl, Pc);
  } else
    show_result(SHOW_FAILURE);
}
예제 #2
0
파일: vt220.c 프로젝트: RyanHope/wTerm
static void
show_OperatingStatus(char *report)
{
    int pos = 0;
    int Ps1 = scan_any(report, &pos, 'n');
    int Ps2 = scanto(report, &pos, 'n');
    const char *show;

    switch (Ps1) {
    case 0:
        show = "Terminal is in good operating condition";
        break;
    case 3:
        show = "Terminal has a malfunction";
        break;
    default:
        show = SHOW_FAILURE;
    }
    show_result(show, Ps2);
}
예제 #3
0
파일: vt220.c 프로젝트: RyanHope/wTerm
/*
 * Request  CSI ? 26 n            keyboard dialect
 * Response CSI ? 27; Ps n
 */
static void
show_KeyboardStatus(char *report)
{
    int pos = 0;
    int code;
    int save;
    const char *show = SHOW_FAILURE;

    if ((code = scanto(report, &pos, ';')) == 27
            && (code = scan_any(report, &pos, 'n')) != 0) {
    /* *INDENT-OFF* */
    switch(code) {
    case  1:  show = "North American/ASCII"; break;
    case  2:  show = "British";              break;
    case  3:  show = "Flemish";              break;
    case  4:  show = "French Canadian";      break;
    case  5:  show = "Danish";               break;
    case  6:  show = "Finnish";              break;
    case  7:  show = "German";               break;
    case  8:  show = "Dutch";                break;
    case  9:  show = "Italian";              break;
    case 10:  show = "Swiss (French)";       break;
    case 11:  show = "Swiss (German)";       break;
    case 12:  show = "Swedish";              break;
    case 13:  show = "Norwegian/Danish";     break;
    case 14:  show = "French/Belgian";       break;
    case 15:  show = "Spanish Int.";         break;
    case 16:  show = "Portugese";            break; /* vt3XX */
    case 19:  show = "Hebrew";               break; /* vt5XX: kermit says 14 */
    case 22:  show = "Greek";                break; /* vt5XX */
    case 28:  show = "Canadian (English)";   break; /* vt4XX */
    case 29:  show = "Turkish Q/Turkish";    break; /* vt5XX */
    case 30:  show = "Turkish F/Turkish";    break; /* vt5XX */
    case 31:  show = "Hungarian";            break; /* vt5XX */
    case 32:  show = "Spanish National";     break; /* vt4XX in PC mode */
    case 33:  show = "Slovak";               break; /* vt5XX */
    case 34:  show = "Czech";                break; /* vt5XX */
    case 35:  show = "Polish";               break; /* vt5XX */
    case 36:  show = "Romanian";             break; /* vt5XX */
    case 38:  show = "SCS";                  break; /* vt5XX */
    case 39:  show = "Russian";              break; /* vt5XX */
    case 40:  show = "Latin American";       break; /* vt5XX */
    default:  show = "unknown";
    }
    /* *INDENT-ON* */

    }
    show_result("%s", show);

    /* vt420 implements additional parameters past those reported by the VT220 */
    save = pos;
    code = scan_any(report, &pos, 'n');
    if (save != pos) {
        vt_move(5, 10);
    /* *INDENT-OFF* */
    switch(code) {
    case 0:  show = "keyboard ready"; break;
    case 3:  show = "no keyboard";    break;
    case 8:  show = "keyboard busy";  break;
    default: show = "unknown keyboard status";
    }
    /* *INDENT-ON* */

        show_result("%s", show);

        vt_move(6, 10);
    /* *INDENT-OFF* */
    switch (scan_any(report, &pos, 'n')) {
    case 0:  show = "LK201"; break;
    case 1:  show = "LK401"; break;
    default: show = "unknown keyboard type";
    }
    /* *INDENT-ON* */

        show_result("%s", show);
    }
}