GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Macros | Functions
Vt102Emulation.cpp File Reference
#include "unix/Vt102Emulation.h"
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include <QtCore/QEvent>
#include <QKeyEvent>
#include <QtCore/QByteRef>
#include "unix/KeyboardTranslator.h"
#include "unix/Screen.h"
Include dependency graph for Vt102Emulation.cpp:

Go to the source code of this file.

Macros

#define ANSWER_BACK   ""
#define ces(C)   ( cc < 256 && (tbl[ cc ] & (C)) == (C) && !Xte)
#define CHARSET   _charset[_currentScreen==_screen[1]]
#define CHR   2
#define CNTL(c)   ((c)-'@')
#define CPN   4
#define CPS   64
#define CTL   1
#define DIG   8
#define eec(C)   (p >= 3 && cc == (C))
#define ees(C)   (p >= 3 && cc < 256 && (tbl[ cc ] & (C)) == (C))
#define egt()   (p >= 3 && s[2] == '>' )
#define encodeMode(M, B)   BITS(B,getMode(M))
#define encodeStat(M, B)   BITS(B,((ev->modifiers() & (M)) == (M)))
#define epe()   (p >= 3 && s[2] == '!' )
#define epp()   (p >= 3 && s[2] == '?' )
#define eps(C)   (p >= 3 && s[2] != '?' && s[2] != '!' && s[2] != '>' && cc < 256 && (tbl[ cc ] & (C)) == (C))
#define ESC   27
#define GRP   32
#define lec(P, L, C)   (p == (P) && s[(L)] == (C))
#define les(P, L, C)   (p == (P) && s[L] < 256 && (tbl[s[(L)]] & (C)) == (C))
#define lun()   (p == 1 && cc >= 32 )
#define SCS   16
#define TY_CHR()   TY_CONSTR(0,0,0)
#define TY_CONSTR(T, A, N)   ( ((((int)N) & 0xffff) << 16) | ((((int)A) & 0xff) << 8) | (((int)T) & 0xff) )
#define TY_CSI_PE(A)   TY_CONSTR(10,A,0)
#define TY_CSI_PG(A)   TY_CONSTR(9,A,0)
#define TY_CSI_PN(A)   TY_CONSTR(6,A,0)
#define TY_CSI_PR(A, N)   TY_CONSTR(7,A,N)
#define TY_CSI_PS(A, N)   TY_CONSTR(5,A,N)
#define TY_CTL(A)   TY_CONSTR(1,A,0)
#define TY_ESC(A)   TY_CONSTR(2,A,0)
#define TY_ESC_CS(A, B)   TY_CONSTR(3,A,B)
#define TY_ESC_DE(A)   TY_CONSTR(4,A,0)
#define TY_VT52(A)   TY_CONSTR(8,A,0)
#define Xpe   (ppos>=2 && pbuf[1] == ']' )
#define Xte   (Xpe && cc == 7 )

Functions

static void hexdump (int *s, int len)

Macro Definition Documentation

#define ANSWER_BACK   ""

Definition at line 878 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::reportAnswerBack().

#define ces (   C)    ( cc < 256 && (tbl[ cc ] & (C)) == (C) && !Xte)

Definition at line 280 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define CHARSET   _charset[_currentScreen==_screen[1]]
#define CHR   2
#define CNTL (   c)    ((c)-'@')

Definition at line 283 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define CPN   4
#define CPS   64
#define CTL   1
#define DIG   8
#define eec (   C)    (p >= 3 && cc == (C))

Definition at line 272 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define ees (   C)    (p >= 3 && cc < 256 && (tbl[ cc ] & (C)) == (C))

Definition at line 273 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define egt ( )    (p >= 3 && s[2] == '>' )

Definition at line 277 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define encodeMode (   M,
  B 
)    BITS(B,getMode(M))

Definition at line 920 of file Vt102Emulation.cpp.

#define encodeStat (   M,
  B 
)    BITS(B,((ev->modifiers() & (M)) == (M)))

Definition at line 921 of file Vt102Emulation.cpp.

#define epe ( )    (p >= 3 && s[2] == '!' )

Definition at line 276 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define epp ( )    (p >= 3 && s[2] == '?' )

Definition at line 275 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define eps (   C)    (p >= 3 && s[2] != '?' && s[2] != '!' && s[2] != '>' && cc < 256 && (tbl[ cc ] & (C)) == (C))
#define ESC   27

Definition at line 282 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define GRP   32
#define lec (   P,
  L,
  C 
)    (p == (P) && s[(L)] == (C))

Definition at line 269 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define les (   P,
  L,
  C 
)    (p == (P) && s[L] < 256 && (tbl[s[(L)]] & (C)) == (C))

Definition at line 271 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define lun ( )    (p == 1 && cc >= 32 )

Definition at line 270 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and xersve().

#define SCS   16
#define TY_CHR ( )    TY_CONSTR(0,0,0)

Definition at line 184 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_CONSTR (   T,
  A,
  N 
)    ( ((((int)N) & 0xffff) << 16) | ((((int)A) & 0xff) << 8) | (((int)T) & 0xff) )

Definition at line 182 of file Vt102Emulation.cpp.

#define TY_CSI_PE (   A)    TY_CONSTR(10,A,0)

Definition at line 197 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_CSI_PG (   A)    TY_CONSTR(9,A,0)

Definition at line 195 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_CSI_PN (   A)    TY_CONSTR(6,A,0)

Definition at line 190 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_CSI_PR (   A,
  N 
)    TY_CONSTR(7,A,N)

Definition at line 191 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_CSI_PS (   A,
  N 
)    TY_CONSTR(5,A,N)

Definition at line 189 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_CTL (   A)    TY_CONSTR(1,A,0)

Definition at line 185 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_ESC (   A)    TY_CONSTR(2,A,0)

Definition at line 186 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_ESC_CS (   A,
  B 
)    TY_CONSTR(3,A,B)

Definition at line 187 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_ESC_DE (   A)    TY_CONSTR(4,A,0)

Definition at line 188 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define TY_VT52 (   A)    TY_CONSTR(8,A,0)

Definition at line 193 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar(), and Vt102Emulation::tau().

#define Xpe   (ppos>=2 && pbuf[1] == ']' )

Definition at line 278 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

#define Xte   (Xpe && cc == 7 )

Definition at line 279 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::receiveChar().

Function Documentation

static void hexdump ( int s,
int  len 
)
static

shows the contents of the scan buffer.

This functions is used for diagnostics. It is called by ReportErrorToken to inform about strings that cannot be decoded or handled by the emulation.

See Also
ReportErrorToken

Definition at line 1228 of file Vt102Emulation.cpp.

Referenced by Vt102Emulation::scan_buffer_report().