Commit 7c93434696257f2146c9b9970fb88ed390b5bc33

Authored by Perry Werneck
1 parent c940ddaa

- Incluindo método para que a GUI possa avaliar o certificado

apresentado pelo host.
- Removendo warnings.
@@ -64,6 +64,7 @@ @@ -64,6 +64,7 @@
64 <Unit filename="src/include/icmdc.h" /> 64 <Unit filename="src/include/icmdc.h" />
65 <Unit filename="src/include/keypadc.h" /> 65 <Unit filename="src/include/keypadc.h" />
66 <Unit filename="src/include/kybdc.h" /> 66 <Unit filename="src/include/kybdc.h" />
  67 + <Unit filename="src/include/lib3270.h" />
67 <Unit filename="src/include/lib3270/X11keysym.h" /> 68 <Unit filename="src/include/lib3270/X11keysym.h" />
68 <Unit filename="src/include/lib3270/action_table.h" /> 69 <Unit filename="src/include/lib3270/action_table.h" />
69 <Unit filename="src/include/lib3270/actions.h" /> 70 <Unit filename="src/include/lib3270/actions.h" />
@@ -82,7 +83,6 @@ @@ -82,7 +83,6 @@
82 <Unit filename="src/include/popupsc.h" /> 83 <Unit filename="src/include/popupsc.h" />
83 <Unit filename="src/include/printc.h" /> 84 <Unit filename="src/include/printc.h" />
84 <Unit filename="src/include/printerc.h" /> 85 <Unit filename="src/include/printerc.h" />
85 - <Unit filename="src/include/private.h" />  
86 <Unit filename="src/include/proxyc.h" /> 86 <Unit filename="src/include/proxyc.h" />
87 <Unit filename="src/include/resolverc.h" /> 87 <Unit filename="src/include/resolverc.h" />
88 <Unit filename="src/include/resources.h" /> 88 <Unit filename="src/include/resources.h" />
@@ -170,6 +170,7 @@ @@ -170,6 +170,7 @@
170 <Unit filename="src/lib3270/printer.c"> 170 <Unit filename="src/lib3270/printer.c">
171 <Option compilerVar="CC" /> 171 <Option compilerVar="CC" />
172 </Unit> 172 </Unit>
  173 + <Unit filename="src/lib3270/private.h" />
173 <Unit filename="src/lib3270/resolver.c"> 174 <Unit filename="src/lib3270/resolver.c">
174 <Option compilerVar="CC" /> 175 <Option compilerVar="CC" />
175 </Unit> 176 </Unit>
@@ -216,6 +217,9 @@ @@ -216,6 +217,9 @@
216 <Option compilerVar="CC" /> 217 <Option compilerVar="CC" />
217 </Unit> 218 </Unit>
218 <Unit filename="src/lib3270/windows/resources.rc.in" /> 219 <Unit filename="src/lib3270/windows/resources.rc.in" />
  220 + <Unit filename="src/testprogram/testprogram.c">
  221 + <Option compilerVar="CC" />
  222 + </Unit>
219 <Extensions> 223 <Extensions>
220 <code_completion /> 224 <code_completion />
221 <envvars /> 225 <envvars />
src/include/kybdc.h
@@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
73 LIB3270_INTERNAL int run_ta(H3270 *hSession); 73 LIB3270_INTERNAL int run_ta(H3270 *hSession);
74 // LIB3270_INTERNAL int state_from_keymap(char keymap[32]); 74 // LIB3270_INTERNAL int state_from_keymap(char keymap[32]);
75 LIB3270_INTERNAL void kybd_connect(H3270 *session, int connected, void *dunno); 75 LIB3270_INTERNAL void kybd_connect(H3270 *session, int connected, void *dunno);
76 - LIB3270_INTERNAL void kybd_in3270(H3270 *session, int in3270 unused, void *dunno); 76 + LIB3270_INTERNAL void kybd_in3270(H3270 *session, int in3270, void *dunno);
77 77
78 78
79 #endif /* KYBDC_H_INCLUDED */ 79 #endif /* KYBDC_H_INCLUDED */
src/include/lib3270.h
@@ -41,10 +41,23 @@ @@ -41,10 +41,23 @@
41 41
42 #if defined(__GNUC__) 42 #if defined(__GNUC__)
43 #define LIB3270_GNUC_FORMAT(s,f) __attribute__ ((__format__ (__printf__, s, f))) 43 #define LIB3270_GNUC_FORMAT(s,f) __attribute__ ((__format__ (__printf__, s, f)))
  44 + #define LIB3270_DEPRECATED(func) func __attribute__ ((deprecated))
  45 +
  46 + #elif defined(_WIN32)
  47 +
  48 + #define LIB3270_DEPRECATED(func) __declspec(deprecated) func
  49 +
  50 + #elif defined(__LCLINT__)
  51 +
  52 + #define LIB3270_DEPRECATED(func) func
  53 +
