Commit cc72c79a1c5563169e0d64124b3aef11de8d47f9

Authored by perry.werneck@gmail.com
1 parent 40165986

Trabalhando nas tabelas de charset

src/lib3270/ansi.c
... ... @@ -53,7 +53,7 @@
53 53 #include "hostc.h"
54 54 #include "screenc.h"
55 55 // #include "scrollc.h"
56   -#include "tablesc.h"
  56 +// #include "tablesc.h"
57 57 #include "telnetc.h"
58 58 #include "trace_dsc.h"
59 59 #include "utf8c.h"
... ... @@ -1045,6 +1045,7 @@ ansi_printing(H3270 *hSession, int ig1 unused, int ig2 unused)
1045 1045 Boolean preserve_right = False;
1046 1046 #endif /*]*/
1047 1047  
  1048 +/*
1048 1049 if ((hSession->pmi == 0) && (hSession->ansi_ch & 0x80)) {
1049 1050 char mbs[2];
1050 1051 enum ulfail fail;
... ... @@ -1052,27 +1053,29 @@ ansi_printing(H3270 *hSession, int ig1 unused, int ig2 unused)
1052 1053  
1053 1054 mbs[0] = (char)hSession->ansi_ch;
1054 1055 mbs[1] = '\0';
  1056 +
1055 1057 ch = utf8_lookup(mbs, &fail, NULL);
1056 1058 if (ch == 0) {
1057 1059 switch (fail) {
1058 1060 case ULFAIL_NOUTF8:
1059   - /* Leave it alone. */
  1061 + // Leave it alone.
1060 1062 break;
1061 1063 case ULFAIL_INCOMPLETE:
1062   - /* Start munching multi-byte. */
  1064 + // Start munching multi-byte.
1063 1065 hSession->pmi = 0;
1064 1066 hSession->pending_mbs[hSession->pmi++] = (char)hSession->ansi_ch;
1065 1067 return MBPEND;
1066 1068 case ULFAIL_INVALID:
1067   - /* Invalid multi-byte -> '?' */
  1069 + // Invalid multi-byte -> '?'
1068 1070 hSession->ansi_ch = '?';
1069   - /* XXX: If DBCS, we should let
1070   - * ICU have a crack at it
1071   - */
  1071 + // XXX: If DBCS, we should let
  1072 + // ICU have a crack at it
  1073 + //
1072 1074 break;
1073 1075 }
1074 1076 }
1075 1077 }
  1078 + */
