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