Commit 7c93434696257f2146c9b9970fb88ed390b5bc33
1 parent
c940ddaa
Exists in
master
and in
3 other branches
- Incluindo método para que a GUI possa avaliar o certificado
apresentado pelo host. - Removendo warnings.
Showing
18 changed files
with
77 additions
and
49 deletions
Show diff stats
lib3270.cbp
| ... | ... | @@ -64,6 +64,7 @@ |
| 64 | 64 | <Unit filename="src/include/icmdc.h" /> |
| 65 | 65 | <Unit filename="src/include/keypadc.h" /> |
| 66 | 66 | <Unit filename="src/include/kybdc.h" /> |
| 67 | + <Unit filename="src/include/lib3270.h" /> | |
| 67 | 68 | <Unit filename="src/include/lib3270/X11keysym.h" /> |
| 68 | 69 | <Unit filename="src/include/lib3270/action_table.h" /> |
| 69 | 70 | <Unit filename="src/include/lib3270/actions.h" /> |
| ... | ... | @@ -82,7 +83,6 @@ |
| 82 | 83 | <Unit filename="src/include/popupsc.h" /> |
| 83 | 84 | <Unit filename="src/include/printc.h" /> |
| 84 | 85 | <Unit filename="src/include/printerc.h" /> |
| 85 | - <Unit filename="src/include/private.h" /> | |
| 86 | 86 | <Unit filename="src/include/proxyc.h" /> |
| 87 | 87 | <Unit filename="src/include/resolverc.h" /> |
| 88 | 88 | <Unit filename="src/include/resources.h" /> |
| ... | ... | @@ -170,6 +170,7 @@ |
| 170 | 170 | <Unit filename="src/lib3270/printer.c"> |
| 171 | 171 | <Option compilerVar="CC" /> |
| 172 | 172 | </Unit> |
| 173 | + <Unit filename="src/lib3270/private.h" /> | |
| 173 | 174 | <Unit filename="src/lib3270/resolver.c"> |
| 174 | 175 | <Option compilerVar="CC" /> |
| 175 | 176 | </Unit> |
| ... | ... | @@ -216,6 +217,9 @@ |
| 216 | 217 | <Option compilerVar="CC" /> |
| 217 | 218 | </Unit> |
| 218 | 219 | <Unit filename="src/lib3270/windows/resources.rc.in" /> |
| 220 | + <Unit filename="src/testprogram/testprogram.c"> | |
| 221 | + <Option compilerVar="CC" /> | |
| 222 | + </Unit> | |
| 219 | 223 | <Extensions> |
| 220 | 224 | <code_completion /> |
| 221 | 225 | <envvars /> | ... | ... |
src/include/kybdc.h
| ... | ... | @@ -73,7 +73,7 @@ |
| 73 | 73 | LIB3270_INTERNAL int run_ta(H3270 *hSession); |
| 74 | 74 | // LIB3270_INTERNAL int state_from_keymap(char keymap[32]); |
| 75 | 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 | 79 | #endif /* KYBDC_H_INCLUDED */ | ... | ... |
src/include/lib3270.h
| ... | ... | @@ -41,10 +41,23 @@ |
| 41 | 41 | |
| 42 | 42 | #if defined(__GNUC__) |
| 43 | 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 | 54 | #else |
| 45 | - #define LIB3270_GNUC_FORMAT(s, f) | |
| 55 | + | |
| 56 | + #define LIB3270_DEPRECATED(func) func | |
| 57 | + | |
| 46 | 58 | #endif |
| 47 | 59 | |
| 60 | + | |
| 48 | 61 | /** |
| 49 | 62 | * BIND definitions. |
| 50 | 63 | */ |
| ... | ... | @@ -745,7 +758,7 @@ |
| 745 | 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 | 764 | * Register time handlers. |
| ... | ... | @@ -754,9 +767,9 @@ |
| 754 | 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 | 775 | * Get program message. | ... | ... |
src/include/lib3270/session.h
| ... | ... | @@ -39,6 +39,10 @@ |
| 39 | 39 | #include <sys/socket.h> |
| 40 | 40 | #endif // WIN32 |
| 41 | 41 | |
| 42 | +#ifdef HAVE_LIBSSL | |
| 43 | + #include <openssl/ssl.h> | |
| 44 | +#endif // HAVE_LIBSSL | |
| 45 | + | |
| 42 | 46 | #include <lib3270/popup.h> |
| 43 | 47 | |
| 44 | 48 | struct lib3270_session_callbacks |
| ... | ... | @@ -74,6 +78,12 @@ |
| 74 | 78 | |
| 75 | 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 | 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 | 99 | LIB3270_EXPORT int lib3270_getpeername(H3270 *hSession, struct sockaddr *addr, socklen_t *addrlen); |
| 90 | 100 | LIB3270_EXPORT int lib3270_getsockname(H3270 *hSession, struct sockaddr *addr, socklen_t *addrlen); | ... | ... |
src/include/popupsc.h
| ... | ... | @@ -33,9 +33,9 @@ |
| 33 | 33 | |
| 34 | 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 | 40 | LOCAL_EXTERN void Error(H3270 *session, const char *fmt, ...); |
| 41 | 41 | LOCAL_EXTERN void Warning(H3270 *session, const char *fmt, ...); | ... | ... |
src/include/trace_dsc.h
| ... | ... | @@ -40,9 +40,9 @@ |
| 40 | 40 | |
| 41 | 41 | void trace_ansi_disc(H3270 *hSession); |
| 42 | 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 | 46 | void trace_screen(H3270 *session); |
| 47 | 47 | |
| 48 | 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 | 23 | // LIB3270_INTERNAL char *do_subst(const char *s, Boolean do_vars, Boolean do_tilde); |
| 24 | 24 | // LIB3270_INTERNAL void fcatv(FILE *f, char *s); |
| 25 | 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 | 27 | LIB3270_INTERNAL const char *get_resource(H3270 *hSession, const char *name); |
| 28 | 28 | // LIB3270_INTERNAL char *scatv(const char *s, char *buf, size_t len); |
| 29 | 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 | 32 | LIB3270_INTERNAL int split_lresource(char **st, char **value); |
| 33 | 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 | 39 | LIB3270_INTERNAL void * AddInput(int, H3270 *session, void (*fn)(H3270 *session)); |
| 40 | 40 | LIB3270_INTERNAL void * AddOutput(int, H3270 *session, void (*fn)(H3270 *session)); |
| ... | ... | @@ -57,5 +57,5 @@ typedef struct { |
| 57 | 57 | |
| 58 | 58 | LIB3270_INTERNAL void rpf_init(rpf_t *r); |
| 59 | 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 | 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 | 492 | static void ansi_scroll(H3270 *hSession); |
| 493 | 493 | |
| 494 | 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 | 497 | return DATA; |
| 498 | 498 | } |
| ... | ... | @@ -560,7 +560,7 @@ ansi_cursor_up(H3270 *hSession, int nn, int ig2 unused) |
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 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 | 565 | register int i; |
| 566 | 566 | |
| ... | ... | @@ -1009,13 +1009,13 @@ ansi_htab(H3270 *hSession, int ig1 unused, int ig2 unused) |
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | 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 | 1014 | return ESC; |
| 1015 | 1015 | } |
| 1016 | 1016 | |
| 1017 | 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 | 1020 | return DATA; |
| 1021 | 1021 | } |
| ... | ... | @@ -1363,7 +1363,7 @@ ansi_reset_mode(H3270 *hSession, int nn, int ig2 unused) |
| 1363 | 1363 | static enum lib3270_ansi_state |
| 1364 | 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 | 1368 | switch (nn) |
| 1369 | 1369 | { |
| ... | ... | @@ -1372,7 +1372,7 @@ ansi_status_report(H3270 *hSession, int nn, int ig2 unused) |
| 1372 | 1372 | break; |
| 1373 | 1373 | |
| 1374 | 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 | 1376 | net_sends(hSession,cpr); |
| 1377 | 1377 | break; |
| 1378 | 1378 | } |
| ... | ... | @@ -1436,7 +1436,7 @@ ansi_one_g3(H3270 *hSession, int ig1 unused, int ig2 unused) |
| 1436 | 1436 | } |
| 1437 | 1437 | |
| 1438 | 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 | 1441 | return DECP; |
| 1442 | 1442 | } |
| ... | ... | @@ -1598,7 +1598,7 @@ dec_scrolling_region(H3270 *hSession, int top, int bottom) |
| 1598 | 1598 | } |
| 1599 | 1599 | |
| 1600 | 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 | 1603 | nx = 0; |
| 1604 | 1604 | n[0] = 0; |
| ... | ... | @@ -1606,7 +1606,7 @@ xterm_text_mode(H3270 *hSession, int ig1 unused, int ig2 unused) |
| 1606 | 1606 | } |
| 1607 | 1607 | |
| 1608 | 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 | 1611 | tx = 0; |
| 1612 | 1612 | return LIB3270_ANSI_STATE_TEXT2; |
| ... | ... | @@ -1621,7 +1621,7 @@ xterm_text(H3270 *hSession, int ig1 unused, int ig2 unused) |
| 1621 | 1621 | } |
| 1622 | 1622 | |
| 1623 | 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 | 1627 | #if defined(X3270_DISPLAY) || defined(WC3270) |
| ... | ... | @@ -1720,7 +1720,7 @@ static void ansi_scroll(H3270 *hSession) |
| 1720 | 1720 | } |
| 1721 | 1721 | |
| 1722 | 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 | 1725 | if (!in3270) |
| 1726 | 1726 | (void) ansi_reset(session, 0, 0); |
| ... | ... | @@ -1840,7 +1840,7 @@ ansi_send_pf(H3270 *hSession, int nn) |
| 1840 | 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 | 1844 | return; |
| 1845 | 1845 | (void) sprintf(fn_buf, "\033[%d~", code[nn-1]); |
| 1846 | 1846 | net_sends(hSession,fn_buf); | ... | ... |
src/lib3270/ctlr.c
| ... | ... | @@ -394,7 +394,7 @@ static void update_formatted(H3270 *hSession) |
| 394 | 394 | /* |
| 395 | 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 | 399 | ticking_start(hSession,True); |
| 400 | 400 | } |
| ... | ... | @@ -402,7 +402,7 @@ static void ctlr_half_connect(H3270 *hSession, int ignored unused, void *dunno) |
| 402 | 402 | /* |
| 403 | 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 | 407 | ticking_stop(hSession); |
| 408 | 408 | status_untiming(hSession); | ... | ... |
src/lib3270/ft.c
| ... | ... | @@ -59,7 +59,7 @@ |
| 59 | 59 | #include "trace_dsc.h" |
| 60 | 60 | |
| 61 | 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 | 64 | /* Macros. */ |
| 65 | 65 | #define eos(s) strchr((s), '\0') | ... | ... |
src/lib3270/ft_cut.c
| ... | ... | @@ -117,7 +117,7 @@ static void cut_retransmit(H3270 *hSession); |
| 117 | 117 | static void cut_data(H3270 *hSession); |
| 118 | 118 | |
| 119 | 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 | 122 | static unsigned from6(unsigned char c); |
| 123 | 123 | static int xlate_getc(H3270FT *ft); | ... | ... |
src/lib3270/private.h
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | * Copyright (C) <2008> <Banco do Brasil S.A.> |
| 7 | 7 | * |
| 8 | 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 | 10 | * Free Software Foundation. |
| 11 | 11 | * |
| 12 | 12 | * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER |
| ... | ... | @@ -87,14 +87,12 @@ |
| 87 | 87 | */ |
| 88 | 88 | |
| 89 | 89 | /* 'unused' explicitly flags an unused parameter */ |
| 90 | -#if defined(__GNUC__) /*[*/ | |
| 90 | +#if defined(__GNUC__) | |
| 91 | 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 | 72 | #if !defined(_WIN32) /*[*/ |
| 73 | 73 | static int get_rpq_address(H3270 *hSession, unsigned char buf[], const int buflen); |
| 74 | 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 | 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 | 132 | { |
| 133 | 133 | case X509_V_OK: |
| 134 | 134 | peer = SSL_get_peer_certificate(hSession->ssl_con); |
| 135 | +/* | |
| 135 | 136 | #if defined(SSL_ENABLE_CRL_CHECK) |
| 136 | 137 | trace_dsn(hSession,"TLS/SSL negotiated connection complete with CRL validation. Peer certificate %s presented.\n", peer ? "was" : "was not"); |
| 137 | 138 | #else |
| 138 | 139 | trace_dsn(hSession,"TLS/SSL negotiated connection complete without CRL validation. Peer certificate %s presented.\n", peer ? "was" : "was not"); |
| 139 | 140 | #endif // SSL_ENABLE_CRL_CHECK |
| 141 | +*/ | |
| 140 | 142 | break; |
| 141 | 143 | |
| 142 | 144 | case X509_V_ERR_UNABLE_TO_GET_CRL: |
| ... | ... | @@ -207,10 +209,11 @@ int ssl_negotiate(H3270 *hSession) |
| 207 | 209 | |
| 208 | 210 | free(text); |
| 209 | 211 | BIO_free(out); |
| 210 | - X509_free(peer); | |
| 211 | 212 | |
| 212 | 213 | } |
| 213 | 214 | |
| 215 | + hSession->cbk.set_peer_certificate(peer); | |
| 216 | + | |
| 214 | 217 | set_ssl_state(hSession,LIB3270_SSL_SECURE); |
| 215 | 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 | 301 | /* |
| 302 | 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 | 310 | if(session->sock > 0) |
| 311 | 311 | { | ... | ... |
src/lib3270/utf8.c
| ... | ... | @@ -351,7 +351,7 @@ static char *utf8_tab[U_MAX][96] = { |
| 351 | 351 | * character set. |
| 352 | 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 | 356 | if (fail != NULL) |
| 357 | 357 | *fail = ULFAIL_NOUTF8; | ... | ... |
src/lib3270/util.c
| ... | ... | @@ -1034,7 +1034,7 @@ int gettimeofday(struct timeval *tv, void *ignored) |
| 1034 | 1034 | { 0x83, LIB3270_POINTER_SELECTION_TOP_LEFT } |
| 1035 | 1035 | }; |
| 1036 | 1036 | |
| 1037 | - int f; | |
| 1037 | + size_t f; | |
| 1038 | 1038 | unsigned short id = lib3270_get_selection_flags(hSession,baddr) & 0x8f; |
| 1039 | 1039 | |
| 1040 | 1040 | if(!lib3270_connected(hSession) || baddr < 0) | ... | ... |