1076 1079 hSession->pmi = 0;
1077 1080  
1078 1081 if (hSession->held_wrap)
... ... @@ -1216,7 +1219,7 @@ ansi_multibyte(H3270 *hSession, int ig1, int ig2)
1216 1219 {
1217 1220 char mbs[MB_MAX];
1218 1221 unsigned char ch;
1219   - enum ulfail fail;
  1222 +// enum ulfail fail;
1220 1223 afn_t fn;
1221 1224  
1222 1225 if (hSession->pmi >= MB_MAX - 2)
... ... @@ -1231,6 +1234,7 @@ ansi_multibyte(H3270 *hSession, int ig1, int ig2)
1231 1234 mbs[hSession->pmi] = (char) hSession->ansi_ch;
1232 1235 mbs[hSession->pmi + 1] = '\0';
1233 1236  
  1237 + /*
1234 1238 ch = utf8_lookup(mbs, &fail, NULL);
1235 1239 if (ch != 0)
1236 1240 {
... ... @@ -1245,6 +1249,7 @@ ansi_multibyte(H3270 *hSession, int ig1, int ig2)
1245 1249 hSession->pending_mbs[hSession->pmi++] = (char)hSession->ansi_ch;
1246 1250 return MBPEND;
1247 1251 }
  1252 + */
1248 1253  
1249 1254 /* Failure. */
1250 1255  
... ...
src/lib3270/charset.c
... ... @@ -213,6 +213,9 @@ LIB3270_EXPORT struct lib3270_charset * lib3270_load_charset(H3270 *hSession, co
213 213 hSession->charset.host = "bracket";
214 214 hSession->charset.display = "ISO-8859-1";
215 215  
  216 + lib3270_write_log(hSession,"charset","host.charset=%s display.charset=%s",
  217 + hSession->charset.host,hSession->charset.display);
  218 +
216 219 memcpy(hSession->charset.ebc2asc, ebc2asc0, sizeof(hSession->charset.ebc2asc));
217 220 memcpy(hSession->charset.asc2ebc, asc2ebc0, sizeof(hSession->charset.asc2ebc));
218 221  
... ...
src/lib3270/charset.h
... ... @@ -33,6 +33,9 @@
33 33  
34 34 #define LIB3270_CHARSET_H_INCLUDED 1
35 35  
  36 + LIB3270_INTERNAL const unsigned short ebc2asc0[256];
  37 + LIB3270_INTERNAL const unsigned short asc2ft0[256];
  38 +
36 39 const struct lib3270_charset lib3270_default_charset;
37 40  
38 41 LIB3270_EXPORT struct lib3270_charset * lib3270_load_charset(H3270 *hSession, const char *name);
... ...
src/lib3270/ctlr.c
... ... @@ -57,7 +57,7 @@
57 57 #include "seec.h"
58 58 #include "sf.h"
59 59 #include "statusc.h"
60   -#include "tablesc.h"
  60 +// #include "tablesc.h"
61 61 #include "telnetc.h"
62 62 #include "trace_dsc.h"
63 63 #include "utilc.h"
... ...
src/lib3270/ft.c
... ... @@ -48,7 +48,7 @@
48 48 #include "kybdc.h"
49 49 #include "popupsc.h"
50 50 #include "screenc.h"
51   -#include "tablesc.h"
  51 +// #include "tablesc.h"
52 52 #include "telnetc.h"
53 53 #include "utilc.h"
54 54 #include "trace_dsc.h"
... ...
src/lib3270/ft_cut.c
... ... @@ -49,7 +49,7 @@
49 49 #include "ftc.h"
50 50 #include "kybdc.h"
51 51 #include "popupsc.h"
52   -#include "tablesc.h"
  52 +// #include "tablesc.h"
53 53 #include "telnetc.h"
54 54 #include "trace_dsc.h"
55 55 #include "utilc.h"
... ...
src/lib3270/ft_dft.c
... ... @@ -49,7 +49,7 @@
49 49 #include "kybdc.h"
50 50 #include "ft_dftc.h"
51 51 #include "ftc.h"
52   -#include "tablesc.h"
  52 +//#include "tablesc.h"
53 53 #include "telnetc.h"
54 54 #include "trace_dsc.h"
55 55 #include "utilc.h"
... ...
src/lib3270/glue.c
... ... @@ -65,7 +65,7 @@
65 65 #include "popupsc.h"
66 66 #include "screenc.h"
67 67 // #include "selectc.h"
68   -#include "tablesc.h"
  68 +//#include "tablesc.h"
69 69 #include "telnetc.h"
70 70 #include "togglesc.h"
71 71 #include "trace_dsc.h"
... ...
src/lib3270/kybd.c
... ... @@ -76,7 +76,7 @@ struct ta;
76 76 // #include "selectc.h"
77 77 // #endif /*]*/
78 78 #include "statusc.h"
79   -#include "tablesc.h"
  79 +// #include "tablesc.h"
80 80 #include "telnetc.h"
81 81 #include "togglesc.h"
82 82 #include "trace_dsc.h"
... ...
src/lib3270/paste.c
... ... @@ -68,7 +68,7 @@
68 68 */
69 69  
70 70 #include "statusc.h"
71   -#include "tablesc.h"
  71 +// #include "tablesc.h"
72 72 #include "telnetc.h"
73 73 #include "togglesc.h"
74 74 #include "trace_dsc.h"
... ...
src/lib3270/rpq.c
... ... @@ -59,7 +59,7 @@
59 59 #include "3270ds.h"
60 60  
61 61 #include "popupsc.h"
62   -#include "tablesc.h"
  62 +//#include "tablesc.h"
63 63 #include "telnetc.h"
64 64 #include "trace_dsc.h"
65 65 #include "utilc.h"
... ...
src/lib3270/screen.c
... ... @@ -47,7 +47,7 @@
47 47 #include "hostc.h"
48 48 #include "kybdc.h"
49 49 #include "screenc.h"
50   -#include "tablesc.h"
  50 +// #include "tablesc.h"
51 51 #include "trace_dsc.h"
52 52 #include "utilc.h"
53 53 // #include "w3miscc.h"
... ...
src/lib3270/see.c
... ... @@ -46,7 +46,7 @@
46 46 #include <fcntl.h>
47 47 #include "3270ds.h"
48 48  
49   -#include "tablesc.h"
  49 +// #include "tablesc.h"
50 50 #if !defined(PR3287) /*[*/
51 51 #include "utf8c.h"
52 52 #endif /*]*/
... ...
src/lib3270/session.c
... ... @@ -44,7 +44,7 @@
44 44 #include "ftc.h"
45 45 #include "kybdc.h"
46 46 #include "3270ds.h"
47   -#include "tablesc.h"
  47 +// #include "tablesc.h"
48 48 #include "popupsc.h"
49 49 #include "charset.h"
50 50  
... ...
src/lib3270/sf.c
... ... @@ -58,7 +58,7 @@
58 58 #include "screenc.h"
59 59 #include "seec.h"
60 60 #include "sf.h"
61   -#include "tablesc.h"
  61 +// #include "tablesc.h"
62 62 #include "telnetc.h"
63 63 #include "trace_dsc.h"
64 64 #include "utilc.h"
... ...
src/lib3270/sources.mak
... ... @@ -26,10 +26,12 @@
26 26  
27 27 # Terminal only sources
28 28 TERMINAL_SOURCES = bounds.c ctlr.c util.c toggles.c screen.c selection.c kybd.c telnet.c \
29   - host.c sf.c ansi.c resolver.c tables.c utf8.c charset.c \
  29 + host.c sf.c ansi.c resolver.c charset.c \
30 30 version.c session.c state.c html.c trace_ds.c see.c \
31 31 paste.c
32 32  
  33 +# tables.c utf8.c
  34 +
33 35 # Network I/O Sources
34 36 NETWORK_SOURCES = iocalls.c proxy.c
35 37  
... ...
src/lib3270/tablesc.h
... ... @@ -16,8 +16,11 @@
16 16 * tablesc.h
17 17 * Global declarations for tables.c.
18 18 */
19   -LIB3270_INTERNAL void initialize_tables(H3270 *hSession);
20   -LIB3270_INTERNAL void charset_defaults(H3270 *hSession);
  19 +
  20 +#error Deprecated, replace for charset.h
  21 +
  22 +// LIB3270_INTERNAL void initialize_tables(H3270 *hSession);
  23 +// LIB3270_INTERNAL void charset_defaults(H3270 *hSession);
21 24  
22 25 // LIB3270_INTERNAL unsigned short ebc2cg[256];
23 26 // LIB3270_INTERNAL unsigned short cg2ebc[256];
... ... @@ -36,9 +39,7 @@ LIB3270_INTERNAL void charset_defaults(H3270 *hSession);
36 39 // LIB3270_INTERNAL const unsigned short cg2asc[256];
37 40 // LIB3270_INTERNAL const unsigned short ebc2cg0[256];
38 41 // LIB3270_INTERNAL const unsigned short cg2ebc0[256];
39   - LIB3270_INTERNAL const unsigned short ebc2asc0[256];
40 42 // LIB3270_INTERNAL const unsigned short asc2ebc0[256];
41 43 // LIB3270_INTERNAL const unsigned short asc2uc[256];
42 44 // LIB3270_INTERNAL const unsigned short ebc2uc[256];
43 45 // LIB3270_INTERNAL const unsigned short ft2asc0[256];
44   - LIB3270_INTERNAL const unsigned short asc2ft0[256];
... ...
src/lib3270/telnet.c
... ... @@ -93,7 +93,7 @@
93 93 #include "proxyc.h"
94 94 #include "resolverc.h"
95 95 #include "statusc.h"
96   -#include "tablesc.h"
  96 +// #include "tablesc.h"
97 97 #include "telnetc.h"
98 98 #include "trace_dsc.h"
99 99 #include "utilc.h"
... ...
src/lib3270/trace_ds.c
... ... @@ -59,7 +59,7 @@
59 59 // #include "charsetc.h"
60 60 #include "ctlrc.h"
61 61 #include "popupsc.h"
62   -#include "tablesc.h"
  62 +// #include "tablesc.h"
63 63 #include "telnetc.h"
64 64 #include "trace_dsc.h"
65 65 #include "utilc.h"
... ...