リビジョン | cfc231a1b8b94dc03c2fe500cfa7eff34a649fbd (tree) |
---|---|
日時 | 2018-01-22 03:42:21 |
作者 | SHIRAKATA Kentaro <argrath@ub32...> |
コミッター | SHIRAKATA Kentaro |
remove iso-2022-jp support
@@ -1,3 +1,5 @@ | ||
1 | + * ISO-2022-JP対応を削除 | |
2 | + | |
1 | 3 | Fri Feb 17 2017 Kentaro Shirakata <argrath@ub32.org> |
2 | 4 | |
3 | 5 | * 画面上の怪物を/コマンドで見た際に文字化けする問題を修正 (#36909) |
@@ -2787,8 +2787,8 @@ E const char *FDECL(str2ic, (const char *)); | ||
2787 | 2787 | #ifdef SJIS_FILESYSTEM |
2788 | 2788 | E const char *FDECL(ic2str, (const char *)); |
2789 | 2789 | #endif |
2790 | -E int FDECL(jbuffer, (unsigned int, unsigned int *, void (*)(), void (*)(unsigned int), void (*)(unsigned int, unsigned int))); | |
2791 | -E int FDECL(cbuffer, (unsigned int, unsigned int *, void (*)(), void (*)(unsigned int), void (*)(unsigned int, unsigned int))); | |
2790 | +E int FDECL(jbuffer, (unsigned int, unsigned int *, void (*)(unsigned int), void (*)(unsigned int, unsigned int))); | |
2791 | +E int FDECL(cbuffer, (unsigned int, unsigned int *, void (*)(unsigned int), void (*)(unsigned int, unsigned int))); | |
2792 | 2792 | E void FDECL(cputchar,(int)); |
2793 | 2793 | E void FDECL(jputchar,(int)); |
2794 | 2794 | E void FDECL(jputs,(const char *)); |
@@ -17,7 +17,6 @@ int xputc2(int, int); | ||
17 | 17 | |
18 | 18 | #define EUC 0 |
19 | 19 | #define SJIS 1 |
20 | -#define JIS 2 | |
21 | 20 | |
22 | 21 | /* internal kcode */ |
23 | 22 | /* IC=0 EUC */ |
@@ -73,8 +72,6 @@ setkcode(c) | ||
73 | 72 | { |
74 | 73 | if(c == 'E' || c == 'e' ) |
75 | 74 | output_kcode = EUC; |
76 | - else if(c == 'J' || c == 'j') | |
77 | - output_kcode = JIS; | |
78 | 75 | else if(c == 'S' || c == 's') |
79 | 76 | output_kcode = SJIS; |
80 | 77 | else if(c == 'I' || c == 'i') |
@@ -141,7 +138,6 @@ str2ic(s) | ||
141 | 138 | static unsigned char buf[1024]; |
142 | 139 | const unsigned char *up; |
143 | 140 | unsigned char *p, *pp; |
144 | - int kin; | |
145 | 141 | |
146 | 142 | if(!s) |
147 | 143 | return s; |
@@ -167,23 +163,6 @@ str2ic(s) | ||
167 | 163 | *(p++) = (unsigned char)*(s++); |
168 | 164 | } |
169 | 165 | } |
170 | - else if( IC==EUC && input_kcode == JIS ){ | |
171 | - kin = 0; | |
172 | - while(*s){ | |
173 | - if(s[0] == 033 && s[1] == '$' && (s[2] == 'B' || s[3] == '@')){ | |
174 | - kin = 1; | |
175 | - s += 3; | |
176 | - } | |
177 | - else if(s[0] == 033 && s[1] == '(' && (s[2] == 'B' || s[3] == 'J')){ | |
178 | - kin = 0; | |
179 | - s += 3; | |
180 | - } | |
181 | - else if( kin ) | |
182 | - *(p++) = (*(s++) | 0x80); | |
183 | - else | |
184 | - *(p++) = *(s++); | |
185 | - } | |
186 | - } | |
187 | 166 | else{ |
188 | 167 | strcpy((char *)buf, s); |
189 | 168 | return (char *)buf; |
@@ -204,7 +183,6 @@ ic2str(s) | ||
204 | 183 | static unsigned char buf[1024]; |
205 | 184 | const unsigned char *up; |
206 | 185 | unsigned char *p, *pp; |
207 | - int kin; | |
208 | 186 | |
209 | 187 | if(!s) |
210 | 188 | return s; |
@@ -239,39 +217,10 @@ ic2str(s) | ||
239 | 217 | ** primitive function |
240 | 218 | */ |
241 | 219 | |
242 | -static int kmode; /* 0: Kanji out */ | |
243 | - /* 1: Kanji in */ | |
244 | - | |
245 | -static void | |
246 | -tty_reset() | |
247 | -{ | |
248 | - if(kmode && output_kcode==JIS ){ | |
249 | - putchar(033); | |
250 | - putchar('('); | |
251 | - putchar('B'); | |
252 | -/* | |
253 | - if (flags.DECgraphics){ | |
254 | - putchar(033); | |
255 | - putchar('$'); | |
256 | - putchar(')'); | |
257 | - putchar('B'); | |
258 | - } | |
259 | -*/ | |
260 | - } | |
261 | - kmode = 0; | |
262 | -} | |
263 | - | |
264 | 220 | /* print out 1 byte character to tty (no conversion) */ |
265 | 221 | static void |
266 | 222 | tty_cputc(unsigned int c) |
267 | 223 | { |
268 | - if(kmode && output_kcode==JIS ){ | |
269 | - putchar(033); | |
270 | - putchar('('); | |
271 | - putchar('B'); | |
272 | - } | |
273 | - kmode = 0; | |
274 | - | |
275 | 224 | #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON)) |
276 | 225 | xputc(c); |
277 | 226 | #else |
@@ -283,8 +232,6 @@ tty_cputc(unsigned int c) | ||
283 | 232 | static void |
284 | 233 | tty_cputc2(unsigned int c, unsigned int c2) |
285 | 234 | { |
286 | - kmode = 1; | |
287 | - | |
288 | 235 | #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON)) |
289 | 236 | xputc2(c, c2); |
290 | 237 | #else |
@@ -297,13 +244,6 @@ tty_cputc2(unsigned int c, unsigned int c2) | ||
297 | 244 | static void |
298 | 245 | tty_jputc(unsigned int c) |
299 | 246 | { |
300 | - if(kmode && output_kcode==JIS ){ | |
301 | - putchar(033); | |
302 | - putchar('('); | |
303 | - putchar('B'); | |
304 | - } | |
305 | - kmode = 0; | |
306 | - | |
307 | 247 | #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON)) |
308 | 248 | xputc(c); |
309 | 249 | #else |
@@ -315,13 +255,6 @@ tty_jputc(unsigned int c) | ||
315 | 255 | static void |
316 | 256 | tty_jputc2(unsigned int c, unsigned int c2) |
317 | 257 | { |
318 | - if(!kmode && output_kcode==JIS ){ | |
319 | - putchar(033); | |
320 | - putchar('$'); | |
321 | - putchar('B'); | |
322 | - } | |
323 | - kmode = 1; | |
324 | - | |
325 | 258 | #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON)) |
326 | 259 | xputc2(c, c2); |
327 | 260 | #else |
@@ -338,7 +271,6 @@ int | ||
338 | 271 | jbuffer( |
339 | 272 | unsigned int c, |
340 | 273 | unsigned int *buf, |
341 | - void (*reset)(), | |
342 | 274 | void (*f1)(unsigned int), |
343 | 275 | void (*f2)(unsigned int, unsigned int)) |
344 | 276 | { |
@@ -348,7 +280,6 @@ jbuffer( | ||
348 | 280 | unsigned char *p; |
349 | 281 | |
350 | 282 | if(!buf) buf = ibuf; |
351 | - if(!reset) reset = tty_reset; | |
352 | 283 | if(!f1) f1 = tty_jputc; |
353 | 284 | if(!f2) f2 = tty_jputc2; |
354 | 285 |
@@ -367,10 +298,6 @@ jbuffer( | ||
367 | 298 | ; |
368 | 299 | else if(IC == EUC){ |
369 | 300 | switch(output_kcode){ |
370 | - case JIS: | |
371 | - c1 &= 0x7f; | |
372 | - c2 &= 0x7f; | |
373 | - break; | |
374 | 301 | case SJIS: |
375 | 302 | uc[0] = c1; |
376 | 303 | uc[1] = c2; |
@@ -388,10 +315,6 @@ jbuffer( | ||
388 | 315 | uc[1] = c2; |
389 | 316 | p = sj2e(uc); |
390 | 317 | switch(output_kcode){ |
391 | - case JIS: | |
392 | - c1 &= 0x7f; | |
393 | - c2 &= 0x7f; | |
394 | - break; | |
395 | 318 | case EUC: |
396 | 319 | break; |
397 | 320 | default: |
@@ -407,7 +330,6 @@ jbuffer( | ||
407 | 330 | f1(c); |
408 | 331 | return 1; |
409 | 332 | } |
410 | - reset(); | |
411 | 333 | return -1; |
412 | 334 | } |
413 | 335 |
@@ -419,14 +341,12 @@ int | ||
419 | 341 | cbuffer( |
420 | 342 | unsigned int c, |
421 | 343 | unsigned int *buf, |
422 | - void (*reset)(), | |
423 | 344 | void (*f1)(unsigned int), |
424 | 345 | void (*f2)(unsigned int, unsigned int)) |
425 | 346 | { |
426 | 347 | static unsigned int ibuf[2]; |
427 | 348 | |
428 | 349 | if(!buf) buf = ibuf; |
429 | - if(!reset) reset = tty_reset; | |
430 | 350 | if(!f1) f1 = tty_cputc; |
431 | 351 | if(!f2) f2 = tty_cputc2; |
432 | 352 |
@@ -444,7 +364,6 @@ cbuffer( | ||
444 | 364 | f1(c); |
445 | 365 | return 1; |
446 | 366 | } |
447 | - reset(); | |
448 | 367 | return -1; |
449 | 368 | } |
450 | 369 |
@@ -452,13 +371,13 @@ void | ||
452 | 371 | jputchar(int c) |
453 | 372 | { |
454 | 373 | static unsigned int buf[2]; |
455 | - jbuffer((unsigned int)(c & 0xff), buf, NULL, NULL, NULL); | |
374 | + jbuffer((unsigned int)(c & 0xff), buf, NULL, NULL); | |
456 | 375 | } |
457 | 376 | void |
458 | 377 | cputchar(int c) |
459 | 378 | { |
460 | 379 | static unsigned int buf[2]; |
461 | - cbuffer((unsigned int)(c & 0xff), buf, NULL, NULL, NULL); | |
380 | + cbuffer((unsigned int)(c & 0xff), buf, NULL, NULL); | |
462 | 381 | } |
463 | 382 | |
464 | 383 | void |
@@ -1068,7 +1068,7 @@ VA_DECL(const char *, fmt) | ||
1068 | 1068 | { |
1069 | 1069 | char *str = buf; |
1070 | 1070 | while(*str){ |
1071 | - jbuffer(*(str++), NULL, NULL, xputc_core, xputc2_core); | |
1071 | + jbuffer(*(str++), NULL, xputc_core, xputc2_core); | |
1072 | 1072 | } |
1073 | 1073 | } |
1074 | 1074 | #endif |