Commit 75274f99726dd080a47783e1ba4ea542f22a3caa

Authored by Perry Werneck
1 parent 5ce7ca42

Fixing windows warning

Fixing multi-session issue
src/include/seec.h
... ... @@ -23,7 +23,7 @@
23 23 LIB3270_INTERNAL const char *see_aid(unsigned char code);
24 24 LIB3270_INTERNAL const char *see_attr(unsigned char fa);
25 25 LIB3270_INTERNAL const char *see_color(unsigned char setting);
26   -LIB3270_INTERNAL const char *see_ebc(unsigned char ch);
  26 +LIB3270_INTERNAL const char *see_ebc(H3270 *hSession, unsigned char ch);
27 27 LIB3270_INTERNAL const char *see_efa(unsigned char efa, unsigned char value);
28 28 LIB3270_INTERNAL const char *see_efa_only(unsigned char efa);
29 29 LIB3270_INTERNAL const char *see_qcode(unsigned char id);
... ...
src/lib3270/ctlr.c
... ... @@ -945,7 +945,7 @@ void ctlr_read_modified(H3270 *hSession, unsigned char aid_byte, Boolean all)
945 945 if (!any)
946 946 trace_ds(hSession," '");
947 947  
948   - trace_ds(hSession,"%s",see_ebc(hSession->ea_buf[baddr].cc));
  948 + trace_ds(hSession,"%s",see_ebc(hSession, hSession->ea_buf[baddr].cc));
949 949 any = True;
950 950 }
951 951 INC_BA(baddr);
... ... @@ -994,7 +994,7 @@ void ctlr_read_modified(H3270 *hSession, unsigned char aid_byte, Boolean all)
994 994 *hSession->obptr++ = hSession->ea_buf[baddr].cc;
995 995 if (!any)
996 996 trace_ds(hSession,"%s","'");
997   - trace_ds(hSession,"%s",see_ebc(hSession->ea_buf[baddr].cc));
  997 + trace_ds(hSession,"%s",see_ebc(hSession, hSession->ea_buf[baddr].cc));
998 998 any = True;
999 999 nbytes++;
1000 1000 }
... ... @@ -1125,12 +1125,12 @@ void ctlr_read_buffer(H3270 *hSession, unsigned char aid_byte)
1125 1125 if (any)
1126 1126 trace_ds(hSession,"'");
1127 1127  
1128   - trace_ds(hSession," %s", see_ebc(hSession->ea_buf[baddr].cc));
  1128 + trace_ds(hSession," %s", see_ebc(hSession, hSession->ea_buf[baddr].cc));
1129 1129 any = False;
1130 1130 } else {
1131 1131 if (!any)
1132 1132 trace_ds(hSession," '");
1133   - trace_ds(hSession,"%s", see_ebc(hSession->ea_buf[baddr].cc));
  1133 + trace_ds(hSession,"%s", see_ebc(hSession, hSession->ea_buf[baddr].cc));
1134 1134 any = True;
1135 1135 }
1136 1136 }
... ... @@ -1484,7 +1484,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er
1484 1484 if (add_c1)
1485 1485 trace_ds(hSession,"'");
1486 1486  
1487   - trace_ds(hSession,"%s", see_ebc(add_c1));
  1487 + trace_ds(hSession,"%s", see_ebc(hSession, add_c1));
1488 1488 if (add_c1)
1489 1489 trace_ds(hSession,"'");
1490 1490  
... ... @@ -1573,7 +1573,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er
1573 1573 previous = ORDER;
1574 1574 if (*cp)
1575 1575 trace_ds(hSession,"'");
1576   - trace_ds(hSession,"%s", see_ebc(*cp));
  1576 + trace_ds(hSession,"%s", see_ebc(hSession, *cp));
1577 1577 if (*cp)
1578 1578 trace_ds(hSession,"'");
1579 1579  
... ... @@ -1788,7 +1788,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er
1788 1788 case FCORDER_NL:
1789 1789 case FCORDER_EM:
1790 1790 case FCORDER_EO:
1791   - END_TEXT(see_ebc(*cp));
  1791 + END_TEXT(see_ebc(hSession, *cp));
