/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * C O M M O N L I B R A R Y * * * * File: vt100.h * * * * Author: Jomar Honsi Date: 12/10/90 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Lines */ #define TOP 01 #define BOTTOM 24 /* Columns */ #define FIRST 01 #define LAST 80 #define LINELEN LAST #define INSLEN 16 /* Max length of screen intensity string */ /* Some frequently used screen control strings */ #ifdef SCR_ALLOC char nsi[]= "\33[0m", /* Normal */ hisi[]= "\33[0;1m", /* High */ ulsi[]= "\33[0;4m", /* Underline */ blsi[]= "\33[0;5;7m", /* Blinking */ invsi[]= "\33[0;7m", /* Inverse */ sErline[]= "\33[K", sErscreen[]="\33[2J", sCurson[]= "\33[?25h", sCursoff[]= "\33[?25l"; #else extern char nsi[],hisi[],ulsi[],blsi[],invsi[], sErline[],sErscreen[],sCurson[],sCursoff[]; #endif /* S C R E E N C O N T R O L */ #define erline() printf(sErline) #define erscreen() printf(sErscreen) #define curson() printf(sCurson) #define cursoff() printf(sCursoff) #define setscroll(a,b) printf("\33[%1.2u;%1.2ur",(a),(b)) #define mvcurs(a,b) printf("\33[%1.2u;%1.2uH",(a),(b)) #define si(c) printf(ssi((c))) #define siline(c) printf("%s%84s",ssi((c)),nsi); #define save_curs() printf("%c%c", '\33', '7'); #define get_curs() printf("%c%c", '\33', '8'); #define sSetscroll(s,a,b) sprintf((s),"\33[%1.2u;%1.2ur",(a),(b)) #define sMvcurs(s,a,b) sprintf((s),"\33[%1.2u;%1.2uH",(a),(b)) /* screen intensity codes */ #define NORMAL (1<<0) /* normal intensity */ #define HI (1<<1) /* high intensity */ #define UL (1<<4) /* underline */ #define BL (1<<5) /* blinking */ #define IN (1<<7) /* inverse video */