Commit 325c9fc2a5ecb8bb0443f2b0a6dc2bd5964c8591
1 parent
4873aa8c
Exists in
master
and in
5 other branches
Ajustes para compilar em android
Showing
13 changed files
with
398 additions
and
320 deletions
Show diff stats
pw3270.cbp
@@ -9,8 +9,8 @@ | @@ -9,8 +9,8 @@ | ||
9 | <Option compiler="mingw_64_compiler" /> | 9 | <Option compiler="mingw_64_compiler" /> |
10 | <Build> | 10 | <Build> |
11 | <Target title="Debug"> | 11 | <Target title="Debug"> |
12 | - <Option output=".bin\Debug\pw3270" prefix_auto="1" extension_auto="1" /> | ||
13 | - <Option object_output=".obj\Debug\" /> | 12 | + <Option output=".bin/Debug/pw3270" prefix_auto="1" extension_auto="1" /> |
13 | + <Option object_output=".obj/Debug/" /> | ||
14 | <Option type="1" /> | 14 | <Option type="1" /> |
15 | <Option compiler="mingw_64_compiler" /> | 15 | <Option compiler="mingw_64_compiler" /> |
16 | <Option use_console_runner="0" /> | 16 | <Option use_console_runner="0" /> |
@@ -20,8 +20,8 @@ | @@ -20,8 +20,8 @@ | ||
20 | </Compiler> | 20 | </Compiler> |
21 | </Target> | 21 | </Target> |
22 | <Target title="Release"> | 22 | <Target title="Release"> |
23 | - <Option output=".bin\Release\pw3270" prefix_auto="1" extension_auto="1" /> | ||
24 | - <Option object_output=".obj\Release\" /> | 23 | + <Option output=".bin/Release/pw3270" prefix_auto="1" extension_auto="1" /> |
24 | + <Option object_output=".obj/Release/" /> | ||
25 | <Option type="0" /> | 25 | <Option type="0" /> |
26 | <Option compiler="mingw_64_compiler" /> | 26 | <Option compiler="mingw_64_compiler" /> |
27 | <Compiler> | 27 | <Compiler> |
@@ -35,7 +35,7 @@ | @@ -35,7 +35,7 @@ | ||
35 | <Compiler> | 35 | <Compiler> |
36 | <Add option="-Wall" /> | 36 | <Add option="-Wall" /> |
37 | <Add option="`pkg-config gtk+-3.0 lib3270 --cflags`" /> | 37 | <Add option="`pkg-config gtk+-3.0 lib3270 --cflags`" /> |
38 | - <Add directory="src\include" /> | 38 | + <Add directory="src/include" /> |
39 | </Compiler> | 39 | </Compiler> |
40 | <Linker> | 40 | <Linker> |
41 | <Add option="`pkg-config gtk+-3.0 lib3270 --libs`" /> | 41 | <Add option="`pkg-config gtk+-3.0 lib3270 --libs`" /> |
@@ -45,285 +45,286 @@ | @@ -45,285 +45,286 @@ | ||
45 | <Unit filename="colors.conf" /> | 45 | <Unit filename="colors.conf" /> |
46 | <Unit filename="configure.ac" /> | 46 | <Unit filename="configure.ac" /> |
47 | <Unit filename="pw3270.spec.in" /> | 47 | <Unit filename="pw3270.spec.in" /> |
48 | - <Unit filename="src\include\lib3270.h" /> | ||
49 | - <Unit filename="src\include\lib3270\action_table.h" /> | ||
50 | - <Unit filename="src\include\lib3270\actions.h" /> | ||
51 | - <Unit filename="src\include\lib3270\config.h.in" /> | ||
52 | - <Unit filename="src\include\lib3270\filetransfer.h" /> | ||
53 | - <Unit filename="src\include\lib3270\log.h" /> | ||
54 | - <Unit filename="src\include\lib3270\popup.h" /> | ||
55 | - <Unit filename="src\include\lib3270\selection.h" /> | ||
56 | - <Unit filename="src\include\lib3270\session.h" /> | ||
57 | - <Unit filename="src\include\lib3270\trace.h" /> | ||
58 | - <Unit filename="src\include\pw3270.h" /> | ||
59 | - <Unit filename="src\include\rules.mak.in" /> | ||
60 | - <Unit filename="src\lib3270\3270ds.h" /> | ||
61 | - <Unit filename="src\lib3270\Makefile.in" /> | ||
62 | - <Unit filename="src\lib3270\X11keysym.h" /> | ||
63 | - <Unit filename="src\lib3270\XtGlue.c"> | 48 | + <Unit filename="src/include/lib3270.h" /> |
49 | + <Unit filename="src/include/lib3270/action_table.h" /> | ||
50 | + <Unit filename="src/include/lib3270/actions.h" /> | ||
51 | + <Unit filename="src/include/lib3270/config.h.in" /> | ||
52 | + <Unit filename="src/include/lib3270/filetransfer.h" /> | ||
53 | + <Unit filename="src/include/lib3270/log.h" /> | ||
54 | + <Unit filename="src/include/lib3270/popup.h" /> | ||
55 | + <Unit filename="src/include/lib3270/selection.h" /> | ||
56 | + <Unit filename="src/include/lib3270/session.h" /> | ||
57 | + <Unit filename="src/include/lib3270/trace.h" /> | ||
58 | + <Unit filename="src/include/pw3270.h" /> | ||
59 | + <Unit filename="src/include/rules.mak.in" /> | ||
60 | + <Unit filename="src/lib3270/3270ds.h" /> | ||
61 | + <Unit filename="src/lib3270/Makefile.in" /> | ||
62 | + <Unit filename="src/lib3270/X11keysym.h" /> | ||
63 | + <Unit filename="src/lib3270/XtGlue.c"> | ||
64 | <Option compilerVar="CC" /> | 64 | <Option compilerVar="CC" /> |
65 | </Unit> | 65 | </Unit> |
66 | - <Unit filename="src\lib3270\actions.c"> | 66 | + <Unit filename="src/lib3270/actions.c"> |
67 | <Option compilerVar="CC" /> | 67 | <Option compilerVar="CC" /> |
68 | </Unit> | 68 | </Unit> |
69 | - <Unit filename="src\lib3270\actionsc.h" /> | ||
70 | - <Unit filename="src\lib3270\ansi.c"> | 69 | + <Unit filename="src/lib3270/actionsc.h" /> |
70 | + <Unit filename="src/lib3270/ansi.c"> | ||
71 | <Option compilerVar="CC" /> | 71 | <Option compilerVar="CC" /> |
72 | </Unit> | 72 | </Unit> |
73 | - <Unit filename="src\lib3270\ansic.h" /> | ||
74 | - <Unit filename="src\lib3270\api.h" /> | ||
75 | - <Unit filename="src\lib3270\apl.c"> | 73 | + <Unit filename="src/lib3270/ansic.h" /> |
74 | + <Unit filename="src/lib3270/api.h" /> | ||
75 | + <Unit filename="src/lib3270/apl.c"> | ||
76 | <Option compilerVar="CC" /> | 76 | <Option compilerVar="CC" /> |
77 | </Unit> | 77 | </Unit> |
78 | - <Unit filename="src\lib3270\aplc.h" /> | ||
79 | - <Unit filename="src\lib3270\appres.h" /> | ||
80 | - <Unit filename="src\lib3270\arpa_telnet.h" /> | ||
81 | - <Unit filename="src\lib3270\bounds.c"> | 78 | + <Unit filename="src/lib3270/aplc.h" /> |
79 | + <Unit filename="src/lib3270/appres.h" /> | ||
80 | + <Unit filename="src/lib3270/arpa_telnet.h" /> | ||
81 | + <Unit filename="src/lib3270/bounds.c"> | ||
82 | <Option compilerVar="CC" /> | 82 | <Option compilerVar="CC" /> |
83 | </Unit> | 83 | </Unit> |
84 | - <Unit filename="src\lib3270\cg.h" /> | ||
85 | - <Unit filename="src\lib3270\charset.c"> | 84 | + <Unit filename="src/lib3270/cg.h" /> |
85 | + <Unit filename="src/lib3270/charset.c"> | ||
86 | <Option compilerVar="CC" /> | 86 | <Option compilerVar="CC" /> |
87 | </Unit> | 87 | </Unit> |
88 | - <Unit filename="src\lib3270\charsetc.h" /> | ||
89 | - <Unit filename="src\lib3270\childc.h" /> | ||
90 | - <Unit filename="src\lib3270\ctlr.c"> | 88 | + <Unit filename="src/lib3270/charsetc.h" /> |
89 | + <Unit filename="src/lib3270/childc.h" /> | ||
90 | + <Unit filename="src/lib3270/ctlr.c"> | ||
91 | <Option compilerVar="CC" /> | 91 | <Option compilerVar="CC" /> |
92 | </Unit> | 92 | </Unit> |
93 | - <Unit filename="src\lib3270\ctlr.h" /> | ||
94 | - <Unit filename="src\lib3270\ctlrc.h" /> | ||
95 | - <Unit filename="src\lib3270\dialogc.h" /> | ||
96 | - <Unit filename="src\lib3270\ft.c"> | 93 | + <Unit filename="src/lib3270/ctlr.h" /> |
94 | + <Unit filename="src/lib3270/ctlrc.h" /> | ||
95 | + <Unit filename="src/lib3270/dialogc.h" /> | ||
96 | + <Unit filename="src/lib3270/ft.c"> | ||
97 | <Option compilerVar="CC" /> | 97 | <Option compilerVar="CC" /> |
98 | </Unit> | 98 | </Unit> |
99 | - <Unit filename="src\lib3270\ft_cut.c"> | 99 | + <Unit filename="src/lib3270/ft_cut.c"> |
100 | <Option compilerVar="CC" /> | 100 | <Option compilerVar="CC" /> |
101 | </Unit> | 101 | </Unit> |
102 | - <Unit filename="src\lib3270\ft_cut_ds.h" /> | ||
103 | - <Unit filename="src\lib3270\ft_cutc.h" /> | ||
104 | - <Unit filename="src\lib3270\ft_dft.c"> | 102 | + <Unit filename="src/lib3270/ft_cut_ds.h" /> |
103 | + <Unit filename="src/lib3270/ft_cutc.h" /> | ||
104 | + <Unit filename="src/lib3270/ft_dft.c"> | ||
105 | <Option compilerVar="CC" /> | 105 | <Option compilerVar="CC" /> |
106 | </Unit> | 106 | </Unit> |
107 | - <Unit filename="src\lib3270\ft_dft_ds.h" /> | ||
108 | - <Unit filename="src\lib3270\ft_dftc.h" /> | ||
109 | - <Unit filename="src\lib3270\ftc.h" /> | ||
110 | - <Unit filename="src\lib3270\globals.h" /> | ||
111 | - <Unit filename="src\lib3270\glue.c"> | 107 | + <Unit filename="src/lib3270/ft_dft_ds.h" /> |
108 | + <Unit filename="src/lib3270/ft_dftc.h" /> | ||
109 | + <Unit filename="src/lib3270/ftc.h" /> | ||
110 | + <Unit filename="src/lib3270/globals.h" /> | ||
111 | + <Unit filename="src/lib3270/glue.c"> | ||
112 | <Option compilerVar="CC" /> | 112 | <Option compilerVar="CC" /> |
113 | </Unit> | 113 | </Unit> |
114 | - <Unit filename="src\lib3270\gluec.h" /> | ||
115 | - <Unit filename="src\lib3270\host.c"> | 114 | + <Unit filename="src/lib3270/gluec.h" /> |
115 | + <Unit filename="src/lib3270/host.c"> | ||
116 | <Option compilerVar="CC" /> | 116 | <Option compilerVar="CC" /> |
117 | </Unit> | 117 | </Unit> |
118 | - <Unit filename="src\lib3270\hostc.h" /> | ||
119 | - <Unit filename="src\lib3270\icmdc.h" /> | ||
120 | - <Unit filename="src\lib3270\init.c"> | 118 | + <Unit filename="src/lib3270/hostc.h" /> |
119 | + <Unit filename="src/lib3270/icmdc.h" /> | ||
120 | + <Unit filename="src/lib3270/init.c"> | ||
121 | <Option compilerVar="CC" /> | 121 | <Option compilerVar="CC" /> |
122 | </Unit> | 122 | </Unit> |
123 | - <Unit filename="src\lib3270\keypadc.h" /> | ||
124 | - <Unit filename="src\lib3270\kybd.c"> | 123 | + <Unit filename="src/lib3270/keypadc.h" /> |
124 | + <Unit filename="src/lib3270/kybd.c"> | ||
125 | <Option compilerVar="CC" /> | 125 | <Option compilerVar="CC" /> |
126 | </Unit> | 126 | </Unit> |
127 | - <Unit filename="src\lib3270\kybdc.h" /> | ||
128 | - <Unit filename="src\lib3270\localdefs.h" /> | ||
129 | - <Unit filename="src\lib3270\log.c"> | 127 | + <Unit filename="src/lib3270/kybdc.h" /> |
128 | + <Unit filename="src/lib3270/localdefs.h" /> | ||
129 | + <Unit filename="src/lib3270/log.c"> | ||
130 | <Option compilerVar="CC" /> | 130 | <Option compilerVar="CC" /> |
131 | </Unit> | 131 | </Unit> |
132 | - <Unit filename="src\lib3270\macros.c"> | 132 | + <Unit filename="src/lib3270/macros.c"> |
133 | <Option compilerVar="CC" /> | 133 | <Option compilerVar="CC" /> |
134 | </Unit> | 134 | </Unit> |
135 | - <Unit filename="src\lib3270\mkfb.c"> | 135 | + <Unit filename="src/lib3270/mkfb.c"> |
136 | <Option compilerVar="CC" /> | 136 | <Option compilerVar="CC" /> |
137 | </Unit> | 137 | </Unit> |
138 | - <Unit filename="src\lib3270\objects.h" /> | ||
139 | - <Unit filename="src\lib3270\paste.c"> | 138 | + <Unit filename="src/lib3270/objects.h" /> |
139 | + <Unit filename="src/lib3270/paste.c"> | ||
140 | <Option compilerVar="CC" /> | 140 | <Option compilerVar="CC" /> |
141 | </Unit> | 141 | </Unit> |
142 | - <Unit filename="src\lib3270\popupsc.h" /> | ||
143 | - <Unit filename="src\lib3270\printc.h" /> | ||
144 | - <Unit filename="src\lib3270\printerc.h" /> | ||
145 | - <Unit filename="src\lib3270\proxy.c"> | 142 | + <Unit filename="src/lib3270/popupsc.h" /> |
143 | + <Unit filename="src/lib3270/printc.h" /> | ||
144 | + <Unit filename="src/lib3270/printerc.h" /> | ||
145 | + <Unit filename="src/lib3270/proxy.c"> | ||
146 | <Option compilerVar="CC" /> | 146 | <Option compilerVar="CC" /> |
147 | </Unit> | 147 | </Unit> |
148 | - <Unit filename="src\lib3270\proxyc.h" /> | ||
149 | - <Unit filename="src\lib3270\resolver.c"> | 148 | + <Unit filename="src/lib3270/proxyc.h" /> |
149 | + <Unit filename="src/lib3270/resolver.c"> | ||
150 | <Option compilerVar="CC" /> | 150 | <Option compilerVar="CC" /> |
151 | </Unit> | 151 | </Unit> |
152 | - <Unit filename="src\lib3270\resolverc.h" /> | ||
153 | - <Unit filename="src\lib3270\resources.c"> | 152 | + <Unit filename="src/lib3270/resolverc.h" /> |
153 | + <Unit filename="src/lib3270/resources.c"> | ||
154 | <Option compilerVar="CC" /> | 154 | <Option compilerVar="CC" /> |
155 | </Unit> | 155 | </Unit> |
156 | - <Unit filename="src\lib3270\resources.h" /> | ||
157 | - <Unit filename="src\lib3270\rpq.c"> | 156 | + <Unit filename="src/lib3270/resources.h" /> |
157 | + <Unit filename="src/lib3270/rpq.c"> | ||
158 | <Option compilerVar="CC" /> | 158 | <Option compilerVar="CC" /> |
159 | </Unit> | 159 | </Unit> |
160 | - <Unit filename="src\lib3270\savec.h" /> | ||
161 | - <Unit filename="src\lib3270\screen.c"> | 160 | + <Unit filename="src/lib3270/rpq.h" /> |
161 | + <Unit filename="src/lib3270/savec.h" /> | ||
162 | + <Unit filename="src/lib3270/screen.c"> | ||
162 | <Option compilerVar="CC" /> | 163 | <Option compilerVar="CC" /> |
163 | </Unit> | 164 | </Unit> |
164 | - <Unit filename="src\lib3270\screen.h" /> | ||
165 | - <Unit filename="src\lib3270\screenc.h" /> | ||
166 | - <Unit filename="src\lib3270\scrollc.h" /> | ||
167 | - <Unit filename="src\lib3270\see.c"> | 165 | + <Unit filename="src/lib3270/screen.h" /> |
166 | + <Unit filename="src/lib3270/screenc.h" /> | ||
167 | + <Unit filename="src/lib3270/scrollc.h" /> | ||
168 | + <Unit filename="src/lib3270/see.c"> | ||
168 | <Option compilerVar="CC" /> | 169 | <Option compilerVar="CC" /> |
169 | </Unit> | 170 | </Unit> |
170 | - <Unit filename="src\lib3270\seec.h" /> | ||
171 | - <Unit filename="src\lib3270\selection.c"> | 171 | + <Unit filename="src/lib3270/seec.h" /> |
172 | + <Unit filename="src/lib3270/selection.c"> | ||
172 | <Option compilerVar="CC" /> | 173 | <Option compilerVar="CC" /> |
173 | </Unit> | 174 | </Unit> |
174 | - <Unit filename="src\lib3270\sf.c"> | 175 | + <Unit filename="src/lib3270/sf.c"> |
175 | <Option compilerVar="CC" /> | 176 | <Option compilerVar="CC" /> |
176 | </Unit> | 177 | </Unit> |
177 | - <Unit filename="src\lib3270\sfc.h" /> | ||
178 | - <Unit filename="src\lib3270\shlobj_missing.h" /> | ||
179 | - <Unit filename="src\lib3270\statusc.h" /> | ||
180 | - <Unit filename="src\lib3270\tables.c"> | 178 | + <Unit filename="src/lib3270/sf.h" /> |
179 | + <Unit filename="src/lib3270/shlobj_missing.h" /> | ||
180 | + <Unit filename="src/lib3270/statusc.h" /> | ||
181 | + <Unit filename="src/lib3270/tables.c"> | ||
181 | <Option compilerVar="CC" /> | 182 | <Option compilerVar="CC" /> |
182 | </Unit> | 183 | </Unit> |
183 | - <Unit filename="src\lib3270\tablesc.h" /> | ||
184 | - <Unit filename="src\lib3270\telnet.c"> | 184 | + <Unit filename="src/lib3270/tablesc.h" /> |
185 | + <Unit filename="src/lib3270/telnet.c"> | ||
185 | <Option compilerVar="CC" /> | 186 | <Option compilerVar="CC" /> |
186 | </Unit> | 187 | </Unit> |
187 | - <Unit filename="src\lib3270\telnetc.h" /> | ||
188 | - <Unit filename="src\lib3270\testprogram.c"> | 188 | + <Unit filename="src/lib3270/telnetc.h" /> |
189 | + <Unit filename="src/lib3270/testprogram.c"> | ||
189 | <Option compilerVar="CC" /> | 190 | <Option compilerVar="CC" /> |
190 | </Unit> | 191 | </Unit> |
191 | - <Unit filename="src\lib3270\tn3270e.h" /> | ||
192 | - <Unit filename="src\lib3270\toggle.h" /> | ||
193 | - <Unit filename="src\lib3270\toggles.c"> | 192 | + <Unit filename="src/lib3270/tn3270e.h" /> |
193 | + <Unit filename="src/lib3270/toggle.h" /> | ||
194 | + <Unit filename="src/lib3270/toggles.c"> | ||
194 | <Option compilerVar="CC" /> | 195 | <Option compilerVar="CC" /> |
195 | </Unit> | 196 | </Unit> |
196 | - <Unit filename="src\lib3270\togglesc.h" /> | ||
197 | - <Unit filename="src\lib3270\trace_ds.c"> | 197 | + <Unit filename="src/lib3270/togglesc.h" /> |
198 | + <Unit filename="src/lib3270/trace_ds.c"> | ||
198 | <Option compilerVar="CC" /> | 199 | <Option compilerVar="CC" /> |
199 | </Unit> | 200 | </Unit> |
200 | - <Unit filename="src\lib3270\trace_dsc.h" /> | ||
201 | - <Unit filename="src\lib3270\utf8.c"> | 201 | + <Unit filename="src/lib3270/trace_dsc.h" /> |
202 | + <Unit filename="src/lib3270/utf8.c"> | ||
202 | <Option compilerVar="CC" /> | 203 | <Option compilerVar="CC" /> |
203 | </Unit> | 204 | </Unit> |
204 | - <Unit filename="src\lib3270\utf8c.h" /> | ||
205 | - <Unit filename="src\lib3270\util.c"> | 205 | + <Unit filename="src/lib3270/utf8c.h" /> |
206 | + <Unit filename="src/lib3270/util.c"> | ||
206 | <Option compilerVar="CC" /> | 207 | <Option compilerVar="CC" /> |
207 | </Unit> | 208 | </Unit> |
208 | - <Unit filename="src\lib3270\utilc.h" /> | ||
209 | - <Unit filename="src\lib3270\w3misc.c"> | 209 | + <Unit filename="src/lib3270/utilc.h" /> |
210 | + <Unit filename="src/lib3270/w3misc.c"> | ||
210 | <Option compilerVar="CC" /> | 211 | <Option compilerVar="CC" /> |
211 | </Unit> | 212 | </Unit> |
212 | - <Unit filename="src\lib3270\w3miscc.h" /> | ||
213 | - <Unit filename="src\lib3270\widec.h" /> | ||
214 | - <Unit filename="src\lib3270\winvers.c"> | 213 | + <Unit filename="src/lib3270/w3miscc.h" /> |
214 | + <Unit filename="src/lib3270/widec.h" /> | ||
215 | + <Unit filename="src/lib3270/winvers.c"> | ||
215 | <Option compilerVar="CC" /> | 216 | <Option compilerVar="CC" /> |
216 | </Unit> | 217 | </Unit> |
217 | - <Unit filename="src\lib3270\winversc.h" /> | ||
218 | - <Unit filename="src\lib3270\xio.c"> | 218 | + <Unit filename="src/lib3270/winversc.h" /> |
219 | + <Unit filename="src/lib3270/xio.c"> | ||
219 | <Option compilerVar="CC" /> | 220 | <Option compilerVar="CC" /> |
220 | </Unit> | 221 | </Unit> |
221 | - <Unit filename="src\lib3270\xioc.h" /> | ||
222 | - <Unit filename="src\lib3270\xl.h" /> | ||
223 | - <Unit filename="src\pw3270\Makefile.in" /> | ||
224 | - <Unit filename="src\pw3270\actions.c"> | 222 | + <Unit filename="src/lib3270/xioc.h" /> |
223 | + <Unit filename="src/lib3270/xl.h" /> | ||
224 | + <Unit filename="src/pw3270/Makefile.in" /> | ||
225 | + <Unit filename="src/pw3270/actions.c"> | ||
225 | <Option compilerVar="CC" /> | 226 | <Option compilerVar="CC" /> |
226 | </Unit> | 227 | </Unit> |
227 | - <Unit filename="src\pw3270\colors.c"> | 228 | + <Unit filename="src/pw3270/colors.c"> |
228 | <Option compilerVar="CC" /> | 229 | <Option compilerVar="CC" /> |
229 | </Unit> | 230 | </Unit> |
230 | - <Unit filename="src\pw3270\common\common.h.in" /> | ||
231 | - <Unit filename="src\pw3270\common\config.c"> | 231 | + <Unit filename="src/pw3270/common/common.h.in" /> |
232 | + <Unit filename="src/pw3270/common/config.c"> | ||
232 | <Option compilerVar="CC" /> | 233 | <Option compilerVar="CC" /> |
233 | </Unit> | 234 | </Unit> |
234 | - <Unit filename="src\pw3270\common\sources.mak" /> | ||
235 | - <Unit filename="src\pw3270\dialog.c"> | 235 | + <Unit filename="src/pw3270/common/sources.mak" /> |
236 | + <Unit filename="src/pw3270/dialog.c"> | ||
236 | <Option compilerVar="CC" /> | 237 | <Option compilerVar="CC" /> |
237 | </Unit> | 238 | </Unit> |
238 | - <Unit filename="src\pw3270\filetransfer.c"> | 239 | + <Unit filename="src/pw3270/filetransfer.c"> |
239 | <Option compilerVar="CC" /> | 240 | <Option compilerVar="CC" /> |
240 | </Unit> | 241 | </Unit> |
241 | - <Unit filename="src\pw3270\filetransfer.h" /> | ||
242 | - <Unit filename="src\pw3270\fonts.c"> | 242 | + <Unit filename="src/pw3270/filetransfer.h" /> |
243 | + <Unit filename="src/pw3270/fonts.c"> | ||
243 | <Option compilerVar="CC" /> | 244 | <Option compilerVar="CC" /> |
244 | </Unit> | 245 | </Unit> |
245 | - <Unit filename="src\pw3270\globals.h" /> | ||
246 | - <Unit filename="src\pw3270\main.c"> | 246 | + <Unit filename="src/pw3270/globals.h" /> |
247 | + <Unit filename="src/pw3270/main.c"> | ||
247 | <Option compilerVar="CC" /> | 248 | <Option compilerVar="CC" /> |
248 | </Unit> | 249 | </Unit> |
249 | - <Unit filename="src\pw3270\print.c"> | 250 | + <Unit filename="src/pw3270/print.c"> |
250 | <Option compilerVar="CC" /> | 251 | <Option compilerVar="CC" /> |
251 | </Unit> | 252 | </Unit> |
252 | - <Unit filename="src\pw3270\uiparser\Makefile.in" /> | ||
253 | - <Unit filename="src\pw3270\uiparser\accelerator.c"> | 253 | + <Unit filename="src/pw3270/uiparser/Makefile.in" /> |
254 | + <Unit filename="src/pw3270/uiparser/accelerator.c"> | ||
254 | <Option compilerVar="CC" /> | 255 | <Option compilerVar="CC" /> |
255 | </Unit> | 256 | </Unit> |
256 | - <Unit filename="src\pw3270\uiparser\action.c"> | 257 | + <Unit filename="src/pw3270/uiparser/action.c"> |
257 | <Option compilerVar="CC" /> | 258 | <Option compilerVar="CC" /> |
258 | </Unit> | 259 | </Unit> |
259 | - <Unit filename="src\pw3270\uiparser\menu.c"> | 260 | + <Unit filename="src/pw3270/uiparser/menu.c"> |
260 | <Option compilerVar="CC" /> | 261 | <Option compilerVar="CC" /> |
261 | </Unit> | 262 | </Unit> |
262 | - <Unit filename="src\pw3270\uiparser\menubar.c"> | 263 | + <Unit filename="src/pw3270/uiparser/menubar.c"> |
263 | <Option compilerVar="CC" /> | 264 | <Option compilerVar="CC" /> |
264 | </Unit> | 265 | </Unit> |
265 | - <Unit filename="src\pw3270\uiparser\menuitem.c"> | 266 | + <Unit filename="src/pw3270/uiparser/menuitem.c"> |
266 | <Option compilerVar="CC" /> | 267 | <Option compilerVar="CC" /> |
267 | </Unit> | 268 | </Unit> |
268 | - <Unit filename="src\pw3270\uiparser\parsefile.c"> | 269 | + <Unit filename="src/pw3270/uiparser/parsefile.c"> |
269 | <Option compilerVar="CC" /> | 270 | <Option compilerVar="CC" /> |
270 | </Unit> | 271 | </Unit> |
271 | - <Unit filename="src\pw3270\uiparser\parser.c"> | 272 | + <Unit filename="src/pw3270/uiparser/parser.c"> |
272 | <Option compilerVar="CC" /> | 273 | <Option compilerVar="CC" /> |
273 | </Unit> | 274 | </Unit> |
274 | - <Unit filename="src\pw3270\uiparser\parser.h" /> | ||
275 | - <Unit filename="src\pw3270\uiparser\popup.c"> | 275 | + <Unit filename="src/pw3270/uiparser/parser.h" /> |
276 | + <Unit filename="src/pw3270/uiparser/popup.c"> | ||
276 | <Option compilerVar="CC" /> | 277 | <Option compilerVar="CC" /> |
277 | </Unit> | 278 | </Unit> |
278 | - <Unit filename="src\pw3270\uiparser\private.h" /> | ||
279 | - <Unit filename="src\pw3270\uiparser\script.c"> | 279 | + <Unit filename="src/pw3270/uiparser/private.h" /> |
280 | + <Unit filename="src/pw3270/uiparser/script.c"> | ||
280 | <Option compilerVar="CC" /> | 281 | <Option compilerVar="CC" /> |
281 | </Unit> | 282 | </Unit> |
282 | - <Unit filename="src\pw3270\uiparser\separator.c"> | 283 | + <Unit filename="src/pw3270/uiparser/separator.c"> |
283 | <Option compilerVar="CC" /> | 284 | <Option compilerVar="CC" /> |
284 | </Unit> | 285 | </Unit> |
285 | - <Unit filename="src\pw3270\uiparser\sources.mak" /> | ||
286 | - <Unit filename="src\pw3270\uiparser\toolbar.c"> | 286 | + <Unit filename="src/pw3270/uiparser/sources.mak" /> |
287 | + <Unit filename="src/pw3270/uiparser/toolbar.c"> | ||
287 | <Option compilerVar="CC" /> | 288 | <Option compilerVar="CC" /> |
288 | </Unit> | 289 | </Unit> |
289 | - <Unit filename="src\pw3270\uiparser\toolitem.c"> | 290 | + <Unit filename="src/pw3270/uiparser/toolitem.c"> |
290 | <Option compilerVar="CC" /> | 291 | <Option compilerVar="CC" /> |
291 | </Unit> | 292 | </Unit> |
292 | - <Unit filename="src\pw3270\v3270\accessible.c"> | 293 | + <Unit filename="src/pw3270/v3270/accessible.c"> |
293 | <Option compilerVar="CC" /> | 294 | <Option compilerVar="CC" /> |
294 | </Unit> | 295 | </Unit> |
295 | - <Unit filename="src\pw3270\v3270\accessible.h" /> | ||
296 | - <Unit filename="src\pw3270\v3270\draw.c"> | 296 | + <Unit filename="src/pw3270/v3270/accessible.h" /> |
297 | + <Unit filename="src/pw3270/v3270/draw.c"> | ||
297 | <Option compilerVar="CC" /> | 298 | <Option compilerVar="CC" /> |
298 | </Unit> | 299 | </Unit> |
299 | - <Unit filename="src\pw3270\v3270\genmarshal" /> | ||
300 | - <Unit filename="src\pw3270\v3270\iocallback.c"> | 300 | + <Unit filename="src/pw3270/v3270/genmarshal" /> |
301 | + <Unit filename="src/pw3270/v3270/iocallback.c"> | ||
301 | <Option compilerVar="CC" /> | 302 | <Option compilerVar="CC" /> |
302 | </Unit> | 303 | </Unit> |
303 | - <Unit filename="src\pw3270\v3270\keyboard.c"> | 304 | + <Unit filename="src/pw3270/v3270/keyboard.c"> |
304 | <Option compilerVar="CC" /> | 305 | <Option compilerVar="CC" /> |
305 | </Unit> | 306 | </Unit> |
306 | - <Unit filename="src\pw3270\v3270\mouse.c"> | 307 | + <Unit filename="src/pw3270/v3270/mouse.c"> |
307 | <Option compilerVar="CC" /> | 308 | <Option compilerVar="CC" /> |
308 | </Unit> | 309 | </Unit> |
309 | - <Unit filename="src\pw3270\v3270\oia.c"> | 310 | + <Unit filename="src/pw3270/v3270/oia.c"> |
310 | <Option compilerVar="CC" /> | 311 | <Option compilerVar="CC" /> |
311 | </Unit> | 312 | </Unit> |
312 | - <Unit filename="src\pw3270\v3270\private.h" /> | ||
313 | - <Unit filename="src\pw3270\v3270\selection.c"> | 313 | + <Unit filename="src/pw3270/v3270/private.h" /> |
314 | + <Unit filename="src/pw3270/v3270/selection.c"> | ||
314 | <Option compilerVar="CC" /> | 315 | <Option compilerVar="CC" /> |
315 | </Unit> | 316 | </Unit> |
316 | - <Unit filename="src\pw3270\v3270\sources.mak" /> | ||
317 | - <Unit filename="src\pw3270\v3270\v3270.h" /> | ||
318 | - <Unit filename="src\pw3270\v3270\widget.c"> | 317 | + <Unit filename="src/pw3270/v3270/sources.mak" /> |
318 | + <Unit filename="src/pw3270/v3270/v3270.h" /> | ||
319 | + <Unit filename="src/pw3270/v3270/widget.c"> | ||
319 | <Option compilerVar="CC" /> | 320 | <Option compilerVar="CC" /> |
320 | </Unit> | 321 | </Unit> |
321 | - <Unit filename="src\pw3270\window.c"> | 322 | + <Unit filename="src/pw3270/window.c"> |
322 | <Option compilerVar="CC" /> | 323 | <Option compilerVar="CC" /> |
323 | </Unit> | 324 | </Unit> |
324 | - <Unit filename="src\tools\Makefile.in" /> | ||
325 | - <Unit filename="ui\00default.xml" /> | ||
326 | - <Unit filename="ui\99debug.xml" /> | 325 | + <Unit filename="src/tools/Makefile.in" /> |
326 | + <Unit filename="ui/00default.xml" /> | ||
327 | + <Unit filename="ui/99debug.xml" /> | ||
327 | <Extensions> | 328 | <Extensions> |
328 | <code_completion /> | 329 | <code_completion /> |
329 | <debugger /> | 330 | <debugger /> |
src/android/jni/Android.mk
@@ -29,7 +29,7 @@ include $(CLEAR_VARS) | @@ -29,7 +29,7 @@ include $(CLEAR_VARS) | ||
29 | 29 | ||
30 | # include ../lib3270/sources.mak | 30 | # include ../lib3270/sources.mak |
31 | TERMINAL_SOURCES= bounds.c XtGlue.c ctlr.c util.c toggles.c screen.c selection.c kybd.c telnet.c \ | 31 | TERMINAL_SOURCES= bounds.c XtGlue.c ctlr.c util.c toggles.c screen.c selection.c kybd.c telnet.c \ |
32 | - host.c sf.c ansi.c log.c resolver.c xio.c tables.c proxy.c | 32 | + host.c sf.c ansi.c log.c resolver.c xio.c tables.c proxy.c utf8.c charset.c |
33 | 33 | ||
34 | LOCAL_CFLAGS=-I../include | 34 | LOCAL_CFLAGS=-I../include |
35 | LOCAL_MODULE := lib3270 | 35 | LOCAL_MODULE := lib3270 |
src/include/lib3270.h
@@ -749,6 +749,43 @@ | @@ -749,6 +749,43 @@ | ||
749 | 749 | ||
750 | LIB3270_EXPORT int lib3270_is_protected(H3270 *h, unsigned int baddr); | 750 | LIB3270_EXPORT int lib3270_is_protected(H3270 *h, unsigned int baddr); |
751 | 751 | ||
752 | + /** | ||
753 | + * Alloc/Realloc memory buffer. | ||
754 | + * | ||
755 | + * Allocate/reallocate an array. | ||
756 | + * | ||
757 | + * @param elsize Element size. | ||
758 | + * @param nelem Number of elements in the array. | ||
759 | + * @param ptr Pointer to the actual array. | ||
760 | + * | ||
761 | + * @return Clean buffer with size for the number of elements. | ||
762 | + * | ||
763 | + */ | ||
764 | + LIB3270_EXPORT void * lib3270_calloc(int elsize, int nelem, void *ptr); | ||
765 | + | ||
766 | + LIB3270_EXPORT void * lib3270_malloc(int len); | ||
767 | + LIB3270_EXPORT void * lib3270_realloc(void *p, int len); | ||
768 | + | ||
769 | + /** | ||
770 | + * Release allocated memory. | ||
771 | + * | ||
772 | + * @param p Memory block to release (can be NULL) | ||
773 | + * | ||
774 | + */ | ||
775 | + LIB3270_EXPORT void lib3270_free(void *p); | ||
776 | + | ||
777 | + | ||
778 | + /** | ||
779 | + * Get resource string. | ||
780 | + * | ||
781 | + * @param first_element First element of resource path | ||
782 | + * @param ... Resource path (ends with NULL) | ||
783 | + * | ||
784 | + * @return Resource string (Release with lib3270_free()) | ||
785 | + * | ||
786 | + */ | ||
787 | + LIB3270_EXPORT char * lib3270_get_resource_string(const char *first_element, ...); | ||
788 | + | ||
752 | 789 | ||
753 | #ifdef __cplusplus | 790 | #ifdef __cplusplus |
754 | } | 791 | } |
src/lib3270/XtGlue.c
@@ -566,60 +566,6 @@ static int DefaultProcessEvents(int block) | @@ -566,60 +566,6 @@ static int DefaultProcessEvents(int block) | ||
566 | 566 | ||
567 | /*---[ Implement external calls ]---------------------------------------------------------------------------*/ | 567 | /*---[ Implement external calls ]---------------------------------------------------------------------------*/ |
568 | 568 | ||
569 | -void * Malloc(size_t len) | ||
570 | -{ | ||
571 | - char *r; | ||
572 | - | ||
573 | - r = malloc(len); | ||
574 | - if (r == (char *)NULL) | ||
575 | - Error(NULL,"Out of memory"); | ||
576 | - return r; | ||
577 | -} | ||
578 | - | ||
579 | -void * Calloc(size_t nelem, size_t elsize) | ||
580 | -{ | ||
581 | - int sz = nelem * elsize; | ||
582 | - char * r = malloc(sz); | ||
583 | - | ||
584 | - if(!r) | ||
585 | - Error(NULL,"Out of memory"); | ||
586 | - | ||
587 | - memset(r, 0, sz); | ||
588 | - return r; | ||
589 | -} | ||
590 | - | ||
591 | -void * Realloc(void *p, size_t len) | ||
592 | -{ | ||
593 | - p = realloc(p, len); | ||
594 | - if (p == NULL) | ||
595 | - Error(NULL,"Out of memory"); | ||
596 | - return p; | ||
597 | -} | ||
598 | - | ||
599 | -void Free(void *p) | ||
600 | -{ | ||
601 | - if(p) | ||
602 | - free(p); | ||
603 | -} | ||
604 | - | ||
605 | -void * lib3270_calloc(size_t elsize, size_t nelem, void *ptr) | ||
606 | -{ | ||
607 | - size_t sz = nelem * elsize; | ||
608 | - | ||
609 | - if(ptr) | ||
610 | - ptr = realloc(ptr,sz); | ||
611 | - else | ||
612 | - ptr = malloc(sz); | ||
613 | - | ||
614 | - if(ptr) | ||
615 | - memset(ptr,0,sz); | ||
616 | - else | ||
617 | - Error(NULL,"Out of memory"); | ||
618 | - | ||
619 | - return ptr; | ||
620 | -} | ||
621 | - | ||
622 | - | ||
623 | static struct { | 569 | static struct { |
624 | const char *name; | 570 | const char *name; |
625 | KeySym keysym; | 571 | KeySym keysym; |
src/lib3270/charset.c
@@ -159,25 +159,28 @@ restore_charset(void) | @@ -159,25 +159,28 @@ restore_charset(void) | ||
159 | } | 159 | } |
160 | 160 | ||
161 | /* Get a character set definition. */ | 161 | /* Get a character set definition. */ |
162 | -static const char * get_charset_def(const char *csname) | 162 | +/* |
163 | +static char * get_charset_def(const char *csname) | ||
163 | { | 164 | { |
164 | - return get_fresource("%s.%s", ResCharset, csname); | 165 | + return get_fresource("%s.%s", "charset", csname); |
165 | } | 166 | } |
167 | +*/ | ||
166 | 168 | ||
167 | -#if defined(X3270_DBCS) /*[*/ | ||
168 | /* | 169 | /* |
169 | - * Initialize the DBCS conversion functions, based on resource values. | ||
170 | - */ | 170 | +#if defined(X3270_DBCS) |
171 | +// | ||
172 | +// Initialize the DBCS conversion functions, based on resource values. | ||
173 | +// | ||
171 | static int | 174 | static int |
172 | wide_resource_init(char *csname) | 175 | wide_resource_init(char *csname) |
173 | { | 176 | { |
174 | char *cn, *en; | 177 | char *cn, *en; |
175 | 178 | ||
176 | - cn = get_fresource("%s.%s", ResDbcsConverters, csname); | 179 | + cn = get_fresource("%s.%s", "dbcsConverters", csname); |
177 | if (cn == CN) | 180 | if (cn == CN) |
178 | return 0; | 181 | return 0; |
179 | 182 | ||
180 | - en = get_fresource("%s.%s", ResLocalEncoding, csname); | 183 | + en = get_fresource("%s.%s", "localEncoding", csname); |
181 | if (en == CN) | 184 | if (en == CN) |
182 | en = appres.local_encoding; | 185 | en = appres.local_encoding; |
183 | Replace(converter_names, cn); | 186 | Replace(converter_names, cn); |
@@ -186,78 +189,60 @@ wide_resource_init(char *csname) | @@ -186,78 +189,60 @@ wide_resource_init(char *csname) | ||
186 | return wide_init(cn, en); | 189 | return wide_init(cn, en); |
187 | 190 | ||
188 | } | 191 | } |
189 | -#endif /*]*/ | 192 | +#endif |
193 | +*/ | ||
190 | 194 | ||
191 | /* | 195 | /* |
192 | * Change character sets. | 196 | * Change character sets. |
193 | */ | 197 | */ |
194 | enum cs_result charset_init(H3270 *session, char *csname) | 198 | enum cs_result charset_init(H3270 *session, char *csname) |
195 | { | 199 | { |
196 | - const char *cs; | 200 | + char *cs; |
197 | const char *ftcs; | 201 | const char *ftcs; |
198 | enum cs_result rc; | 202 | enum cs_result rc; |
199 | char *ccs, *cftcs; | 203 | char *ccs, *cftcs; |
200 | -/* | ||
201 | -#if defined(X3270_DISPLAY) | ||
202 | - char *xks; | ||
203 | -#endif | ||
204 | -*/ | ||
205 | const char *ak; | 204 | const char *ak; |
206 | 205 | ||
207 | -/* | ||
208 | -#if !defined(_WIN32) | ||
209 | - char *codeset_name; | ||
210 | -#endif | ||
211 | - | ||
212 | -#if !defined(_WIN32) | ||
213 | - // Get all of the locale stuff right. | ||
214 | - | ||
215 | - // Figure out the locale code set (character set encoding). | ||
216 | - codeset_name = nl_langinfo(CODESET); | ||
217 | - Trace("codeset_name: %s",codeset_name); | ||
218 | - set_codeset(codeset_name); | ||
219 | -#endif | ||
220 | -*/ | ||
221 | - | ||
222 | 206 | ||
223 | /* Do nothing, successfully. */ | 207 | /* Do nothing, successfully. */ |
224 | if (csname == CN || !strcasecmp(csname, "us")) | 208 | if (csname == CN || !strcasecmp(csname, "us")) |
225 | { | 209 | { |
226 | charset_defaults(); | 210 | charset_defaults(); |
227 | set_cgcsgids(CN); | 211 | set_cgcsgids(CN); |
228 | -// set_charset_name(CN); | ||
229 | set_display_charset(session, "ISO-8859-1"); | 212 | set_display_charset(session, "ISO-8859-1"); |
230 | return CS_OKAY; | 213 | return CS_OKAY; |
231 | } | 214 | } |
232 | 215 | ||
233 | /* Figure out if it's already in a resource or in a file. */ | 216 | /* Figure out if it's already in a resource or in a file. */ |
234 | - cs = get_charset_def(csname); | ||
235 | - if (cs == CN && | ||
236 | - strlen(csname) > ES_SIZE && | ||
237 | - !strcasecmp(csname + strlen(csname) - ES_SIZE, EURO_SUFFIX)) { | ||
238 | - char *basename; | 217 | +#ifdef ANDROID |
218 | + ccs = strdup("0xad: [ \n 0xba: Yacute \n0xbd: ] \n 0xbb: diaeresis \n"); | ||
219 | +#else | ||
220 | + ccs = lib3270_get_resource_string("charset", csname, NULL); | ||
221 | +#endif | ||
222 | +/* | ||
223 | + if (cs == CN && strlen(csname) > ES_SIZE && !strcasecmp(csname + strlen(csname) - ES_SIZE, EURO_SUFFIX)) | ||
224 | + { | ||
225 | + char *basename = | ||
226 | + lib3270_free(cs); | ||
239 | 227 | ||
240 | - /* Grab the non-Euro definition. */ | 228 | + // Grab the non-Euro definition. |
241 | basename = xs_buffer("%.*s", (int) (strlen(csname) - ES_SIZE), csname); | 229 | basename = xs_buffer("%.*s", (int) (strlen(csname) - ES_SIZE), csname); |
242 | cs = get_charset_def(basename); | 230 | cs = get_charset_def(basename); |
243 | Free(basename); | 231 | Free(basename); |
244 | } | 232 | } |
245 | - if (cs == CN) | 233 | +*/ |
234 | + if (!ccs) | ||
246 | return CS_NOTFOUND; | 235 | return CS_NOTFOUND; |
247 | 236 | ||
248 | /* Grab the File Transfer character set. */ | 237 | /* Grab the File Transfer character set. */ |
249 | - ftcs = get_fresource("%s.%s", ResFtCharset, csname); | ||
250 | - | ||
251 | - /* Copy strings. */ | ||
252 | - ccs = NewString(cs); | ||
253 | - cftcs = (ftcs == NULL)? NULL: NewString(ftcs); | 238 | + cftcs = lib3270_get_resource_string("ftCharset",csname,NULL); |
254 | 239 | ||
255 | /* Save the current definitions, and start over with the defaults. */ | 240 | /* Save the current definitions, and start over with the defaults. */ |
256 | save_charset(); | 241 | save_charset(); |
257 | charset_defaults(); | 242 | charset_defaults(); |
258 | 243 | ||
259 | /* Check for auto-keymap. */ | 244 | /* Check for auto-keymap. */ |
260 | - ak = get_fresource("%s.%s", ResAutoKeymap, csname); | 245 | + ak = lib3270_get_resource_string("autoKeymap", csname, NULL); |
261 | if (ak != NULL) | 246 | if (ak != NULL) |
262 | auto_keymap = !strcasecmp(ak, "true"); | 247 | auto_keymap = !strcasecmp(ak, "true"); |
263 | else | 248 | else |
@@ -277,12 +262,15 @@ enum cs_result charset_init(H3270 *session, char *csname) | @@ -277,12 +262,15 @@ enum cs_result charset_init(H3270 *session, char *csname) | ||
277 | 262 | ||
278 | if (rc != CS_OKAY) | 263 | if (rc != CS_OKAY) |
279 | restore_charset(); | 264 | restore_charset(); |
280 | -#if defined(X3270_DBCS) /*[*/ | 265 | + |
266 | +/* | ||
267 | +#if defined(X3270_DBCS) | ||
281 | else if (wide_resource_init(csname) < 0) { | 268 | else if (wide_resource_init(csname) < 0) { |
282 | restore_charset(); | 269 | restore_charset(); |
283 | return CS_NOTFOUND; | 270 | return CS_NOTFOUND; |
284 | } | 271 | } |
285 | -#endif /*]*/ | 272 | +#endif |
273 | +*/ | ||
286 | 274 | ||
287 | /* | 275 | /* |
288 | #if defined(X3270_DISPLAY) | 276 | #if defined(X3270_DISPLAY) |
@@ -384,11 +372,11 @@ set_charset_name(char *csname) | @@ -384,11 +372,11 @@ set_charset_name(char *csname) | ||
384 | /* Define a charset from resources. */ | 372 | /* Define a charset from resources. */ |
385 | static enum cs_result resource_charset(char *csname, char *cs, char *ftcs) | 373 | static enum cs_result resource_charset(char *csname, char *cs, char *ftcs) |
386 | { | 374 | { |
387 | - enum cs_result rc; | ||
388 | - int ne = 0; | ||
389 | - const char *rcs = CN; | ||
390 | - int n_rcs = 0; | ||
391 | - const char *dcs; | 375 | + enum cs_result rc; |
376 | + int ne = 0; | ||
377 | + char * rcs = CN; | ||
378 | + int n_rcs = 0; | ||
379 | + char * dcs; | ||
392 | 380 | ||
393 | /* Interpret the spec. */ | 381 | /* Interpret the spec. */ |
394 | rc = remap_chars(csname, cs, (ftcs == NULL)? BOTH: CS_ONLY, &ne); | 382 | rc = remap_chars(csname, cs, (ftcs == NULL)? BOTH: CS_ONLY, &ne); |
@@ -400,37 +388,44 @@ static enum cs_result resource_charset(char *csname, char *cs, char *ftcs) | @@ -400,37 +388,44 @@ static enum cs_result resource_charset(char *csname, char *cs, char *ftcs) | ||
400 | return rc; | 388 | return rc; |
401 | } | 389 | } |
402 | 390 | ||
403 | - rcs = get_fresource("%s.%s", ResDisplayCharset, csname); | 391 | +// rcs = get_fresource("%s.%s", "displayCharset", csname); |
392 | + rcs = lib3270_get_resource_string("displayCharset", csname, NULL); | ||
404 | 393 | ||
405 | /* Isolate the pieces. */ | 394 | /* Isolate the pieces. */ |
406 | - if (rcs != CN) { | ||
407 | - char *rcs_copy, *buf, *token; | 395 | + if (rcs != CN) |
396 | + { | ||
397 | + char *buf, *token; | ||
408 | 398 | ||
409 | - buf = rcs_copy = NewString(rcs); | ||
410 | - while ((token = strtok(buf, "+")) != CN) { | 399 | + buf = rcs; |
400 | + while ((token = strtok(buf, "+")) != CN) | ||
401 | + { | ||
411 | buf = CN; | 402 | buf = CN; |
412 | - switch (n_rcs) { | 403 | + switch (n_rcs) |
404 | + { | ||
413 | case 0: | 405 | case 0: |
414 | -#if defined(X3270_DBCS) /*[*/ | 406 | +#if defined(X3270_DBCS) |
415 | case 1: | 407 | case 1: |
416 | -#endif /*]*/ | 408 | +#endif |
417 | break; | 409 | break; |
418 | default: | 410 | default: |
419 | - popup_an_error(NULL,"Extra %s value(s), ignoring", | ||
420 | - ResDisplayCharset); | 411 | + popup_an_error(NULL,"Extra value(s) in displayCharset.%s, ignoring", csname); |
421 | break; | 412 | break; |
422 | } | 413 | } |
423 | n_rcs++; | 414 | n_rcs++; |
424 | } | 415 | } |
425 | } | 416 | } |
426 | 417 | ||
427 | -#if defined(X3270_DBCS) /*[*/ | ||
428 | - /* Can't swap DBCS modes while connected. */ | 418 | + lib3270_free(rcs); |
419 | + | ||
420 | +/* | ||
421 | +#if defined(X3270_DBCS) | ||
422 | + // Can't swap DBCS modes while connected. | ||
429 | if (IN_3270 && (n_rcs == 2) != dbcs) { | 423 | if (IN_3270 && (n_rcs == 2) != dbcs) { |
430 | popup_an_error(NULL,"Can't change DBCS modes while connected"); | 424 | popup_an_error(NULL,"Can't change DBCS modes while connected"); |
431 | return CS_ILLEGAL; | 425 | return CS_ILLEGAL; |
432 | } | 426 | } |
433 | -#endif /*]*/ | 427 | +#endif |
428 | +*/ | ||
434 | 429 | ||
435 | /* | 430 | /* |
436 | #if !defined(_WIN32) | 431 | #if !defined(_WIN32) |
@@ -445,15 +440,23 @@ static enum cs_result resource_charset(char *csname, char *cs, char *ftcs) | @@ -445,15 +440,23 @@ static enum cs_result resource_charset(char *csname, char *cs, char *ftcs) | ||
445 | */ | 440 | */ |
446 | 441 | ||
447 | /* Set up the cgcsgid. */ | 442 | /* Set up the cgcsgid. */ |
448 | - set_cgcsgids(get_fresource("%s.%s", ResCodepage, csname)); | 443 | +// set_cgcsgids(get_fresource("%s.%s", "codepage", csname)); |
444 | + { | ||
445 | + char *ptr = lib3270_get_resource_string("codepage", csname, NULL); | ||
446 | + set_cgcsgids(ptr); | ||
447 | + lib3270_free(ptr); | ||
448 | + } | ||
449 | 449 | ||
450 | - dcs = get_fresource("%s.%s", ResDisplayCharset, csname); | 450 | +// dcs = get_fresource("%s.%s", "displayCharset", csname); |
451 | + dcs = lib3270_get_resource_string("displayCharset", csname, NULL); | ||
451 | 452 | ||
452 | if (dcs != NULL) | 453 | if (dcs != NULL) |
453 | set_display_charset(&h3270,dcs); | 454 | set_display_charset(&h3270,dcs); |
454 | else | 455 | else |
455 | set_display_charset(&h3270,"ISO-8859-1"); | 456 | set_display_charset(&h3270,"ISO-8859-1"); |
456 | 457 | ||
458 | + lib3270_free(dcs); | ||
459 | + | ||
457 | /* Set up the character set name. */ | 460 | /* Set up the character set name. */ |
458 | // set_charset_name(csname); | 461 | // set_charset_name(csname); |
459 | 462 |
src/lib3270/ctlr.c
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | #include "screenc.h" | 56 | #include "screenc.h" |
57 | #include "scrollc.h" | 57 | #include "scrollc.h" |
58 | #include "seec.h" | 58 | #include "seec.h" |
59 | -#include "sfc.h" | 59 | +#include "sf.h" |
60 | #include "statusc.h" | 60 | #include "statusc.h" |
61 | #include "tablesc.h" | 61 | #include "tablesc.h" |
62 | #include "telnetc.h" | 62 | #include "telnetc.h" |
@@ -167,8 +167,7 @@ void ctlr_reinit(H3270 *session, unsigned cmask) | @@ -167,8 +167,7 @@ void ctlr_reinit(H3270 *session, unsigned cmask) | ||
167 | struct ea *tmp; | 167 | struct ea *tmp; |
168 | size_t sz = (session->maxROWS * session->maxCOLS); | 168 | size_t sz = (session->maxROWS * session->maxCOLS); |
169 | 169 | ||
170 | - | ||
171 | - session->buffer[0] = tmp = lib3270_calloc(sizeof(struct ea),sz+1, session->buffer[0]); | 170 | + session->buffer[0] = tmp = lib3270_calloc(sizeof(struct ea), sz+1, session->buffer[0]); |
172 | session->ea_buf = tmp + 1; | 171 | session->ea_buf = tmp + 1; |
173 | 172 | ||
174 | session->buffer[1] = tmp = lib3270_calloc(sizeof(struct ea),sz+1,session->buffer[1]); | 173 | session->buffer[1] = tmp = lib3270_calloc(sizeof(struct ea),sz+1,session->buffer[1]); |
src/lib3270/kybd.c
@@ -3461,7 +3461,7 @@ add_xk(KeySym key, KeySym assoc) | @@ -3461,7 +3461,7 @@ add_xk(KeySym key, KeySym assoc) | ||
3461 | xk[i].assoc = assoc; | 3461 | xk[i].assoc = assoc; |
3462 | return; | 3462 | return; |
3463 | } | 3463 | } |
3464 | - xk = (struct xks *)Realloc(xk, (nxk + 1) * sizeof(struct xks)); | 3464 | + xk = (struct xks *) Realloc(xk, (nxk + 1) * sizeof(struct xks)); |
3465 | xk[nxk].key = key; | 3465 | xk[nxk].key = key; |
3466 | xk[nxk].assoc = assoc; | 3466 | xk[nxk].assoc = assoc; |
3467 | nxk++; | 3467 | nxk++; |
src/lib3270/localdefs.h
@@ -63,24 +63,15 @@ typedef struct _XtActionsRec{ | @@ -63,24 +63,15 @@ typedef struct _XtActionsRec{ | ||
63 | 63 | ||
64 | /* These are local functions with similar semantics to X functions. */ | 64 | /* These are local functions with similar semantics to X functions. */ |
65 | 65 | ||
66 | -void * Malloc(size_t); | ||
67 | -void Free(void *); | ||
68 | -void * Calloc(size_t, size_t); | ||
69 | -void * Realloc(void *, size_t); | 66 | +// void * Malloc(size_t); |
67 | +// void Free(void *); | ||
68 | +// void * Calloc(size_t, size_t); | ||
69 | +// void * Realloc(void *, size_t); | ||
70 | 70 | ||
71 | -/** | ||
72 | - * Alloc/Realloc memory buffer. | ||
73 | - * | ||
74 | - * Allocate/reallocate an array. | ||
75 | - * | ||
76 | - * @param elsize Element size. | ||
77 | - * @param nelem Number of elements in the array. | ||
78 | - * @param ptr Pointer to the actual array. | ||
79 | - * | ||
80 | - * @return ptr allocated with the new array size. | ||
81 | - * | ||
82 | - */ | ||
83 | -void * lib3270_calloc(size_t elsize, size_t nelem, void *ptr); | 71 | +#define Malloc(x) lib3270_malloc(x) |
72 | +#define Free(x) lib3270_free(x) | ||
73 | +#define Calloc(e,n) lib3270_calloc(e,n,NULL) | ||
74 | +#define Realloc(x,n) lib3270_realloc(x,n) | ||
84 | 75 | ||
85 | #define NewString(x) strdup(x) | 76 | #define NewString(x) strdup(x) |
86 | //extern char *NewString(const char *); | 77 | //extern char *NewString(const char *); |
src/lib3270/rpq.c
@@ -64,6 +64,7 @@ | @@ -64,6 +64,7 @@ | ||
64 | #include "telnetc.h" | 64 | #include "telnetc.h" |
65 | #include "trace_dsc.h" | 65 | #include "trace_dsc.h" |
66 | #include "utilc.h" | 66 | #include "utilc.h" |
67 | +#include "sf.h" | ||
67 | 68 | ||
68 | /* Statics */ | 69 | /* Statics */ |
69 | static Boolean select_rpq_terms(void); | 70 | static Boolean select_rpq_terms(void); |
@@ -121,8 +122,7 @@ static char *x3270rpq; | @@ -121,8 +122,7 @@ static char *x3270rpq; | ||
121 | /* | 122 | /* |
122 | * RPQNAMES query reply. | 123 | * RPQNAMES query reply. |
123 | */ | 124 | */ |
124 | -void | ||
125 | -do_qr_rpqnames(void) | 125 | +void do_qr_rpqnames(void) |
126 | { | 126 | { |
127 | #define TERM_PREFIX_SIZE 2 /* Each term has 1 byte length and 1 | 127 | #define TERM_PREFIX_SIZE 2 /* Each term has 1 byte length and 1 |
128 | byte id */ | 128 | byte id */ |
src/lib3270/sf.c
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | #include "kybdc.h" | 56 | #include "kybdc.h" |
57 | #include "screenc.h" | 57 | #include "screenc.h" |
58 | #include "seec.h" | 58 | #include "seec.h" |
59 | -#include "sfc.h" | 59 | +#include "sf.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" |
@@ -92,13 +92,13 @@ static void query_reply_start(void); | @@ -92,13 +92,13 @@ static void query_reply_start(void); | ||
92 | static void do_query_reply(unsigned char code); | 92 | static void do_query_reply(unsigned char code); |
93 | static void query_reply_end(void); | 93 | static void query_reply_end(void); |
94 | 94 | ||
95 | -typedef void qr_single_fn_t(void); | ||
96 | typedef Boolean qr_multi_fn_t(unsigned *subindex, Boolean *more); | 95 | typedef Boolean qr_multi_fn_t(unsigned *subindex, Boolean *more); |
97 | 96 | ||
98 | static qr_single_fn_t do_qr_summary, do_qr_usable_area, do_qr_alpha_part, | 97 | static qr_single_fn_t do_qr_summary, do_qr_usable_area, do_qr_alpha_part, |
99 | do_qr_charsets, do_qr_color, do_qr_highlighting, do_qr_reply_modes, | 98 | do_qr_charsets, do_qr_color, do_qr_highlighting, do_qr_reply_modes, |
100 | do_qr_imp_part, do_qr_null; | 99 | do_qr_imp_part, do_qr_null; |
101 | -extern qr_single_fn_t do_qr_rpqnames; | 100 | + |
101 | + | ||
102 | #if defined(X3270_DBCS) /*[*/ | 102 | #if defined(X3270_DBCS) /*[*/ |
103 | static qr_single_fn_t do_qr_dbcs_asia; | 103 | static qr_single_fn_t do_qr_dbcs_asia; |
104 | #endif /*]*/ | 104 | #endif /*]*/ |
@@ -121,10 +121,15 @@ static struct reply { | @@ -121,10 +121,15 @@ static struct reply { | ||
121 | #if defined(X3270_DBCS) /*[*/ | 121 | #if defined(X3270_DBCS) /*[*/ |
122 | { QR_DBCS_ASIA, do_qr_dbcs_asia, NULL }, /* 0x91 */ | 122 | { QR_DBCS_ASIA, do_qr_dbcs_asia, NULL }, /* 0x91 */ |
123 | #endif /*]*/ | 123 | #endif /*]*/ |
124 | + | ||
124 | #if defined(X3270_FT) /*[*/ | 125 | #if defined(X3270_FT) /*[*/ |
125 | { QR_DDM, do_qr_ddm, NULL }, /* 0x95 */ | 126 | { QR_DDM, do_qr_ddm, NULL }, /* 0x95 */ |
126 | #endif /*]*/ | 127 | #endif /*]*/ |
128 | + | ||
129 | +#ifndef ANDROID | ||
127 | { QR_RPQNAMES, do_qr_rpqnames, NULL }, /* 0xa1 */ | 130 | { QR_RPQNAMES, do_qr_rpqnames, NULL }, /* 0xa1 */ |
131 | +#endif // !ANDROID | ||
132 | + | ||
128 | { QR_IMP_PART, do_qr_imp_part, NULL }, /* 0xa6 */ | 133 | { QR_IMP_PART, do_qr_imp_part, NULL }, /* 0xa6 */ |
129 | 134 | ||
130 | /* QR_NULL must be last in the table */ | 135 | /* QR_NULL must be last in the table */ |
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +/* | ||
2 | + * Copyright 1995, 1999, 2000 by Paul Mattes. | ||
3 | + * Permission to use, copy, modify, and distribute this software and its | ||
4 | + * documentation for any purpose and without fee is hereby granted, | ||
5 | + * provided that the above copyright notice appear in all copies and that | ||
6 | + * both that copyright notice and this permission notice appear in | ||
7 | + * supporting documentation. | ||
8 | + * | ||
9 | + * x3270, c3270, s3270, tcl3270 and pr3287 are distributed in the hope that | ||
10 | + * they will be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
11 | + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | + * file LICENSE for more details. | ||
13 | + */ | ||
14 | + | ||
15 | +typedef void qr_single_fn_t(void); | ||
16 | + | ||
17 | +LIB3270_INTERNAL qr_single_fn_t do_qr_rpqnames; | ||
18 | + | ||
19 | +LIB3270_INTERNAL enum pds write_structured_field(unsigned char buf[], int buflen); |
src/lib3270/sfc.h
@@ -1,20 +0,0 @@ | @@ -1,20 +0,0 @@ | ||
1 | -/* | ||
2 | - * Copyright 1995, 1999, 2000 by Paul Mattes. | ||
3 | - * Permission to use, copy, modify, and distribute this software and its | ||
4 | - * documentation for any purpose and without fee is hereby granted, | ||
5 | - * provided that the above copyright notice appear in all copies and that | ||
6 | - * both that copyright notice and this permission notice appear in | ||
7 | - * supporting documentation. | ||
8 | - * | ||
9 | - * x3270, c3270, s3270, tcl3270 and pr3287 are distributed in the hope that | ||
10 | - * they will be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
11 | - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | - * file LICENSE for more details. | ||
13 | - */ | ||
14 | - | ||
15 | -/* | ||
16 | - * sfc.h | ||
17 | - * Global declarations for sf.c. | ||
18 | - */ | ||
19 | - | ||
20 | -LIB3270_INTERNAL enum pds write_structured_field(unsigned char buf[], int buflen); |
src/lib3270/util.c
@@ -1087,3 +1087,100 @@ StringToKeysym(char *s) | @@ -1087,3 +1087,100 @@ StringToKeysym(char *s) | ||
1087 | } | 1087 | } |
1088 | #endif | 1088 | #endif |
1089 | */ | 1089 | */ |
1090 | + | ||
1091 | +LIB3270_EXPORT void lib3270_free(void *p) | ||
1092 | +{ | ||
1093 | + if(p) | ||
1094 | + free(p); | ||
1095 | +} | ||
1096 | + | ||
1097 | +LIB3270_EXPORT void * lib3270_realloc(void *p, int len) | ||
1098 | +{ | ||
1099 | + p = realloc(p, len); | ||
1100 | + if(!p) | ||
1101 | + Error(NULL,"Out of memory"); | ||
1102 | + return p; | ||
1103 | +} | ||
1104 | + | ||
1105 | +LIB3270_EXPORT void * lib3270_calloc(int elsize, int nelem, void *ptr) | ||
1106 | +{ | ||
1107 | + size_t sz = nelem * elsize; | ||
1108 | + | ||
1109 | + if(ptr) | ||
1110 | + ptr = realloc(ptr,sz); | ||
1111 | + else | ||
1112 | + ptr = malloc(sz); | ||
1113 | + | ||
1114 | + if(ptr) | ||
1115 | + memset(ptr,0,sz); | ||
1116 | + else | ||
1117 | + Error(NULL,"Out of memory"); | ||
1118 | + | ||
1119 | + return ptr; | ||
1120 | +} | ||
1121 | + | ||
1122 | + | ||
1123 | +LIB3270_EXPORT void * lib3270_malloc(int len) | ||
1124 | +{ | ||
1125 | + char *r; | ||
1126 | + | ||
1127 | + r = malloc(len); | ||
1128 | + if (r == (char *)NULL) | ||
1129 | + { | ||
1130 | + Error(NULL,"Out of memory"); | ||
1131 | + return 0; | ||
1132 | + } | ||
1133 | + | ||
1134 | + memset(r,0,len); | ||
1135 | + return r; | ||
1136 | +} | ||
1137 | + | ||
1138 | +/* | ||
1139 | +void * Calloc(size_t nelem, size_t elsize) | ||
1140 | +{ | ||
1141 | + int sz = nelem * elsize; | ||
1142 | + char * r = malloc(sz); | ||
1143 | + | ||
1144 | + if(!r) | ||
1145 | + Error(NULL,"Out of memory"); | ||
1146 | + | ||
1147 | + memset(r, 0, sz); | ||
1148 | + return r; | ||
1149 | +} | ||
1150 | +*/ | ||
1151 | + | ||
1152 | +LIB3270_EXPORT char * lib3270_get_resource_string(const char *first_element, ...) | ||
1153 | +{ | ||
1154 | +#ifndef ANDROID | ||
1155 | + | ||
1156 | + #warning Work in progress | ||
1157 | + | ||
1158 | + char buffer[4096]; | ||
1159 | + char * ptr = buffer; | ||
1160 | + const char * element; | ||
1161 | + va_list args; | ||
1162 | + const char * res; | ||
1163 | + | ||
1164 | + va_start(args, first_element); | ||
1165 | + | ||
1166 | + for(element = first_element;element;element = va_arg(args, const char *)) | ||
1167 | + { | ||
1168 | + if(ptr != buffer) | ||
1169 | + *(ptr++) = '.'; | ||
1170 | + | ||
1171 | + strncpy(ptr,element,4096-strlen(buffer)); | ||
1172 | + ptr += strlen(ptr); | ||
1173 | + } | ||
1174 | + | ||
1175 | + va_end(args); | ||
1176 | + | ||
1177 | + *ptr = 0; | ||
1178 | + | ||
1179 | + trace("%s: %s",__FUNCTION__,buffer); | ||
1180 | + | ||
1181 | + res = get_resource(buffer); | ||
1182 | + if(res) | ||
1183 | + return strdup(res); | ||
1184 | +#endif | ||
1185 | + return NULL; | ||
1186 | +} |