1792 1792 previous = ORDER;
1793 1793 d = ctlr_lookleft_state(buffer_addr, &why);
1794 1794 if (hSession->default_cs == CS_DBCS || d != DBCS_NONE) {
... ... @@ -1805,7 +1805,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er
1805 1805 break;
1806 1806 case FCORDER_SO:
1807 1807 /* Look left for errors. */
1808   - END_TEXT(see_ebc(*cp));
  1808 + END_TEXT(see_ebc(hSession, *cp));
1809 1809 d = ctlr_lookleft_state(buffer_addr, &why);
1810 1810 if (d == DBCS_RIGHT) {
1811 1811 ABORT_WRITE("SO overwriting right half of DBCS character");
... ... @@ -1829,7 +1829,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er
1829 1829 break;
1830 1830 case FCORDER_SI:
1831 1831 /* Look left for errors. */
1832   - END_TEXT(see_ebc(*cp));
  1832 + END_TEXT(see_ebc(hSession, *cp));
1833 1833 d = ctlr_lookleft_state(buffer_addr, &why);
1834 1834 if (d == DBCS_RIGHT) {
1835 1835 ABORT_WRITE("SI overwriting right half of DBCS character");
... ... @@ -1889,7 +1889,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er
1889 1889 case EBC_dup:
1890 1890 case EBC_fm:
1891 1891 /* DBCS control code */
1892   - END_TEXT(see_ebc(add_c2));
  1892 + END_TEXT(see_ebc(hSession, add_c2));
1893 1893 add_dbcs = True;
1894 1894 break;
1895 1895 case ORDER_SF:
... ... @@ -1963,7 +1963,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er
1963 1963 } else {
1964 1964 #endif /*]*/
1965 1965 add_c1 = *cp;
1966   - trace_ds(hSession,"%s", see_ebc(*cp));
  1966 + trace_ds(hSession,"%s", see_ebc(hSession, *cp));
1967 1967 #if defined(X3270_DBCS) /*[*/
1968 1968 }
1969 1969 #endif /*]*/
... ...
src/lib3270/ft_cut.c
... ... @@ -119,7 +119,7 @@ static void cut_data(H3270 *hSession);
119 119 static void cut_ack(H3270 *hSession);
120 120 static void cut_abort(H3270 *hSession, unsigned short code, const char *fmt, ...) LIB3270_GNUC_FORMAT(3,4);
121 121  
122   -static unsigned from6(unsigned char c);
  122 +static unsigned from6(H3270 *hSession, unsigned char c);
123 123 static int xlate_getc(H3270FT *ft);
124 124  
125 125 /**
... ... @@ -393,7 +393,7 @@ static void cut_data_request(H3270 *hSession)
393 393 int i;
394 394 unsigned char attr;
395 395  
396   - trace_ds(hSession,"< FT DATA_REQUEST %u\n", from6(seq));
  396 + trace_ds(hSession,"< FT DATA_REQUEST %u\n", from6(hSession, seq));
397 397 if (lib3270_get_ft_state(hSession) == FT_ABORT_WAIT)
398 398 {
399 399 cut_abort(hSession,SC_ABORT_FILE,"%s", N_("Transfer cancelled by user") );
... ... @@ -447,7 +447,7 @@ static void cut_data_request(H3270 *hSession)
447 447 ctlr_add_fa(hSession,O_DR_SF, attr, 0);
448 448  
449 449 /* Send it up to the host. */
450   - trace_ds(hSession,"> FT DATA %u\n", from6(seq));
  450 + trace_ds(hSession,"> FT DATA %u\n", from6(hSession, seq));
451 451 ft_update_length(ft);
452 452 ft->expanded_length += count;
453 453  
... ... @@ -463,14 +463,11 @@ static void cut_retransmit(H3270 *hSession)
463 463 cut_abort(hSession,SC_ABORT_XMIT,"%s",_("Transmission error"));
464 464 }
465 465  
466   -/*
467   - * Convert an encoded integer.
  466 +/**
  467 + * @brief Convert an encoded integer.
468 468 */
469   -static unsigned
470   -from6(unsigned char c)
  469 +static unsigned from6(H3270 *hSession, unsigned char c)
471 470 {
472   - H3270 *hSession = lib3270_get_default_session_handle();
473   -
474 471 char *p;
475 472  
476 473 c = hSession->charset.ebc2asc[c];
... ... @@ -499,8 +496,8 @@ static void cut_data(H3270 *hSession)
499 496 }
500 497  
501 498 /* Copy and convert the data. */
502   - raw_length = from6(hSession->ea_buf[O_DT_LEN].cc) << 6 |
503   - from6(hSession->ea_buf[O_DT_LEN + 1].cc);
  499 + raw_length = from6(hSession, hSession->ea_buf[O_DT_LEN].cc) << 6 |
  500 + from6(hSession, hSession->ea_buf[O_DT_LEN + 1].cc);
504 501  
505 502 if ((int)raw_length > O_RESPONSE - O_DT_DATA)
506 503 {
... ...
src/lib3270/init.c
... ... @@ -32,6 +32,11 @@
32 32 * @brief Init/Deinit lib3270 internals.
33 33 */
34 34  
  35 +#ifdef _WIN32
  36 + #include <winsock2.h>
  37 + #include <windows.h>
  38 +#endif // _WIN32
  39 +
35 40 #include <config.h>
36 41  
37 42 #ifdef HAVE_LIBCURL
... ...
src/lib3270/see.c
... ... @@ -61,10 +61,8 @@ unknown(unsigned char value)
61 61 return buf;
62 62 }
63 63  
64   -const char *
65   -see_ebc(unsigned char ch)
  64 +const char *see_ebc(H3270 *hSession, unsigned char ch)
66 65 {
67   - H3270 *hSession = lib3270_get_default_session_handle();
68 66 static char buf[8];
69 67  
70 68 switch (ch) {
... ... @@ -97,23 +95,10 @@ see_ebc(unsigned char ch)
97 95 else
98 96 (void) sprintf(buf, "\\%o", ch);
99 97  
100   -/*
101   - if (ebc2asc[ch])
102   - (void) sprintf(buf,
103   -#if !defined(PR3287)
104   - "%s", utf8_expand(ebc2asc[ch])
105   -#else
106   - "%c", ebc2asc[ch]
107   -#endif
108   - );
109   - else
110   - (void) sprintf(buf, "\\%o", ch);
111   -*/
112 98 return buf;
113 99 }
114 100  
115   -const char *
116   -see_aid(unsigned char code)
  101 +const char * see_aid(unsigned char code)
117 102 {
118 103 switch (code) {
119 104 case AID_NO:
... ... @@ -191,8 +176,7 @@ see_aid(unsigned char code)
191 176 }
192 177 }
193 178  
194   -const char *
195   -see_attr(unsigned char fa)
  179 +const char * see_attr(unsigned char fa)
196 180 {
197 181 static char buf[256];
198 182 const char *paren = "(";
... ... @@ -245,8 +229,7 @@ see_attr(unsigned char fa)
245 229 return buf;
246 230 }
247 231  
248   -static const char *
249   -see_highlight(unsigned char setting)
  232 +static const char * see_highlight(unsigned char setting)
250 233 {
251 234 switch (setting) {
252 235 case XAH_DEFAULT:
... ... @@ -266,8 +249,7 @@ see_highlight(unsigned char setting)
266 249 }
267 250 }
268 251  
269   -const char *
270   -see_color(unsigned char setting)
  252 +const char * see_color(unsigned char setting)
271 253 {
272 254 static const char *color_name[] = {
273 255 "neutralBlack",
... ... @@ -296,8 +278,7 @@ see_color(unsigned char setting)
296 278 return color_name[setting - 0xf0];
297 279 }
298 280  
299   -static const char *
300   -see_transparency(unsigned char setting)
  281 +static const char * see_transparency(unsigned char setting)
301 282 {
302 283 switch (setting) {
303 284 case XAT_DEFAULT:
... ... @@ -313,8 +294,7 @@ see_transparency(unsigned char setting)
313 294 }
314 295 }
315 296  
316   -static const char *
317   -see_validation(unsigned char setting)
  297 +static const char * see_validation(unsigned char setting)
318 298 {
319 299 static char buf[64];
320 300 const char *paren = "(";
... ... @@ -342,8 +322,7 @@ see_validation(unsigned char setting)
342 322 return buf;
343 323 }
344 324  
345   -static const char *
346   -see_outline(unsigned char setting)
  325 +static const char * see_outline(unsigned char setting)
347 326 {
348 327 static char buf[64];
349 328 const char *paren = "(";
... ... @@ -376,8 +355,7 @@ see_outline(unsigned char setting)
376 355 return buf;
377 356 }
378 357  
379   -static const char *
380   -see_input_control(unsigned char setting)
  358 +static const char * see_input_control(unsigned char setting)
381 359 {
382 360 switch (setting) {
383 361 case XAI_DISABLED:
... ... @@ -389,8 +367,7 @@ see_input_control(unsigned char setting)
389 367 }
390 368 }
391 369  
392   -const char *
393   -see_efa(unsigned char efa, unsigned char value)
  370 +const char * see_efa(unsigned char efa, unsigned char value)
394 371 {
395 372 static char buf[64];
396 373  
... ... @@ -434,8 +411,7 @@ see_efa(unsigned char efa, unsigned char value)
434 411 return buf;
435 412 }
436 413  
437   -const char *
438   -see_efa_only(unsigned char efa)
  414 +const char * see_efa_only(unsigned char efa)
439 415 {
440 416 switch (efa) {
441 417 case XA_ALL:
... ...