Commit feb4c610411a396ef9d8f84adc91a52a1774e5ca
1 parent
19c8ee18
Exists in
master
and in
3 other branches
Trabalhando na nova tabela de charsets
Showing
8 changed files
with
233 additions
and
64 deletions
Show diff stats
charset.c
... | ... | @@ -36,6 +36,188 @@ |
36 | 36 | |
37 | 37 | #include "globals.h" |
38 | 38 | |
39 | +/*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ | |
40 | + | |
41 | + struct lib3270_charset lib3270_default_charset = | |
42 | + { | |
43 | + // const char * host; | |
44 | + "bracket", | |
45 | + | |
46 | + // char * display; | |
47 | + "ISO-8859-1", | |
48 | + | |
49 | + // Translation tables | |
50 | + // unsigned short ebc2asc[256]; | |
51 | + { | |
52 | + /*00*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
53 | + /*08*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
54 | + /*10*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
55 | + /*18*/ 0x20, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x3b, 0x20, | |
56 | + /*20*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
57 | + /*28*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
58 | + /*30*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
59 | + /*38*/ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
60 | + /*40*/ 0x20, 0x20, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, | |
61 | + /*48*/ 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, | |
62 | + /*50*/ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, | |
63 | + /*58*/ 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0xac, | |
64 | + /*60*/ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, | |
65 | + /*68*/ 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, | |
66 | + /*70*/ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, | |
67 | + /*78*/ 0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, | |
68 | + /*80*/ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, | |
69 | + /*88*/ 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, | |
70 | + /*90*/ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, | |
71 | + /*98*/ 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, | |
72 | + /*a0*/ 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, | |
73 | + /*a8*/ 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, | |
74 | + /*b0*/ 0x5e, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, | |
75 | + /*b8*/ 0xbd, 0xbe, 0x5b, 0x5d, 0xaf, 0xa8, 0xb4, 0xd7, | |
76 | + /*c0*/ 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, | |
77 | + /*c8*/ 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, | |
78 | + /*d0*/ 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, | |
79 | + /*d8*/ 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff, | |
80 | + /*e0*/ 0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, | |
81 | + /*e8*/ 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, | |
82 | + /*f0*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, | |
83 | + /*f8*/ 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x20 | |
84 | + }, | |
85 | + | |
86 | + // unsigned short asc2ebc[256]; | |
87 | + { | |
88 | + /*00*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
89 | + /*08*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
90 | + /*10*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
91 | + /*18*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
92 | + /*20*/ 0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, | |
93 | + /*28*/ 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61, | |
94 | + /*30*/ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, | |
95 | + /*38*/ 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f, | |
96 | + /*40*/ 0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, | |
97 | + /*48*/ 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, | |
98 | + /*50*/ 0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, | |
99 | + /*58*/ 0xe7, 0xe8, 0xe9, 0xba, 0xe0, 0xbb, 0xb0, 0x6d, | |
100 | + /*60*/ 0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, | |
101 | + /*68*/ 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, | |
102 | + /*70*/ 0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, | |
103 | + /*78*/ 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x00, | |
104 | + /*80*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
105 | + /*88*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
106 | + /*90*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
107 | + /*98*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
108 | + /*a0*/ 0x41, 0xaa, 0x4a, 0xb1, 0x9f, 0xb2, 0x6a, 0xb5, | |
109 | + /*a8*/ 0xbd, 0xb4, 0x9a, 0x8a, 0x5f, 0xca, 0xaf, 0xbc, | |
110 | + /*b0*/ 0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3, | |
111 | + /*b8*/ 0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab, | |
112 | + /*c0*/ 0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68, | |
113 | + /*c8*/ 0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77, | |
114 | + /*d0*/ 0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf, | |
115 | + /*d8*/ 0x80, 0xfd, 0xfe, 0xfb, 0xfc, 0xad, 0xae, 0x59, | |
116 | + /*e0*/ 0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48, | |
117 | + /*e8*/ 0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57, | |
118 | + /*f0*/ 0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1, | |
119 | + /*f8*/ 0x70, 0xdd, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf | |
120 | + }, | |
121 | + | |
122 | + // unsigned short asc2ft[256]; | |
123 | + { | |
124 | + 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, | |
125 | + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, | |
126 | + 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, | |
127 | + 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, | |
128 | + 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, | |
129 | + 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0xe2,0x5c,0xe3,0xd8,0x5f, | |
130 | + 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, | |
131 | + 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x5d,0x7d,0x7e,0x7f, | |
132 | + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, | |
133 | + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x00, | |
134 | + 0xa0,0xd2,0x5b,0xd9,0xd0,0xda,0x7c,0xdd,0xe5,0xdc,0xcb,0xc4,0x5e,0xe8,0xd7,0xe4, | |
135 | + 0xca,0xc9,0xf4,0xfa,0xe6,0xd1,0xde,0xdb,0xce,0xee,0xcc,0xc5,0xdf,0xe0,0xe1,0xd3, | |
136 | + 0xb4,0xb5,0xb2,0xb6,0xb3,0xb7,0xcf,0xb8,0xbe,0xbb,0xbc,0xbd,0xc2,0xbf,0xc0,0xc1, | |
137 | + 0xd4,0xb9,0xf7,0xf8,0xf5,0xf9,0xf6,0xe7,0xc3,0xfd,0xfe,0xfb,0xfc,0xd5,0xd6,0xb1, | |
138 | + 0xa3,0xa4,0xa1,0xa5,0xa2,0xa6,0xcd,0xa7,0xac,0xa9,0xaa,0xab,0xb0,0xad,0xae,0xaf, | |
139 | + 0xc6,0xa8,0xeb,0xec,0xe9,0xed,0xea,0x9f,0xba,0xf1,0xf2,0xef,0xf0,0xc7,0xc8,0xf3 | |
140 | + }, | |
141 | + | |
142 | + // unsigned short ft2asc[256]; | |
143 | + { | |
144 | + 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, | |
145 | + 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, | |
146 | + 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, | |
147 | + 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, | |
148 | + 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, | |
149 | + 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0xa2,0x5c,0x7c,0xac,0x5f, | |
150 | + 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, | |
151 | + 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0xa6,0x7d,0x7e,0x7f, | |
152 | + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, | |
153 | + 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0xf7, | |
154 | + 0xa0,0xe2,0xe4,0xe0,0xe1,0xe3,0xe5,0xe7,0xf1,0xe9,0xea,0xeb,0xe8,0xed,0xee,0xef, | |
155 | + 0xec,0xdf,0xc2,0xc4,0xc0,0xc1,0xc3,0xc5,0xc7,0xd1,0xf8,0xc9,0xca,0xcb,0xc8,0xcd, | |
156 | + 0xce,0xcf,0xcc,0xd8,0xab,0xbb,0xf0,0xfd,0xfe,0xb1,0xb0,0xaa,0xba,0xe6,0xb8,0xc6, | |
157 | + 0xa4,0xb5,0xa1,0xbf,0xd0,0xdd,0xde,0xae,0x5e,0xa3,0xa5,0xb7,0xa9,0xa7,0xb6,0xbc, | |
158 | + 0xbd,0xbe,0x5b,0x5d,0xaf,0xa8,0xb4,0xd7,0xad,0xf4,0xf6,0xf2,0xf3,0xf5,0xb9,0xfb, | |
159 | + 0xfc,0xf9,0xfa,0xff,0xb2,0xd4,0xd6,0xd2,0xd3,0xd5,0xb3,0xdb,0xdc,0xd9,0xda,0xff | |
160 | + }, | |
161 | + | |
162 | + // unsigned short asc2uc[256]; | |
163 | + { | |
164 | + /*00*/ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, | |
165 | + /*08*/ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, | |
166 | + /*10*/ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, | |
167 | + /*18*/ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, | |
168 | + /*20*/ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, | |
169 | + /*28*/ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, | |
170 | + /*30*/ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, | |
171 | + /*38*/ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, | |
172 | + /*40*/ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, | |
173 | + /*48*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, | |
174 | + /*50*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, | |
175 | + /*58*/ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, | |
176 | + /*60*/ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, | |
177 | + /*68*/ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, | |
178 | + /*70*/ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, | |
179 | + /*78*/ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, | |
180 | + /*80*/ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, | |
181 | + /*88*/ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, | |
182 | + /*90*/ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, | |
183 | + /*98*/ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, | |
184 | + /*a0*/ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, | |
185 | + /*a8*/ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, | |
186 | + /*b0*/ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, | |
187 | + /*b8*/ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, | |
188 | + /*c0*/ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, | |
189 | + /*c8*/ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, | |
190 | + /*d0*/ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, | |
191 | + /*d8*/ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, | |
192 | + /*e0*/ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, | |
193 | + /*e8*/ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, | |
194 | + /*f0*/ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xf7, | |
195 | + /*f8*/ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff | |
196 | + } | |
197 | + | |
198 | + }; | |
199 | + | |
200 | + | |
201 | +/*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ | |
202 | + | |
203 | +LIB3270_EXPORT struct lib3270_charset * lib3270_load_default_charset(H3270 *hSession) | |
204 | +{ | |
205 | + memcpy(&hSession->charset,&lib3270_default_charset,sizeof(struct lib3270_charset)); | |
206 | + return &hSession->charset; | |
207 | +} | |
208 | + | |
209 | + | |
210 | +LIB3270_EXPORT const char * lib3270_get_default_charset(void) | |
211 | +{ | |
212 | + return "ISO-8859-1"; | |
213 | +} | |
214 | + | |
215 | +LIB3270_EXPORT const char * lib3270_get_charset(H3270 *hSession) | |
216 | +{ | |
217 | + CHECK_SESSION_HANDLE(hSession); | |
218 | + return hSession->charset.display ? hSession->charset.display : "ISO-8859-1"; | |
219 | +} | |
220 | + | |
39 | 221 | /* |
40 | 222 | |
41 | 223 | #include "resources.h" |
... | ... | @@ -830,14 +1012,4 @@ static KeySym StringToKeysym(char *s) |
830 | 1012 | |
831 | 1013 | */ |
832 | 1014 | |
833 | -LIB3270_EXPORT const char * lib3270_get_default_charset(void) | |
834 | -{ | |
835 | - return "ISO-8859-1"; | |
836 | -} | |
837 | - | |
838 | -LIB3270_EXPORT const char * lib3270_get_charset(H3270 *hSession) | |
839 | -{ | |
840 | - CHECK_SESSION_HANDLE(hSession); | |
841 | - return hSession->charset.display ? hSession->charset.display : "ISO-8859-1"; | |
842 | -} | |
843 | 1015 | ... | ... |
... | ... | @@ -0,0 +1,40 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como charset.h e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
27 | + * licinio@bb.com.br (Licínio Luis Branco) | |
28 | + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
29 | + * | |
30 | + */ | |
31 | + | |
32 | +#ifndef LIB3270_CHARSET_H_INCLUDED | |
33 | + | |
34 | + #define LIB3270_CHARSET_H_INCLUDED 1 | |
35 | + | |
36 | + const struct lib3270_charset lib3270_default_charset; | |
37 | + | |
38 | + LIB3270_EXPORT struct lib3270_charset * lib3270_load_default_charset(H3270 *hSession); | |
39 | + | |
40 | +#endif // LIB3270_CHARSET_H_INCLUDED | ... | ... |
charsetc.h
... | ... | @@ -1,46 +0,0 @@ |
1 | -/* | |
2 | - * Modifications Copyright 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2002, | |
3 | - * 2004, 2005 by Paul Mattes. | |
4 | - * Original X11 Port Copyright 1990 by Jeff Sparkes. | |
5 | - * Permission to use, copy, modify, and distribute this software and its | |
6 | - * documentation for any purpose and without fee is hereby granted, | |
7 | - * provided that the above copyright notice appear in all copies and that | |
8 | - * both that copyright notice and this permission notice appear in | |
9 | - * supporting documentation. | |
10 | - * | |
11 | - * Copyright 1989 by Georgia Tech Research Corporation, Atlanta, GA 30332. | |
12 | - * All Rights Reserved. GTRC hereby grants public use of this software. | |
13 | - * Derivative works based on this software must incorporate this copyright | |
14 | - * notice. | |
15 | - * | |
16 | - * x3270, c3270, s3270 and tcl3270 are distributed in the hope that they will | |
17 | - * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file LICENSE | |
19 | - * for more details. | |
20 | - */ | |
21 | - | |
22 | -/* | |
23 | - * charsetc.h | |
24 | - * Global declarations for charset.c | |
25 | - */ | |
26 | - | |
27 | -// LIB3270_INTERNAL Boolean charset_changed; | |
28 | -// LIB3270_INTERNAL unsigned long cgcsgid; | |
29 | - | |
30 | -/* | |
31 | -#if defined(X3270_DBCS) | |
32 | -LIB3270_INTERNAL unsigned long cgcsgid_dbcs; | |
33 | -LIB3270_INTERNAL char *converter_names; | |
34 | -LIB3270_INTERNAL char *encoding; | |
35 | -#endif | |
36 | -*/ | |
37 | - | |
38 | -// LIB3270_INTERNAL char *default_display_charset; | |
39 | - | |
40 | -enum cs_result { CS_OKAY, CS_NOTFOUND, CS_BAD, CS_PREREQ, CS_ILLEGAL }; | |
41 | - | |
42 | -LIB3270_INTERNAL enum cs_result charset_init(H3270 *session, const char *csname); | |
43 | -// LIB3270_INTERNAL char *get_charset_name(void); | |
44 | - | |
45 | -LIB3270_INTERNAL void set_display_charset(H3270 *session, const char *dcs); | |
46 | - |
glue.c
screen.c
session.c
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | #endif // !ANDROID |
35 | 35 | |
36 | 36 | #include "globals.h" |
37 | -#include "charsetc.h" | |
37 | +// #include "charsetc.h" | |
38 | 38 | #include "kybdc.h" |
39 | 39 | #include "ansic.h" |
40 | 40 | #include "togglesc.h" |
... | ... | @@ -46,6 +46,7 @@ |
46 | 46 | #include "3270ds.h" |
47 | 47 | #include "tablesc.h" |
48 | 48 | #include "popupsc.h" |
49 | +#include "charset.h" | |
49 | 50 | |
50 | 51 | /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ |
51 | 52 | |
... | ... | @@ -84,7 +85,7 @@ void lib3270_session_free(H3270 *h) |
84 | 85 | // Release memory |
85 | 86 | #define release_pointer(x) lib3270_free(x); x = NULL; |
86 | 87 | |
87 | - release_pointer(h->charset.display); | |
88 | + // release_pointer(h->charset.display); | |
88 | 89 | release_pointer(h->paste_buffer); |
89 | 90 | |
90 | 91 | release_pointer(h->ibuf); |
... | ... | @@ -185,7 +186,9 @@ static void lib3270_session_init(H3270 *hSession, const char *model) |
185 | 186 | |
186 | 187 | memset(hSession,0,sizeof(H3270)); |
187 | 188 | hSession->sz = sizeof(H3270); |
188 | - initialize_tables(hSession); | |
189 | + | |
190 | + lib3270_load_default_charset(hSession); | |
191 | +// initialize_tables(hSession); | |
189 | 192 | |
190 | 193 | // Default calls |
191 | 194 | hSession->write = lib3270_sock_send; |
... | ... | @@ -218,7 +221,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) |
218 | 221 | hSession->unlock_delay = 1; |
219 | 222 | hSession->icrnl = 1; |
220 | 223 | hSession->onlcr = 1; |
221 | - hSession->charset.host = "bracket"; | |
224 | +// hSession->charset.host = "bracket"; | |
222 | 225 | hSession->sock = -1; |
223 | 226 | hSession->model_num = -1; |
224 | 227 | hSession->cstate = LIB3270_NOT_CONNECTED; | ... | ... |