44 #else 54 #else
45 - #define LIB3270_GNUC_FORMAT(s, f) 55 +
  56 + #define LIB3270_DEPRECATED(func) func
  57 +
46 #endif 58 #endif
47 59
  60 +
48 /** 61 /**
49 * BIND definitions. 62 * BIND definitions.
50 */ 63 */
@@ -745,7 +758,7 @@ @@ -745,7 +758,7 @@
745 * @return 0 if ok, error code if not. 758 * @return 0 if ok, error code if not.
746 * 759 *
747 */ 760 */
748 - int LIB3270_EXPORT lib3270_register_handlers(const struct lib3270_callbacks *cbk); 761 + LIB3270_EXPORT int lib3270_register_handlers(const struct lib3270_callbacks *cbk);
749 762
750 /** 763 /**
751 * Register time handlers. 764 * Register time handlers.
@@ -754,9 +767,9 @@ @@ -754,9 +767,9 @@
754 * @param rm Callback for removing a timeout 767 * @param rm Callback for removing a timeout
755 * 768 *
756 */ 769 */
757 - void LIB3270_EXPORT lib3270_register_time_handlers(void * (*add)(H3270 *session, unsigned long interval_ms, void (*proc)(H3270 *session)), void (*rm)(H3270 *session, void *timer)); 770 + LIB3270_EXPORT void lib3270_register_time_handlers(void * (*add)(H3270 *session, unsigned long interval_ms, void (*proc)(H3270 *session)), void (*rm)(H3270 *session, void *timer));
758 771
759 - void LIB3270_EXPORT lib3270_register_fd_handlers(void * (*add)(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*proc)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata), void (*rm)(H3270 *, void *id)); 772 + LIB3270_EXPORT void lib3270_register_fd_handlers(void * (*add)(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*proc)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata), void (*rm)(H3270 *, void *id));
760 773
761 /** 774 /**
762 * Get program message. 775 * Get program message.
src/include/lib3270/session.h
@@ -39,6 +39,10 @@ @@ -39,6 +39,10 @@
39 #include <sys/socket.h> 39 #include <sys/socket.h>
40 #endif // WIN32 40 #endif // WIN32
41 41
  42 +#ifdef HAVE_LIBSSL
  43 + #include <openssl/ssl.h>
  44 +#endif // HAVE_LIBSSL
  45 +
42 #include <lib3270/popup.h> 46 #include <lib3270/popup.h>
43 47
44 struct lib3270_session_callbacks 48 struct lib3270_session_callbacks
@@ -74,6 +78,12 @@ @@ -74,6 +78,12 @@
74 78
75 void (*message)(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *text); 79 void (*message)(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *text);
76 80
  81 +#ifdef HAVE_LIBSSL
  82 + void (*set_peer_certificate)(const X509 *cert);
  83 +#else
  84 + void (*set_peer_certificate)(const void *cert);
  85 +#endif // HAVE_LIBSSL
  86 +
77 }; 87 };
78 88
79 /** 89 /**
@@ -84,7 +94,7 @@ @@ -84,7 +94,7 @@
84 * @return 0 if ok, error code if not. 94 * @return 0 if ok, error code if not.
85 * 95 *
86 */ 96 */
87 - int LIB3270_EXPORT lib3270_set_session_callbacks(const struct lib3270_callbacks *cbk); 97 + LIB3270_EXPORT int lib3270_set_session_callbacks(const struct lib3270_callbacks *cbk);
88 98
89 LIB3270_EXPORT int lib3270_getpeername(H3270 *hSession, struct sockaddr *addr, socklen_t *addrlen); 99 LIB3270_EXPORT int lib3270_getpeername(H3270 *hSession, struct sockaddr *addr, socklen_t *addrlen);
90 LIB3270_EXPORT int lib3270_getsockname(H3270 *hSession, struct sockaddr *addr, socklen_t *addrlen); 100 LIB3270_EXPORT int lib3270_getsockname(H3270 *hSession, struct sockaddr *addr, socklen_t *addrlen);
src/include/popupsc.h
@@ -33,9 +33,9 @@ @@ -33,9 +33,9 @@
33 33
34 #define popup_an_errno(hSession, errn, fmt, ...) lib3270_popup_an_errno(hSession, errn, fmt, __VA_ARGS__) 34 #define popup_an_errno(hSession, errn, fmt, ...) lib3270_popup_an_errno(hSession, errn, fmt, __VA_ARGS__)
35 35
36 - LOCAL_EXTERN void popup_an_error(H3270 *session, const char *fmt, ...) printflike(2,3);  
37 - LOCAL_EXTERN void popup_system_error(H3270 *session, const char *title, const char *message, const char *fmt, ...) printflike(4,5);  
38 - LOCAL_EXTERN void popup_a_sockerr(H3270 *session, char *fmt, ...) printflike(2,3); 36 + LOCAL_EXTERN void popup_an_error(H3270 *session, const char *fmt, ...) LIB3270_GNUC_FORMAT(2,3);
  37 + LOCAL_EXTERN void popup_system_error(H3270 *session, const char *title, const char *message, const char *fmt, ...) LIB3270_GNUC_FORMAT(4,5);
  38 + LOCAL_EXTERN void popup_a_sockerr(H3270 *session, char *fmt, ...) LIB3270_GNUC_FORMAT(2,3);
