11 #define CHAR_SIZE 2048 15 static char us[4]={0x1b, 0x5b, 0x34, 0x6d},
16 ue[3]={0x1b, 0x5b, 0x6d},
17 so[4]={0x1b, 0x5b, 0x37, 0x6d},
18 se[3]={0x1b, 0x5b, 0x6d},
19 md[4]={0x1b, 0x5b, 0x31, 0x6d},
20 me[3]={0x1b, 0x5b, 0x6d};
45 if ((str[0] ==
't') && (str[1] ==
't'))
47 if ((str[0] ==
'e') && (str[1] ==
'm'))
49 if ((str[0] ==
'i') && (str[1] ==
't'))
51 if ((str[0] ==
'b') && (str[1] ==
'f'))
61 {
register int i,j, fd;
62 int brace=1, bslash=0, brace2=0, emphasis=0, kanji=0, mode;
70 offset=(off_t)ckintval(argv[1]);
74 lseek( fd, offset, 0);
78 for(sp=&str[0],j=0;brace != 0;){
83 for(i=0;i<2;i++){ c=
READ_CHAR(fd); *sp++=c;}
87 else if (bslash != 0){
89 case '>' :
for(i=0; i<3; i++) *sp++=
' ';
90 case '=' : bslash=0;
break;
92 case '#' : *sp++=c; bslash=0;
break;
93 case '\\': *sp++=0x0a; bslash=0;
break;
96 case 1 : ch=
us;
break;
97 case 2 : ch=
so;
break;
98 case 3 : ch=
md;
break;
105 case '$' : bslash=0;
break;
106 case '}' :
if (j == 0) *sp++=
'}';
108 case '[' : j=0;
break;
109 case '{' :
if (j == 0) {*sp++=
'{'; bslash=0;
break;}
111 case ']' :
for(i=0;i<4;i++) *sp++=
' ';
112 for(i=0;i<j;i++) *sp++=cmd[i];
116 default : cmd[j++]=c;
break;
122 case '\\': bslash=1; j=0;
break;
123 case '{' : brace++;
break;
124 case '}' :
if (emphasis != 0){
125 for(i=0;i<3;i++) *sp++=
ue[i];
129 case 10 :
if (brace2 == 1) *sp++=10;
else *sp++=
' ';
131 case 27 : kanji=1; *sp++=27;
break;
132 default : *sp++=c;
break;
static char buf[CHAR_SIZE]
struct filestream fstream
static int COMPARE_STRING(char *str)
defun("ADR_TO_STRING", mod, ADR_TO_STRING)
static pointer READ_TEX(context *ctx, int n, argv)
helpsub(context *ctx, int n, argv)
pointer makestring(char *, int)
static char READ_CHAR(int fd)