コミットメタ情報

リビジョンcfc231a1b8b94dc03c2fe500cfa7eff34a649fbd (tree)
日時2018-01-22 03:42:21
作者SHIRAKATA Kentaro <argrath@ub32...>
コミッターSHIRAKATA Kentaro

ログメッセージ

remove iso-2022-jp support

変更サマリ

差分

--- a/ChangeLog.j
+++ b/ChangeLog.j
@@ -1,3 +1,5 @@
1+ * ISO-2022-JP対応を削除
2+
13 Fri Feb 17 2017 Kentaro Shirakata <argrath@ub32.org>
24
35 * 画面上の怪物を/コマンドで見た際に文字化けする問題を修正 (#36909)
--- a/include/extern.h
+++ b/include/extern.h
@@ -2787,8 +2787,8 @@ E const char *FDECL(str2ic, (const char *));
27872787 #ifdef SJIS_FILESYSTEM
27882788 E const char *FDECL(ic2str, (const char *));
27892789 #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)));
27922792 E void FDECL(cputchar,(int));
27932793 E void FDECL(jputchar,(int));
27942794 E void FDECL(jputs,(const char *));
--- a/japanese/jlib.c
+++ b/japanese/jlib.c
@@ -17,7 +17,6 @@ int xputc2(int, int);
1717
1818 #define EUC 0
1919 #define SJIS 1
20-#define JIS 2
2120
2221 /* internal kcode */
2322 /* IC=0 EUC */
@@ -73,8 +72,6 @@ setkcode(c)
7372 {
7473 if(c == 'E' || c == 'e' )
7574 output_kcode = EUC;
76- else if(c == 'J' || c == 'j')
77- output_kcode = JIS;
7875 else if(c == 'S' || c == 's')
7976 output_kcode = SJIS;
8077 else if(c == 'I' || c == 'i')
@@ -141,7 +138,6 @@ str2ic(s)
141138 static unsigned char buf[1024];
142139 const unsigned char *up;
143140 unsigned char *p, *pp;
144- int kin;
145141
146142 if(!s)
147143 return s;
@@ -167,23 +163,6 @@ str2ic(s)
167163 *(p++) = (unsigned char)*(s++);
168164 }
169165 }
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- }
187166 else{
188167 strcpy((char *)buf, s);
189168 return (char *)buf;
@@ -204,7 +183,6 @@ ic2str(s)
204183 static unsigned char buf[1024];
205184 const unsigned char *up;
206185 unsigned char *p, *pp;
207- int kin;
208186
209187 if(!s)
210188 return s;
@@ -239,39 +217,10 @@ ic2str(s)
239217 ** primitive function
240218 */
241219
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-
264220 /* print out 1 byte character to tty (no conversion) */
265221 static void
266222 tty_cputc(unsigned int c)
267223 {
268- if(kmode && output_kcode==JIS ){
269- putchar(033);
270- putchar('(');
271- putchar('B');
272- }
273- kmode = 0;
274-
275224 #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON))
276225 xputc(c);
277226 #else
@@ -283,8 +232,6 @@ tty_cputc(unsigned int c)
283232 static void
284233 tty_cputc2(unsigned int c, unsigned int c2)
285234 {
286- kmode = 1;
287-
288235 #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON))
289236 xputc2(c, c2);
290237 #else
@@ -297,13 +244,6 @@ tty_cputc2(unsigned int c, unsigned int c2)
297244 static void
298245 tty_jputc(unsigned int c)
299246 {
300- if(kmode && output_kcode==JIS ){
301- putchar(033);
302- putchar('(');
303- putchar('B');
304- }
305- kmode = 0;
306-
307247 #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON))
308248 xputc(c);
309249 #else
@@ -315,13 +255,6 @@ tty_jputc(unsigned int c)
315255 static void
316256 tty_jputc2(unsigned int c, unsigned int c2)
317257 {
318- if(!kmode && output_kcode==JIS ){
319- putchar(033);
320- putchar('$');
321- putchar('B');
322- }
323- kmode = 1;
324-
325258 #if defined(NO_TERMS) && (defined(MSDOS) || defined(WIN32CON))
326259 xputc2(c, c2);
327260 #else
@@ -338,7 +271,6 @@ int
338271 jbuffer(
339272 unsigned int c,
340273 unsigned int *buf,
341- void (*reset)(),
342274 void (*f1)(unsigned int),
343275 void (*f2)(unsigned int, unsigned int))
344276 {
@@ -348,7 +280,6 @@ jbuffer(
348280 unsigned char *p;
349281
350282 if(!buf) buf = ibuf;
351- if(!reset) reset = tty_reset;
352283 if(!f1) f1 = tty_jputc;
353284 if(!f2) f2 = tty_jputc2;
354285
@@ -367,10 +298,6 @@ jbuffer(
367298 ;
368299 else if(IC == EUC){
369300 switch(output_kcode){
370- case JIS:
371- c1 &= 0x7f;
372- c2 &= 0x7f;
373- break;
374301 case SJIS:
375302 uc[0] = c1;
376303 uc[1] = c2;
@@ -388,10 +315,6 @@ jbuffer(
388315 uc[1] = c2;
389316 p = sj2e(uc);
390317 switch(output_kcode){
391- case JIS:
392- c1 &= 0x7f;
393- c2 &= 0x7f;
394- break;
395318 case EUC:
396319 break;
397320 default:
@@ -407,7 +330,6 @@ jbuffer(
407330 f1(c);
408331 return 1;
409332 }
410- reset();
411333 return -1;
412334 }
413335
@@ -419,14 +341,12 @@ int
419341 cbuffer(
420342 unsigned int c,
421343 unsigned int *buf,
422- void (*reset)(),
423344 void (*f1)(unsigned int),
424345 void (*f2)(unsigned int, unsigned int))
425346 {
426347 static unsigned int ibuf[2];
427348
428349 if(!buf) buf = ibuf;
429- if(!reset) reset = tty_reset;
430350 if(!f1) f1 = tty_cputc;
431351 if(!f2) f2 = tty_cputc2;
432352
@@ -444,7 +364,6 @@ cbuffer(
444364 f1(c);
445365 return 1;
446366 }
447- reset();
448367 return -1;
449368 }
450369
@@ -452,13 +371,13 @@ void
452371 jputchar(int c)
453372 {
454373 static unsigned int buf[2];
455- jbuffer((unsigned int)(c & 0xff), buf, NULL, NULL, NULL);
374+ jbuffer((unsigned int)(c & 0xff), buf, NULL, NULL);
456375 }
457376 void
458377 cputchar(int c)
459378 {
460379 static unsigned int buf[2];
461- cbuffer((unsigned int)(c & 0xff), buf, NULL, NULL, NULL);
380+ cbuffer((unsigned int)(c & 0xff), buf, NULL, NULL);
462381 }
463382
464383 void
--- a/sys/winnt/nttty.c
+++ b/sys/winnt/nttty.c
@@ -1068,7 +1068,7 @@ VA_DECL(const char *, fmt)
10681068 {
10691069 char *str = buf;
10701070 while(*str){
1071- jbuffer(*(str++), NULL, NULL, xputc_core, xputc2_core);
1071+ jbuffer(*(str++), NULL, xputc_core, xputc2_core);
10721072 }
10731073 }
10741074 #endif
旧リポジトリブラウザで表示