39 39
40 LOCAL_EXTERN void Error(H3270 *session, const char *fmt, ...); 40 LOCAL_EXTERN void Error(H3270 *session, const char *fmt, ...);
41 LOCAL_EXTERN void Warning(H3270 *session, const char *fmt, ...); 41 LOCAL_EXTERN void Warning(H3270 *session, const char *fmt, ...);
src/include/trace_dsc.h
@@ -40,9 +40,9 @@ @@ -40,9 +40,9 @@
40 40
41 void trace_ansi_disc(H3270 *hSession); 41 void trace_ansi_disc(H3270 *hSession);
42 void trace_char(H3270 *hSession, char c); 42 void trace_char(H3270 *hSession, char c);
43 - void trace_ds(H3270 *hSession, const char *fmt, ...) printflike(2, 3);  
44 - void trace_ds_nb(H3270 *hSession, const char *fmt, ...) printflike(2, 3);  
45 - void trace_dsn(H3270 *hSession, const char *fmt, ...) printflike(2, 3); 43 + void trace_ds(H3270 *hSession, const char *fmt, ...) LIB3270_GNUC_FORMAT(2, 3);
  44 + void trace_ds_nb(H3270 *hSession, const char *fmt, ...) LIB3270_GNUC_FORMAT(2, 3);
  45 + void trace_dsn(H3270 *hSession, const char *fmt, ...) LIB3270_GNUC_FORMAT(2, 3);
46 void trace_screen(H3270 *session); 46 void trace_screen(H3270 *session);
47 47
48 // #define trace_event(...) lib3270_trace_event(&h3270,__VA_ARGS__) 48 // #define trace_event(...) lib3270_trace_event(&h3270,__VA_ARGS__)
src/include/utilc.h
@@ -23,7 +23,7 @@ LIB3270_INTERNAL char *ctl_see(int c); @@ -23,7 +23,7 @@ LIB3270_INTERNAL char *ctl_see(int c);
23 // LIB3270_INTERNAL char *do_subst(const char *s, Boolean do_vars, Boolean do_tilde); 23 // LIB3270_INTERNAL char *do_subst(const char *s, Boolean do_vars, Boolean do_tilde);
24 // LIB3270_INTERNAL void fcatv(FILE *f, char *s); 24 // LIB3270_INTERNAL void fcatv(FILE *f, char *s);
25 LIB3270_INTERNAL const char *get_message(const char *key); 25 LIB3270_INTERNAL const char *get_message(const char *key);
26 -LIB3270_INTERNAL const char *get_fresource(H3270 *hSession, const char *fmt, ...) printflike(2, 3); 26 +LIB3270_INTERNAL const char *get_fresource(H3270 *hSession, const char *fmt, ...) LIB3270_GNUC_FORMAT(2, 3);
27 LIB3270_INTERNAL const char *get_resource(H3270 *hSession, const char *name); 27 LIB3270_INTERNAL const char *get_resource(H3270 *hSession, const char *name);
28 // LIB3270_INTERNAL char *scatv(const char *s, char *buf, size_t len); 28 // LIB3270_INTERNAL char *scatv(const char *s, char *buf, size_t len);
29 LIB3270_INTERNAL int split_dbcs_resource(const char *value, char sep, char **part1, 29 LIB3270_INTERNAL int split_dbcs_resource(const char *value, char sep, char **part1,
@@ -32,9 +32,9 @@ LIB3270_INTERNAL int split_dresource(char **st, char **left, char **right); @@ -32,9 +32,9 @@ LIB3270_INTERNAL int split_dresource(char **st, char **left, char **right);
32 LIB3270_INTERNAL int split_lresource(char **st, char **value); 32 LIB3270_INTERNAL int split_lresource(char **st, char **value);
33 LIB3270_INTERNAL char *strip_whitespace(const char *s); 33 LIB3270_INTERNAL char *strip_whitespace(const char *s);
34 34
35 -LIB3270_INTERNAL char *xs_buffer(const char *fmt, ...) printflike(1, 2);  
36 -LIB3270_INTERNAL void xs_error(const char *fmt, ...) printflike(1, 2);  
37 -LIB3270_INTERNAL void xs_warning(const char *fmt, ...) printflike(1, 2); 35 +LIB3270_INTERNAL char *xs_buffer(const char *fmt, ...) LIB3270_GNUC_FORMAT(1, 2);
  36 +LIB3270_INTERNAL void xs_error(const char *fmt, ...) LIB3270_GNUC_FORMAT(1, 2);
  37 +LIB3270_INTERNAL void xs_warning(const char *fmt, ...) LIB3270_GNUC_FORMAT(1, 2);
38 38
39 LIB3270_INTERNAL void * AddInput(int, H3270 *session, void (*fn)(H3270 *session)); 39 LIB3270_INTERNAL void * AddInput(int, H3270 *session, void (*fn)(H3270 *session));
40 LIB3270_INTERNAL void * AddOutput(int, H3270 *session, void (*fn)(H3270 *session)); 40 LIB3270_INTERNAL void * AddOutput(int, H3270 *session, void (*fn)(H3270 *session));
@@ -57,5 +57,5 @@ typedef struct { @@ -57,5 +57,5 @@ typedef struct {
57 57
58 LIB3270_INTERNAL void rpf_init(rpf_t *r); 58 LIB3270_INTERNAL void rpf_init(rpf_t *r);
59 LIB3270_INTERNAL void rpf_reset(rpf_t *r); 59 LIB3270_INTERNAL void rpf_reset(rpf_t *r);
60 -LIB3270_INTERNAL void rpf(rpf_t *r, char *fmt, ...) printflike(2, 3); 60 +LIB3270_INTERNAL void rpf(rpf_t *r, char *fmt, ...) LIB3270_GNUC_FORMAT(2, 3);
61 LIB3270_INTERNAL void rpf_free(rpf_t *r); 61 LIB3270_INTERNAL void rpf_free(rpf_t *r);
src/lib3270/ansi.c
@@ -492,7 +492,7 @@ static int dbcs_process(H3270 *hSession, int ch, unsigned char ebc[]); @@ -492,7 +492,7 @@ static int dbcs_process(H3270 *hSession, int ch, unsigned char ebc[]);
492 static void ansi_scroll(H3270 *hSession); 492 static void ansi_scroll(H3270 *hSession);
493 493
494 static enum lib3270_ansi_state 494 static enum lib3270_ansi_state
495 -ansi_data_mode(H3270 *hSession, int ig1 unused, int ig2 unused) 495 +ansi_data_mode(H3270 *hSession unused, int ig1 unused, int ig2 unused)
496 { 496 {
497 return DATA; 497 return DATA;
498 } 498 }
@@ -560,7 +560,7 @@ ansi_cursor_up(H3270 *hSession, int nn, int ig2 unused) @@ -560,7 +560,7 @@ ansi_cursor_up(H3270 *hSession, int nn, int ig2 unused)
560 } 560 }
561 561
562 static enum lib3270_ansi_state 562 static enum lib3270_ansi_state
563 -ansi_esc2(H3270 *hSession, int ig1 unused, int ig2 unused) 563 +ansi_esc2(H3270 *hSession unused, int ig1 unused, int ig2 unused)
564 { 564 {
565 register int i; 565 register int i;
566 566
@@ -1009,13 +1009,13 @@ ansi_htab(H3270 *hSession, int ig1 unused, int ig2 unused) @@ -1009,13 +1009,13 @@ ansi_htab(H3270 *hSession, int ig1 unused, int ig2 unused)
1009 } 1009 }
1010 1010
1011 static enum lib3270_ansi_state 1011 static enum lib3270_ansi_state
1012 -ansi_escape(H3270 *hSession, int ig1 unused, int ig2 unused) 1012 +ansi_escape(H3270 *hSession unused, int ig1 unused, int ig2 unused)
1013 { 1013 {
1014 return ESC; 1014 return ESC;
1015 } 1015 }
1016 1016
1017 static enum lib3270_ansi_state 1017 static enum lib3270_ansi_state
1018 -ansi_nop(H3270 *hSession, int ig1 unused, int ig2 unused) 1018 +ansi_nop(H3270 *hSession unused, int ig1 unused, int ig2 unused)
1019 { 1019 {
1020 return DATA; 1020 return DATA;
1021 } 1021 }
@@ -1363,7 +1363,7 @@ ansi_reset_mode(H3270 *hSession, int nn, int ig2 unused) @@ -1363,7 +1363,7 @@ ansi_reset_mode(H3270 *hSession, int nn, int ig2 unused)
1363 static enum lib3270_ansi_state 1363 static enum lib3270_ansi_state
1364 ansi_status_report(H3270 *hSession, int nn, int ig2 unused) 1364 ansi_status_report(H3270 *hSession, int nn, int ig2 unused)
1365 { 1365 {
1366 - static char cpr[11]; 1366 + static char cpr[22];
1367 1367
1368 switch (nn) 1368 switch (nn)
1369 { 1369 {
@@ -1372,7 +1372,7 @@ ansi_status_report(H3270 *hSession, int nn, int ig2 unused) @@ -1372,7 +1372,7 @@ ansi_status_report(H3270 *hSession, int nn, int ig2 unused)
1372 break; 1372 break;
1373 1373
1374 case 6: 1374 case 6:
1375 - (void) sprintf(cpr, ", "\033[%d;%dR",(hSession->cursor_addr/hSession->cols) + 1, (hSession->cursor_addr%hSession->cols) + 1);33[%d;%dR",(hSession->cursor_addr/hSession->cols) + 1, (hSession->cursor_addr%hSession->cols) + 1); 1375 + (void) snprintf(cpr, 22, ", "\033[%d;%dR",(hSession->cursor_addr/hSession->cols) + 1, (hSession->cursor_addr%hSession->cols) + 1);33[%d;%dR",(hSession->cursor_addr/hSession->cols) + 1, (hSession->cursor_addr%hSession->cols) + 1);
1376 net_sends(hSession,cpr); 1376 net_sends(hSession,cpr);
1377 break; 1377 break;
1378 } 1378 }
@@ -1436,7 +1436,7 @@ ansi_one_g3(H3270 *hSession, int ig1 unused, int ig2 unused) @@ -1436,7 +1436,7 @@ ansi_one_g3(H3270 *hSession, int ig1 unused, int ig2 unused)
1436 } 1436 }
1437 1437
1438 static enum lib3270_ansi_state 1438 static enum lib3270_ansi_state
1439 -ansi_esc3(H3270 *hSession, int ig1 unused, int ig2 unused) 1439 +ansi_esc3(H3270 *hSession unused, int ig1 unused, int ig2 unused)
1440 { 1440 {
1441 return DECP; 1441 return DECP;
1442 } 1442 }
@@ -1598,7 +1598,7 @@ dec_scrolling_region(H3270 *hSession, int top, int bottom) @@ -1598,7 +1598,7 @@ dec_scrolling_region(H3270 *hSession, int top, int bottom)
1598 } 1598 }
1599 1599
1600 static enum lib3270_ansi_state 1600 static enum lib3270_ansi_state
1601 -xterm_text_mode(H3270 *hSession, int ig1 unused, int ig2 unused) 1601 +xterm_text_mode(H3270 *hSession unused, int ig1 unused, int ig2 unused)
1602 { 1602 {
1603 nx = 0; 1603 nx = 0;
1604 n[0] = 0; 1604 n[0] = 0;
@@ -1606,7 +1606,7 @@ xterm_text_mode(H3270 *hSession, int ig1 unused, int ig2 unused) @@ -1606,7 +1606,7 @@ xterm_text_mode(H3270 *hSession, int ig1 unused, int ig2 unused)
1606 } 1606 }
1607 1607
1608 static enum lib3270_ansi_state 1608 static enum lib3270_ansi_state
1609 -xterm_text_semicolon(H3270 *hSession, int ig1 unused, int ig2 unused) 1609 +xterm_text_semicolon(H3270 *hSession unused, int ig1 unused, int ig2 unused)
1610 { 1610 {
1611 tx = 0; 1611 tx = 0;
1612 return LIB3270_ANSI_STATE_TEXT2; 1612 return LIB3270_ANSI_STATE_TEXT2;
@@ -1621,7 +1621,7 @@ xterm_text(H3270 *hSession, int ig1 unused, int ig2 unused) @@ -1621,7 +1621,7 @@ xterm_text(H3270 *hSession, int ig1 unused, int ig2 unused)
1621 } 1621 }
1622 1622
1623 static enum lib3270_ansi_state 1623 static enum lib3270_ansi_state
1624 -xterm_text_do(H3270 *hSession, int ig1 unused, int ig2 unused) 1624 +xterm_text_do(H3270 *hSession unused, int ig1 unused, int ig2 unused)
1625 { 1625 {
1626 /* 1626 /*
1627 #if defined(X3270_DISPLAY) || defined(WC3270) 1627 #if defined(X3270_DISPLAY) || defined(WC3270)
@@ -1720,7 +1720,7 @@ static void ansi_scroll(H3270 *hSession) @@ -1720,7 +1720,7 @@ static void ansi_scroll(H3270 *hSession)
1720 } 1720 }
1721 1721
1722 /* Callback for when we enter ANSI mode. */ 1722 /* Callback for when we enter ANSI mode. */
1723 -void ansi_in3270(H3270 *session, int in3270, void *dunno) 1723 +void ansi_in3270(H3270 *session, int in3270, void *dunno unused)
1724 { 1724 {
1725 if (!in3270) 1725 if (!in3270)
1726 (void) ansi_reset(session, 0, 0); 1726 (void) ansi_reset(session, 0, 0);
@@ -1840,7 +1840,7 @@ ansi_send_pf(H3270 *hSession, int nn) @@ -1840,7 +1840,7 @@ ansi_send_pf(H3270 *hSession, int nn)
1840 35, 36, 37, 38 1840 35, 36, 37, 38
1841 }; 1841 };
1842 1842
1843 - if (nn < 1 || nn > sizeof(code)/sizeof(code[0])) 1843 + if (nn < 1 || ((size_t) nn) > sizeof(code)/sizeof(code[0]))
1844 return; 1844 return;
1845 (void) sprintf(fn_buf, "\033[%d~", code[nn-1]); 1845 (void) sprintf(fn_buf, "\033[%d~", code[nn-1]);
1846 net_sends(hSession,fn_buf); 1846 net_sends(hSession,fn_buf);
src/lib3270/ctlr.c
@@ -394,7 +394,7 @@ static void update_formatted(H3270 *hSession) @@ -394,7 +394,7 @@ static void update_formatted(H3270 *hSession)
394 /* 394 /*
395 * Called when a host is half connected. 395 * Called when a host is half connected.
396 */ 396 */
397 -static void ctlr_half_connect(H3270 *hSession, int ignored unused, void *dunno) 397 +static void ctlr_half_connect(H3270 *hSession, int ignored unused, void *dunno unused)
398 { 398 {
399 ticking_start(hSession,True); 399 ticking_start(hSession,True);
400 } 400 }
@@ -402,7 +402,7 @@ static void ctlr_half_connect(H3270 *hSession, int ignored unused, void *dunno) @@ -402,7 +402,7 @@ static void ctlr_half_connect(H3270 *hSession, int ignored unused, void *dunno)
402 /* 402 /*
403 * Called when a host connects, disconnects, or changes ANSI/3270 modes. 403 * Called when a host connects, disconnects, or changes ANSI/3270 modes.
404 */ 404 */
405 -static void ctlr_connect(H3270 *hSession, int ignored unused, void *dunno) 405 +static void ctlr_connect(H3270 *hSession, int ignored unused, void *dunno unused)
406 { 406 {
407 ticking_stop(hSession); 407 ticking_stop(hSession);
408 status_untiming(hSession); 408 status_untiming(hSession);
src/lib3270/ft.c
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 #include "trace_dsc.h" 59 #include "trace_dsc.h"
60 60
61 static void ft_connected(H3270 *session, int ignored, void *unused); 61 static void ft_connected(H3270 *session, int ignored, void *unused);
62 -static void ft_in3270(H3270 *session, int ignored unused, void *unused); 62 +static void ft_in3270(H3270 *session, int ignored, void *unused);
63 63
64 /* Macros. */ 64 /* Macros. */
65 #define eos(s) strchr((s), '\0') 65 #define eos(s) strchr((s), '\0')
src/lib3270/ft_cut.c
@@ -117,7 +117,7 @@ static void cut_retransmit(H3270 *hSession); @@ -117,7 +117,7 @@ static void cut_retransmit(H3270 *hSession);
117 static void cut_data(H3270 *hSession); 117 static void cut_data(H3270 *hSession);
118 118
119 static void cut_ack(H3270 *hSession); 119 static void cut_ack(H3270 *hSession);
120 -static void cut_abort(H3270 *hSession, unsigned short code, const char *fmt, ...) printflike(3,4); 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(unsigned char c);
123 static int xlate_getc(H3270FT *ft); 123 static int xlate_getc(H3270FT *ft);
src/lib3270/private.h
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 * Copyright (C) <2008> <Banco do Brasil S.A.> 6 * Copyright (C) <2008> <Banco do Brasil S.A.>
7 * 7 *
8 * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob 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 9 + * os termos da GPL v.2 - Licença Pública Geral ', conforme publicado pela
10 * Free Software Foundation. 10 * Free Software Foundation.
11 * 11 *
12 * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER 12 * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
@@ -87,14 +87,12 @@ @@ -87,14 +87,12 @@
87 */ 87 */
88 88
89 /* 'unused' explicitly flags an unused parameter */ 89 /* 'unused' explicitly flags an unused parameter */
90 -#if defined(__GNUC__) /*[*/ 90 +#if defined(__GNUC__)
91 #define unused __attribute__((__unused__)) 91 #define unused __attribute__((__unused__))
92 - #define printflike(s,f) __attribute__ ((__format__ (__printf__, s, f)))  
93 -#else /*][*/  
94 - #define unused /* nothing */  
95 - #define printflike(s, f) /* nothing */  
96 -#endif /*]*/  
97 - 92 +#else
  93 + #define unused
  94 + #define printflike(s, f)
  95 +#endif
98 96
99 97
100 /* 98 /*
src/lib3270/rpq.c
@@ -72,7 +72,7 @@ static int get_rpq_user(H3270 *hSession, unsigned char buf[], const int buflen); @@ -72,7 +72,7 @@ static int get_rpq_user(H3270 *hSession, unsigned char buf[], const int buflen);
72 #if !defined(_WIN32) /*[*/ 72 #if !defined(_WIN32) /*[*/
73 static int get_rpq_address(H3270 *hSession, unsigned char buf[], const int buflen); 73 static int get_rpq_address(H3270 *hSession, unsigned char buf[], const int buflen);
74 #endif /*]*/ 74 #endif /*]*/
75 -static void rpq_warning(H3270 *hSession, const char *fmt, ...) printflike(2,3); 75 +static void rpq_warning(H3270 *hSession, const char *fmt, ...) LIB3270_GNUC_FORMAT(2,3);
76 static void rpq_dump_warnings(H3270 *hSession); 76 static void rpq_dump_warnings(H3270 *hSession);
77 77
78 78
src/lib3270/ssl.c
@@ -132,11 +132,13 @@ int ssl_negotiate(H3270 *hSession) @@ -132,11 +132,13 @@ int ssl_negotiate(H3270 *hSession)
132 { 132 {
133 case X509_V_OK: 133 case X509_V_OK:
134 peer = SSL_get_peer_certificate(hSession->ssl_con); 134 peer = SSL_get_peer_certificate(hSession->ssl_con);
  135 +/*
135 #if defined(SSL_ENABLE_CRL_CHECK) 136 #if defined(SSL_ENABLE_CRL_CHECK)
136 trace_dsn(hSession,"TLS/SSL negotiated connection complete with CRL validation. Peer certificate %s presented.\n", peer ? "was" : "was not"); 137 trace_dsn(hSession,"TLS/SSL negotiated connection complete with CRL validation. Peer certificate %s presented.\n", peer ? "was" : "was not");
137 #else 138 #else
138 trace_dsn(hSession,"TLS/SSL negotiated connection complete without CRL validation. Peer certificate %s presented.\n", peer ? "was" : "was not"); 139 trace_dsn(hSession,"TLS/SSL negotiated connection complete without CRL validation. Peer certificate %s presented.\n", peer ? "was" : "was not");
139 #endif // SSL_ENABLE_CRL_CHECK 140 #endif // SSL_ENABLE_CRL_CHECK
  141 +*/
140 break; 142 break;
141 143
142 case X509_V_ERR_UNABLE_TO_GET_CRL: 144 case X509_V_ERR_UNABLE_TO_GET_CRL:
@@ -207,10 +209,11 @@ int ssl_negotiate(H3270 *hSession) @@ -207,10 +209,11 @@ int ssl_negotiate(H3270 *hSession)
207 209
208 free(text); 210 free(text);
209 BIO_free(out); 211 BIO_free(out);
210 - X509_free(peer);  
211 212
212 } 213 }
213 214
  215 + hSession->cbk.set_peer_certificate(peer);
  216 +
214 set_ssl_state(hSession,LIB3270_SSL_SECURE); 217 set_ssl_state(hSession,LIB3270_SSL_SECURE);
215 X509_free(peer); 218 X509_free(peer);
216 } 219 }
src/lib3270/toggles.c
@@ -301,11 +301,11 @@ static void toggle_redraw(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGG @@ -301,11 +301,11 @@ static void toggle_redraw(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGG
301 /* 301 /*
302 * No-op toggle. 302 * No-op toggle.
303 */ 303 */
304 -static void toggle_nop(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE tt unused) 304 +static void toggle_nop(H3270 *session, struct lib3270_toggle *t, LIB3270_TOGGLE_TYPE LIB3270_UNUSED(tt) )
305 { 305 {
306 } 306 }
307 307
308 -static void toggle_keepalive(H3270 *session, struct lib3270_toggle *t unused, LIB3270_TOGGLE_TYPE tt unused) 308 +static void toggle_keepalive(H3270 *session, struct lib3270_toggle *t unused, LIB3270_TOGGLE_TYPE tt unused )
309 { 309 {
310 if(session->sock > 0) 310 if(session->sock > 0)
311 { 311 {
src/lib3270/utf8.c
@@ -351,7 +351,7 @@ static char *utf8_tab[U_MAX][96] = { @@ -351,7 +351,7 @@ static char *utf8_tab[U_MAX][96] = {
351 * character set. 351 * character set.
352 * Returns 0 if the lookup fails. 352 * Returns 0 if the lookup fails.
353 */ 353 */
354 -unsigned char utf8_lookup(char *mbs, enum ulfail *fail, int *consumed) 354 +unsigned char utf8_lookup(char *mbs unused, enum ulfail *fail, int *consumed unused)
355 { 355 {
356 if (fail != NULL) 356 if (fail != NULL)
357 *fail = ULFAIL_NOUTF8; 357 *fail = ULFAIL_NOUTF8;
src/lib3270/util.c
@@ -1034,7 +1034,7 @@ int gettimeofday(struct timeval *tv, void *ignored) @@ -1034,7 +1034,7 @@ int gettimeofday(struct timeval *tv, void *ignored)
1034 { 0x83, LIB3270_POINTER_SELECTION_TOP_LEFT } 1034 { 0x83, LIB3270_POINTER_SELECTION_TOP_LEFT }
1035 }; 1035 };
1036 1036
1037 - int f; 1037 + size_t f;
1038 unsigned short id = lib3270_get_selection_flags(hSession,baddr) & 0x8f; 1038 unsigned short id = lib3270_get_selection_flags(hSession,baddr) & 0x8f;
1039 1039
1040 if(!lib3270_connected(hSession) || baddr < 0) 1040 if(!lib3270_connected(hSession) || baddr < 0)
src/testprogram/testprogram.c
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 #include <stdlib.h> 4 #include <stdlib.h>
5 // #include <pthread.h> 5 // #include <pthread.h>
6 6
7 -#include "private.h" 7 +#include "../lib3270/private.h"
8 #include <lib3270/macros.h> 8 #include <lib3270/macros.h>
9 9
10 #define MAX_ARGS 10 10 #define MAX_ARGS 10