Commit 30dbf344c9763f4965a411f46a658db356e07494
1 parent
4ef00412
Exists in
master
and in
3 other branches
Cleaning up, fixing warnings.
Showing
37 changed files
with
154 additions
and
152 deletions
Show diff stats
src/include/3270ds.h
| ... | ... | @@ -138,19 +138,19 @@ |
| 138 | 138 | #define BA_TO_COL(ba) ((ba) % hSession->cols) |
| 139 | 139 | #define ROWCOL_TO_BA(r,c) (((r) * hSession->cols) + c) |
| 140 | 140 | #define INC_BA(ba) { (ba) = ((ba) + 1) % (hSession->cols * hSession->rows); } |
| 141 | -#define DEC_BA(ba) { (ba) = (ba) ? (ba - 1) : ((hSession->cols*hSession->rows) - 1); } | |
| 141 | +#define DEC_BA(ba) { (ba) = (ba) ? (ba - 1) : (((int) (hSession->cols*hSession->rows)) - 1); } | |
| 142 | 142 | |
| 143 | 143 | /** Field attributes. */ |
| 144 | -#define FA_PRINTABLE 0xc0 /**< these make the character "printable" */ | |
| 145 | -#define FA_PROTECT 0x20 /**< unprotected (0) / protected (1) */ | |
| 146 | -#define FA_NUMERIC 0x10 /**< alphanumeric (0) /numeric (1) */ | |
| 147 | -#define FA_INTENSITY 0x0c /**< display/selector pen detectable: */ | |
| 148 | -#define FA_INT_NORM_NSEL 0x00 /**< 00 normal, non-detect */ | |
| 149 | -#define FA_INT_NORM_SEL 0x04 /**< 01 normal, detectable */ | |
| 150 | -#define FA_INT_HIGH_SEL 0x08 /**< 10 intensified, detectable */ | |
| 151 | -#define FA_INT_ZERO_NSEL 0x0c /**< 11 nondisplay, non-detect */ | |
| 152 | -#define FA_RESERVED 0x02 /**< must be 0 */ | |
| 153 | -#define FA_MODIFY 0x01 /**< modified (1) */ | |
| 144 | +#define FA_PRINTABLE 0xc0 ///< @brief these make the character "printable" */ | |
| 145 | +#define FA_PROTECT 0x20 ///< @brief unprotected (0) / protected (1) */ | |
| 146 | +#define FA_NUMERIC 0x10 ///< @brief alphanumeric (0) /numeric (1) */ | |
| 147 | +#define FA_INTENSITY 0x0c ///< @brief display/selector pen detectable: */ | |
| 148 | +#define FA_INT_NORM_NSEL 0x00 ///< @brief 00 normal, non-detect */ | |
| 149 | +#define FA_INT_NORM_SEL 0x04 ///< @brief 01 normal, detectable */ | |
| 150 | +#define FA_INT_HIGH_SEL 0x08 ///< @brief 10 intensified, detectable */ | |
| 151 | +#define FA_INT_ZERO_NSEL 0x0c ///< @brief 11 nondisplay, non-detect */ | |
| 152 | +#define FA_RESERVED 0x02 ///< @brief must be 0 */ | |
| 153 | +#define FA_MODIFY 0x01 ///< @brief modified (1) */ | |
| 154 | 154 | |
| 155 | 155 | /* Bits in the field attribute that are stored. */ |
| 156 | 156 | #define FA_MASK (FA_PROTECT | FA_NUMERIC | FA_INTENSITY | FA_MODIFY) | ... | ... |
src/include/api.h
| ... | ... | @@ -29,6 +29,7 @@ |
| 29 | 29 | * |
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | +#error Deprecated | |
| 32 | 33 | |
| 33 | 34 | #ifndef LIB3270_API_INCLUDED |
| 34 | 35 | |
| ... | ... | @@ -99,36 +100,12 @@ |
| 99 | 100 | |
| 100 | 101 | #include <lib3270/log.h> |
| 101 | 102 | |
| 102 | - #define OIA_FLAG_BOXSOLID LIB3270_FLAG_BOXSOLID | |
| 103 | - #define OIA_FLAG_UNDERA LIB3270_FLAG_UNDERA | |
| 104 | - #define OIA_FLAG_TYPEAHEAD LIB3270_FLAG_TYPEAHEAD | |
| 105 | - #define OIA_FLAG_USER LIB3270_FLAG_COUNT | |
| 106 | - #define OIA_FLAG LIB3270_FLAG | |
| 107 | - | |
| 108 | -// struct lib3270_state_callback; | |
| 109 | - | |
| 110 | 103 | #include <lib3270/session.h> |
| 111 | 104 | |
| 112 | 105 | |
| 113 | 106 | /** Type of dialog boxes */ |
| 114 | 107 | #include <lib3270/popup.h> |
| 115 | 108 | |
| 116 | - #define PW3270_DIALOG_INFO LIB3270_NOTIFY_INFO | |
| 117 | - #define PW3270_DIALOG_CRITICAL LIB3270_NOTIFY_CRITICAL | |
| 118 | - #define PW3270_DIALOG LIB3270_NOTIFY | |
| 119 | - | |
| 120 | - #define GR_BLINK 0x01 | |
| 121 | - #define GR_REVERSE 0x02 | |
| 122 | - #define GR_UNDERLINE 0x04 | |
| 123 | - #define GR_INTENSIFY 0x08 | |
| 124 | - | |
| 125 | - #define CS_MASK 0x03 /**< mask for specific character sets */ | |
| 126 | - #define CS_BASE 0x00 /**< base character set (X'00') */ | |
| 127 | - #define CS_APL 0x01 /**< APL character set (X'01' or GE) */ | |
| 128 | - #define CS_LINEDRAW 0x02 /**< DEC line-drawing character set (ANSI) */ | |
| 129 | - #define CS_DBCS 0x03 /**< DBCS character set (X'F8') */ | |
| 130 | - #define CS_GE 0x04 /**< cs flag for Graphic Escape */ | |
| 131 | - | |
| 132 | 109 | /* File transfer */ |
| 133 | 110 | |
| 134 | 111 | #define FT_RECORD_FORMAT_FIXED LIB3270_FT_RECORD_FORMAT_FIXED |
| ... | ... | @@ -141,12 +118,6 @@ |
| 141 | 118 | #define FT_ALLOCATION_UNITS_AVBLOCK LIB3270_FT_ALLOCATION_UNITS_AVBLOCK |
| 142 | 119 | #define FT_ALLOCATION_UNITS_MASK LIB3270_FT_ALLOCATION_UNITS_MASK |
| 143 | 120 | |
| 144 | - #define FT_NONE LIB3270_FT_STATE_NONE | |
| 145 | - #define FT_AWAIT_ACK LIB3270_FT_STATE_AWAIT_ACK | |
| 146 | - #define FT_RUNNING LIB3270_FT_STATE_RUNNING | |
| 147 | - #define FT_ABORT_WAIT LIB3270_FT_STATE_ABORT_WAIT | |
| 148 | - #define FT_ABORT_SENT LIB3270_FT_STATE_ABORT_SENT | |
| 149 | - | |
| 150 | 121 | LOCAL_EXTERN int CancelFileTransfer(int force); |
| 151 | 122 | |
| 152 | 123 | #define PCONNECTED lib3270_pconnected(hSession) |
| ... | ... | @@ -160,21 +131,13 @@ |
| 160 | 131 | #define IN_TN3270E lib3270_in_tn3270e(hSession) |
| 161 | 132 | #define IN_E lib3270_in_e(hSession) |
| 162 | 133 | |
| 163 | - #define COLOR_ATTR_NONE 0x0000 | |
| 164 | - #define COLOR_ATTR_FIELD LIB3270_ATTR_FIELD | |
| 165 | - #define COLOR_ATTR_BLINK LIB3270_ATTR_BLINK | |
| 166 | - #define COLOR_ATTR_INTENSIFY LIB3270_ATTR_INTENSIFY | |
| 167 | - | |
| 168 | - #define CHAR_ATTR_UNCONVERTED LIB3270_ATTR_CG | |
| 169 | - | |
| 170 | - | |
| 171 | 134 | /* Set/Get screen contents */ |
| 172 | 135 | #define find_field_attribute(s,a) lib3270_field_addr(s,a) |
| 173 | 136 | #define find_field_length(s,a) find_field_length(s,a) |
| 174 | 137 | |
| 175 | - LOCAL_EXTERN unsigned char get_field_attribute(H3270 *session, int baddr); | |
| 176 | - LOCAL_EXTERN void Input_String(const unsigned char *str); | |
| 177 | - LOCAL_EXTERN void screen_size(int *rows, int *cols); | |
| 138 | + // LOCAL_EXTERN unsigned char get_field_attribute(H3270 *session, int baddr); | |
| 139 | + // LOCAL_EXTERN void Input_String(const unsigned char *str); | |
| 140 | + // LOCAL_EXTERN void screen_size(int *rows, int *cols); | |
| 178 | 141 | |
| 179 | 142 | #define lib3270_paste_string(str) lib3270_set_string(NULL,str) |
| 180 | 143 | ... | ... |
src/include/hostc.h
src/include/lib3270.h
| ... | ... | @@ -693,7 +693,7 @@ |
| 693 | 693 | * @return Negative if error or number of processed characters. |
| 694 | 694 | * |
| 695 | 695 | */ |
| 696 | - LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, const unsigned char *str); | |
| 696 | + LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, unsigned int row, unsigned int col, const unsigned char *str); | |
| 697 | 697 | |
| 698 | 698 | /** |
| 699 | 699 | * @brief Set string at defined adress. | ... | ... |
src/include/popupsc.h
| ... | ... | @@ -31,11 +31,13 @@ |
| 31 | 31 | |
| 32 | 32 | /* Popup calls */ |
| 33 | 33 | |
| 34 | + #include <lib3270.h> | |
| 35 | + | |
| 34 | 36 | #define popup_an_errno(hSession, errn, fmt, ...) lib3270_popup_an_errno(hSession, errn, fmt, __VA_ARGS__) |
| 35 | 37 | |
| 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); | |
| 38 | + LIB3270_INTERNAL void popup_an_error(H3270 *session, const char *fmt, ...) LIB3270_GNUC_FORMAT(2,3); | |
| 39 | + LIB3270_INTERNAL void popup_system_error(H3270 *session, const char *title, const char *message, const char *fmt, ...) LIB3270_GNUC_FORMAT(4,5); | |
| 40 | + LIB3270_INTERNAL void popup_a_sockerr(H3270 *session, char *fmt, ...) LIB3270_GNUC_FORMAT(2,3); | |
| 39 | 41 | |
| 40 | - LOCAL_EXTERN void Error(H3270 *session, const char *fmt, ...); | |
| 41 | - LOCAL_EXTERN void Warning(H3270 *session, const char *fmt, ...); | |
| 42 | + LIB3270_INTERNAL void Error(H3270 *session, const char *fmt, ...); | |
| 43 | + LIB3270_INTERNAL void Warning(H3270 *session, const char *fmt, ...); | ... | ... |
src/include/statusc.h
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | |
| 14 | 14 | /* c3270 verson of statusc.h */ |
| 15 | 15 | |
| 16 | -#include "api.h" | |
| 16 | +// #include "api.h" | |
| 17 | 17 | |
| 18 | 18 | LIB3270_INTERNAL void status_compose(int on, unsigned char c, enum keytype keytype); |
| 19 | 19 | LIB3270_INTERNAL void status_ctlr_done(H3270 *session); |
| ... | ... | @@ -31,8 +31,8 @@ LIB3270_INTERNAL void status_twait(H3270 *session); |
| 31 | 31 | |
| 32 | 32 | LIB3270_INTERNAL void status_changed(H3270 *session, LIB3270_MESSAGE id); |
| 33 | 33 | |
| 34 | -LIB3270_INTERNAL void set_status(H3270 *session, OIA_FLAG id, Boolean on); | |
| 34 | +LIB3270_INTERNAL void set_status(H3270 *session, LIB3270_FLAG id, Boolean on); | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | -#define status_typeahead(h,on) set_status(h,OIA_FLAG_TYPEAHEAD,on) | |
| 37 | +#define status_typeahead(h,on) set_status(h,LIB3270_FLAG_TYPEAHEAD,on) | |
| 38 | 38 | ... | ... |
src/lib3270/charset.c
| ... | ... | @@ -37,6 +37,8 @@ |
| 37 | 37 | #include "private.h" |
| 38 | 38 | #include <lib3270/X11keysym.h> |
| 39 | 39 | #include <lib3270/charset.h> |
| 40 | +#include <lib3270/log.h> | |
| 41 | +#include <lib3270/trace.h> | |
| 40 | 42 | |
| 41 | 43 | /* |
| 42 | 44 | * EBCDIC-to-Unicode translation tables. |
| ... | ... | @@ -46,18 +48,6 @@ |
| 46 | 48 | #define UT_SIZE 190 |
| 47 | 49 | #define UT_OFFSET 0x41 |
| 48 | 50 | |
| 49 | -/* | |
| 50 | -typedef struct | |
| 51 | -{ | |
| 52 | - const char * name; | |
| 53 | - const char * host_codepage; | |
| 54 | - const char * cgcsgid; | |
| 55 | - const char * display_charset; | |
| 56 | - unsigned short code[UT_SIZE]; | |
| 57 | -} charset_table; | |
| 58 | -*/ | |
| 59 | - | |
| 60 | - | |
| 61 | 51 | /*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ |
| 62 | 52 | |
| 63 | 53 | const unsigned short ebc2asc0[256] = | ... | ... |
src/lib3270/connect.c
src/lib3270/ctlr.c
| ... | ... | @@ -37,11 +37,15 @@ |
| 37 | 37 | #pragma GCC diagnostic ignored "-Wsign-compare" |
| 38 | 38 | |
| 39 | 39 | #include "private.h" |
| 40 | + | |
| 41 | +#include <lib3270.h> | |
| 42 | +#include <lib3270/trace.h> | |
| 43 | +#include <lib3270/log.h> | |
| 44 | +#include <lib3270/actions.h> | |
| 45 | + | |
| 40 | 46 | #include <errno.h> |
| 41 | 47 | #include <stdlib.h> |
| 42 | 48 | #include "3270ds.h" |
| 43 | -//#include "appres.h" | |
| 44 | -// #include "ctlr.h" | |
| 45 | 49 | #include "screen.h" |
| 46 | 50 | #include "resources.h" |
| 47 | 51 | |
| ... | ... | @@ -53,11 +57,9 @@ |
| 53 | 57 | #include "kybdc.h" |
| 54 | 58 | #include "popupsc.h" |
| 55 | 59 | #include "screenc.h" |
| 56 | -// #include "scrollc.h" | |
| 57 | 60 | #include "seec.h" |
| 58 | 61 | #include "sf.h" |
| 59 | 62 | #include "statusc.h" |
| 60 | -// #include "tablesc.h" | |
| 61 | 63 | #include "telnetc.h" |
| 62 | 64 | #include "trace_dsc.h" |
| 63 | 65 | #include "utilc.h" |
| ... | ... | @@ -464,7 +466,7 @@ LIB3270_EXPORT int lib3270_get_field_len(H3270 *hSession, int baddr) |
| 464 | 466 | if(baddr < 0) |
| 465 | 467 | baddr = hSession->cursor_addr; |
| 466 | 468 | |
| 467 | - addr = find_field_attribute(hSession,baddr); | |
| 469 | + addr = lib3270_field_addr(hSession,baddr); | |
| 468 | 470 | |
| 469 | 471 | if(addr < 0) |
| 470 | 472 | return -1; |
| ... | ... | @@ -550,7 +552,7 @@ int lib3270_field_length(H3270 *hSession, int baddr) |
| 550 | 552 | int addr; |
| 551 | 553 | int width = 0; |
| 552 | 554 | |
| 553 | - addr = find_field_attribute(hSession,baddr); | |
| 555 | + addr = lib3270_field_addr(hSession,baddr); | |
| 554 | 556 | |
| 555 | 557 | if(addr < 0) |
| 556 | 558 | return -1; |
| ... | ... | @@ -575,7 +577,7 @@ int lib3270_field_length(H3270 *hSession, int baddr) |
| 575 | 577 | */ |
| 576 | 578 | unsigned char get_field_attribute(H3270 *hSession, int baddr) |
| 577 | 579 | { |
| 578 | - return hSession->ea_buf[find_field_attribute(hSession,baddr)].fa; | |
| 580 | + return hSession->ea_buf[lib3270_field_addr(hSession,baddr)].fa; | |
| 579 | 581 | } |
| 580 | 582 | |
| 581 | 583 | /** |
| ... | ... | @@ -622,7 +624,7 @@ LIB3270_EXPORT int lib3270_get_is_protected(H3270 *hSession, int baddr) |
| 622 | 624 | if(baddr < 0) |
| 623 | 625 | baddr = hSession->cursor_addr; |
| 624 | 626 | |
| 625 | - int faddr = find_field_attribute(hSession,baddr); | |
| 627 | + int faddr = lib3270_field_addr(hSession,baddr); | |
| 626 | 628 | |
| 627 | 629 | return FA_IS_PROTECTED(hSession->ea_buf[faddr].fa) ? 1 : 0; |
| 628 | 630 | } |
| ... | ... | @@ -1827,7 +1829,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er |
| 1827 | 1829 | if (d != DBCS_NONE && why == DBCS_FIELD) { |
| 1828 | 1830 | ABORT_WRITE("SI in DBCS field"); |
| 1829 | 1831 | } |
| 1830 | - fa_addr = find_field_attribute(hSession,hSession->buffer_addr); | |
| 1832 | + fa_addr = lib3270_field_addr(hSession,hSession->buffer_addr); | |
| 1831 | 1833 | baddr = hSession->buffer_addr; |
| 1832 | 1834 | DEC_BA(baddr); |
| 1833 | 1835 | while (!aborted && |
| ... | ... | @@ -2145,7 +2147,7 @@ ctlr_lookleft_state(int baddr, enum dbcs_why *why) |
| 2145 | 2147 | return DBCS_NONE; |
| 2146 | 2148 | |
| 2147 | 2149 | /* Find the field attribute, if any. */ |
| 2148 | - faddr = find_field_attribute(baddr); | |
| 2150 | + faddr = lib3270_field_addr(baddr); | |
| 2149 | 2151 | |
| 2150 | 2152 | /* |
| 2151 | 2153 | * First in precedence is a DBCS field. |
| ... | ... | @@ -2258,7 +2260,7 @@ int ctlr_dbcs_postprocess(H3270 *hSession) |
| 2258 | 2260 | * dummy at -1. Also compute the starting and ending points for the |
| 2259 | 2261 | * scan: the first location after that field attribute. |
| 2260 | 2262 | */ |
| 2261 | - faddr0 = find_field_attribute(0); | |
| 2263 | + faddr0 = lib3270_field_addr(0); | |
| 2262 | 2264 | baddr = faddr0; |
| 2263 | 2265 | INC_BA(baddr); |
| 2264 | 2266 | if (faddr0 < 0) |
| ... | ... | @@ -2738,7 +2740,7 @@ void mdt_set(H3270 *hSession, int baddr) |
| 2738 | 2740 | { |
| 2739 | 2741 | int faddr; |
| 2740 | 2742 | |
| 2741 | - faddr = find_field_attribute(hSession,baddr); | |
| 2743 | + faddr = lib3270_field_addr(hSession,baddr); | |
| 2742 | 2744 | if (faddr >= 0 && !(hSession->ea_buf[faddr].fa & FA_MODIFY)) |
| 2743 | 2745 | { |
| 2744 | 2746 | hSession->ea_buf[faddr].fa |= FA_MODIFY; |
| ... | ... | @@ -2749,7 +2751,7 @@ void mdt_set(H3270 *hSession, int baddr) |
| 2749 | 2751 | |
| 2750 | 2752 | void mdt_clear(H3270 *hSession, int baddr) |
| 2751 | 2753 | { |
| 2752 | - int faddr = find_field_attribute(hSession,baddr); | |
| 2754 | + int faddr = lib3270_field_addr(hSession,baddr); | |
| 2753 | 2755 | |
| 2754 | 2756 | if (faddr >= 0 && (hSession->ea_buf[faddr].fa & FA_MODIFY)) |
| 2755 | 2757 | { | ... | ... |
src/lib3270/cursor.c
src/lib3270/ft.c
| ... | ... | @@ -39,6 +39,7 @@ |
| 39 | 39 | #include <config.h> |
| 40 | 40 | #include <lib3270.h> |
| 41 | 41 | #include <lib3270/filetransfer.h> |
| 42 | +#include <lib3270/log.h> | |
| 42 | 43 | #include "private.h" |
| 43 | 44 | #include <lib3270/trace.h> |
| 44 | 45 | |
| ... | ... | @@ -404,8 +405,8 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
| 404 | 405 | if(!ft) |
| 405 | 406 | return EINVAL; |
| 406 | 407 | |
| 407 | - recfm = (ft->flags & FT_RECORD_FORMAT_MASK) >> 8; | |
| 408 | - units = (ft->flags & FT_ALLOCATION_UNITS_MASK) >> 12; | |
| 408 | + recfm = (ft->flags & LIB3270_FT_RECORD_FORMAT_MASK) >> 8; | |
| 409 | + units = (ft->flags & LIB3270_FT_ALLOCATION_UNITS_MASK) >> 12; | |
| 409 | 410 | ft->ascii_flag = (ft->flags & LIB3270_FT_OPTION_ASCII) ? 1 : 0; |
| 410 | 411 | ft->cr_flag = (ft->flags & LIB3270_FT_OPTION_CRLF) ? 1 : 0; |
| 411 | 412 | ft->remap_flag = (ft->flags & LIB3270_FT_OPTION_REMAP) ? 1 : 0; |
| ... | ... | @@ -568,7 +569,7 @@ static double finish(H3270FT *ft) |
| 568 | 569 | } |
| 569 | 570 | |
| 570 | 571 | // Clean up the state. |
| 571 | - set_ft_state(ft,FT_NONE); | |
| 572 | + set_ft_state(ft,LIB3270_FT_STATE_NONE); | |
| 572 | 573 | |
| 573 | 574 | ft_update_length(ft); |
| 574 | 575 | |
| ... | ... | @@ -643,8 +644,8 @@ void ft_running(H3270FT *ft, Boolean is_cut) |
| 643 | 644 | |
| 644 | 645 | gettimeofday(&ft->starting_time, (struct timezone *)NULL); |
| 645 | 646 | |
| 646 | - if (ft->state == FT_AWAIT_ACK) | |
| 647 | - set_ft_state(ft,FT_RUNNING); | |
| 647 | + if (ft->state == LIB3270_FT_STATE_AWAIT_ACK) | |
| 648 | + set_ft_state(ft,LIB3270_FT_STATE_RUNNING); | |
| 648 | 649 | |
| 649 | 650 | ft->cbk.running(ft->host,is_cut,ft->user_data); |
| 650 | 651 | |
| ... | ... | @@ -670,9 +671,9 @@ LIB3270_EXPORT struct lib3270_ft_callbacks * lib3270_get_ft_callbacks(H3270 *ses |
| 670 | 671 | // Process a protocol-generated abort. |
| 671 | 672 | void ft_aborting(H3270FT *h, const char *reason) |
| 672 | 673 | { |
| 673 | - if (h->state == FT_RUNNING || h->state == FT_ABORT_WAIT) | |
| 674 | + if (h->state == LIB3270_FT_STATE_RUNNING || h->state == LIB3270_FT_STATE_ABORT_WAIT) | |
| 674 | 675 | { |
| 675 | - set_ft_state(h,FT_ABORT_SENT); | |
| 676 | + set_ft_state(h,LIB3270_FT_STATE_ABORT_SENT); | |
| 676 | 677 | h->cbk.message(h->host,N_("Aborting..."),h->user_data); |
| 677 | 678 | h->cbk.aborting(h->host,reason,h->user_data); |
| 678 | 679 | } | ... | ... |
src/lib3270/ft_cut.c
| ... | ... | @@ -39,17 +39,18 @@ |
| 39 | 39 | |
| 40 | 40 | #include "private.h" |
| 41 | 41 | |
| 42 | +#include <lib3270.h> | |
| 43 | +#include <lib3270/actions.h> | |
| 44 | + | |
| 42 | 45 | #if defined(X3270_FT) /*[*/ |
| 43 | 46 | |
| 44 | 47 | #include "3270ds.h" |
| 45 | -//#include "actionsc.h" | |
| 46 | 48 | #include "ctlrc.h" |
| 47 | 49 | #include "ft_cutc.h" |
| 48 | 50 | #include "ft_cut_ds.h" |
| 49 | 51 | #include "ftc.h" |
| 50 | 52 | #include "kybdc.h" |
| 51 | 53 | #include "popupsc.h" |
| 52 | -// #include "tablesc.h" | |
| 53 | 54 | #include "telnetc.h" |
| 54 | 55 | #include "trace_dsc.h" |
| 55 | 56 | #include "utilc.h" |
| ... | ... | @@ -343,7 +344,7 @@ static void cut_control_code(H3270 *hSession) |
| 343 | 344 | hSession->cut_xfer_in_progress = 0; |
| 344 | 345 | cut_ack(hSession); |
| 345 | 346 | |
| 346 | - if (lib3270_get_ft_state(hSession) == FT_ABORT_SENT && ft->saved_errmsg != CN) | |
| 347 | + if (lib3270_get_ft_state(hSession) == LIB3270_FT_STATE_ABORT_SENT && ft->saved_errmsg != CN) | |
| 347 | 348 | { |
| 348 | 349 | buf = ft->saved_errmsg; |
| 349 | 350 | ft->saved_errmsg = CN; |
| ... | ... | @@ -394,7 +395,7 @@ static void cut_data_request(H3270 *hSession) |
| 394 | 395 | unsigned char attr; |
| 395 | 396 | |
| 396 | 397 | trace_ds(hSession,"< FT DATA_REQUEST %u\n", from6(hSession, seq)); |
| 397 | - if (lib3270_get_ft_state(hSession) == FT_ABORT_WAIT) | |
| 398 | + if (lib3270_get_ft_state(hSession) == LIB3270_FT_STATE_ABORT_WAIT) | |
| 398 | 399 | { |
| 399 | 400 | cut_abort(hSession,SC_ABORT_FILE,"%s", N_("Transfer cancelled by user") ); |
| 400 | 401 | return; | ... | ... |
src/lib3270/ft_dft.c
| ... | ... | @@ -44,23 +44,18 @@ |
| 44 | 44 | |
| 45 | 45 | #if defined(X3270_FT) /*[*/ |
| 46 | 46 | |
| 47 | -//#include "appres.h" | |
| 48 | 47 | #include "3270ds.h" |
| 49 | 48 | #include "ft_dft_ds.h" |
| 50 | - | |
| 51 | -//#include "actionsc.h" | |
| 52 | 49 | #include "kybdc.h" |
| 53 | 50 | #include "ft_dftc.h" |
| 54 | 51 | #include "ftc.h" |
| 55 | -//#include "tablesc.h" | |
| 56 | 52 | #include "telnetc.h" |
| 57 | 53 | #include "trace_dsc.h" |
| 58 | 54 | #include "utilc.h" |
| 55 | +#include <lib3270/log.h> | |
| 59 | 56 | |
| 60 | 57 | #include <errno.h> |
| 61 | 58 | |
| 62 | -// extern unsigned char aid; | |
| 63 | - | |
| 64 | 59 | /* Macros. */ |
| 65 | 60 | #define OPEN_MSG "FT:MSG" /* Open request for message */ |
| 66 | 61 | #define END_TRANSFER "TRANS03" /* Message for xfer complete */ |
| ... | ... | @@ -100,7 +95,7 @@ void ft_dft_data(H3270 *hSession, unsigned char *data, int GNUC_UNUSED(length)) |
| 100 | 95 | unsigned short data_length, data_type; |
| 101 | 96 | unsigned char *cp; |
| 102 | 97 | |
| 103 | - if (lib3270_get_ft_state(hSession) == FT_NONE) | |
| 98 | + if (lib3270_get_ft_state(hSession) == LIB3270_FT_STATE_NONE) | |
| 104 | 99 | { |
| 105 | 100 | trace_ds(hSession," (no transfer in progress)\n"); |
| 106 | 101 | return; |
| ... | ... | @@ -228,7 +223,7 @@ static void dft_data_insert(H3270 *hSession, struct data_buffer *data_bufr) |
| 228 | 223 | int my_length; |
| 229 | 224 | unsigned char * cp; |
| 230 | 225 | |
| 231 | - if(!ft->message_flag && lib3270_get_ft_state(hSession) == FT_ABORT_WAIT) | |
| 226 | + if(!ft->message_flag && lib3270_get_ft_state(hSession) == LIB3270_FT_STATE_ABORT_WAIT) | |
| 232 | 227 | { |
| 233 | 228 | dft_abort(hSession,TR_DATA_INSERT, "%s", _("Transfer cancelled by user") ); |
| 234 | 229 | return; |
| ... | ... | @@ -273,7 +268,7 @@ static void dft_data_insert(H3270 *hSession, struct data_buffer *data_bufr) |
| 273 | 268 | ft_complete(hSession->ft,(const char *) msgp); |
| 274 | 269 | lib3270_free(msgp); |
| 275 | 270 | } |
| 276 | - else if (lib3270_get_ft_state(hSession) == FT_ABORT_SENT && ((H3270FT *) hSession->ft)->abort_string != CN) | |
| 271 | + else if (lib3270_get_ft_state(hSession) == LIB3270_FT_STATE_ABORT_SENT && ((H3270FT *) hSession->ft)->abort_string != CN) | |
| 277 | 272 | { |
| 278 | 273 | trace_ds(hSession,"ABORT_TRANSFER [%s]\n",msgp); |
| 279 | 274 | lib3270_free(msgp); |
| ... | ... | @@ -371,7 +366,7 @@ static void dft_get_request(H3270 *hSession) |
| 371 | 366 | |
| 372 | 367 | trace_ds(hSession," Get\n"); |
| 373 | 368 | |
| 374 | - if (!ft->message_flag && lib3270_get_ft_state(hSession) == FT_ABORT_WAIT) | |
| 369 | + if (!ft->message_flag && lib3270_get_ft_state(hSession) == LIB3270_FT_STATE_ABORT_WAIT) | |
| 375 | 370 | { |
| 376 | 371 | dft_abort(hSession,TR_GET_REQ, _( "Transfer cancelled by user" ) ); |
| 377 | 372 | return; | ... | ... |
src/lib3270/host.c
| ... | ... | @@ -54,6 +54,8 @@ |
| 54 | 54 | #include <errno.h> |
| 55 | 55 | #include <lib3270/internals.h> |
| 56 | 56 | #include <lib3270/properties.h> |
| 57 | +#include <lib3270/log.h> | |
| 58 | +#include <lib3270/trace.h> | |
| 57 | 59 | |
| 58 | 60 | /** |
| 59 | 61 | * @brief Called from timer to attempt an automatic reconnection. |
| ... | ... | @@ -152,7 +154,7 @@ void lib3270_set_disconnected(H3270 *hSession) |
| 152 | 154 | hSession->starting = 0; |
| 153 | 155 | hSession->ssl.state = LIB3270_SSL_UNDEFINED; |
| 154 | 156 | |
| 155 | - set_status(hSession,OIA_FLAG_UNDERA,False); | |
| 157 | + set_status(hSession,LIB3270_FLAG_UNDERA,False); | |
| 156 | 158 | |
| 157 | 159 | lib3270_st_changed(hSession,LIB3270_STATE_CONNECT, False); |
| 158 | 160 | ... | ... |
src/lib3270/html.c
| ... | ... | @@ -236,7 +236,7 @@ |
| 236 | 236 | |
| 237 | 237 | LIB3270_EXPORT char * lib3270_get_as_html(H3270 *session, LIB3270_HTML_OPTION option) |
| 238 | 238 | { |
| 239 | - int row, baddr; | |
| 239 | + unsigned int row, baddr; | |
| 240 | 240 | struct html_info info; |
| 241 | 241 | |
| 242 | 242 | memset(&info,0,sizeof(info)); |
| ... | ... | @@ -256,7 +256,7 @@ |
| 256 | 256 | baddr = 0; |
| 257 | 257 | for(row=0;row < session->rows;row++) |
| 258 | 258 | { |
| 259 | - int col; | |
| 259 | + unsigned int col; | |
| 260 | 260 | |
| 261 | 261 | for(col = 0; col < session->cols;col++) |
| 262 | 262 | { | ... | ... |
src/lib3270/iocalls.c
src/lib3270/kybd.c
| ... | ... | @@ -43,6 +43,7 @@ struct ta; |
| 43 | 43 | #include "private.h" |
| 44 | 44 | #include <lib3270/trace.h> |
| 45 | 45 | #include <lib3270/selection.h> |
| 46 | +#include <lib3270/log.h> | |
| 46 | 47 | |
| 47 | 48 | #ifndef ANDROID |
| 48 | 49 | #include <stdlib.h> |
| ... | ... | @@ -80,7 +81,7 @@ struct ta; |
| 80 | 81 | |
| 81 | 82 | #include <lib3270/actions.h> |
| 82 | 83 | |
| 83 | -#include "api.h" | |
| 84 | +// #include "api.h" | |
| 84 | 85 | |
| 85 | 86 | |
| 86 | 87 | //#ifdef DEBUG |
| ... | ... | @@ -739,7 +740,7 @@ static Boolean key_Character(H3270 *hSession, int code, Boolean with_ge, Boolean |
| 739 | 740 | return False; |
| 740 | 741 | } |
| 741 | 742 | baddr = hSession->cursor_addr; |
| 742 | - faddr = find_field_attribute(hSession,baddr); | |
| 743 | + faddr = lib3270_field_addr(hSession,baddr); | |
| 743 | 744 | fa = get_field_attribute(hSession,baddr); |
| 744 | 745 | |
| 745 | 746 | if (hSession->ea_buf[baddr].fa || FA_IS_PROTECTED(fa)) |
| ... | ... | @@ -1394,7 +1395,7 @@ static void do_erase(H3270 *hSession) |
| 1394 | 1395 | enum dbcs_state d; |
| 1395 | 1396 | |
| 1396 | 1397 | baddr = hSession->cursor_addr; |
| 1397 | - faddr = find_field_attribute(hSession,baddr); | |
| 1398 | + faddr = lib3270_field_addr(hSession,baddr); | |
| 1398 | 1399 | if (faddr == baddr || FA_IS_PROTECTED(hSession->ea_buf[baddr].fa)) |
| 1399 | 1400 | { |
| 1400 | 1401 | operator_error(hSession,KL_OERR_PROTECTED); |
| ... | ... | @@ -1685,7 +1686,7 @@ LIB3270_EXPORT int lib3270_newline(H3270 *hSession) |
| 1685 | 1686 | #endif /*]*/ |
| 1686 | 1687 | baddr = (hSession->cursor_addr + hSession->cols) % (hSession->cols * hSession->rows); /* down */ |
| 1687 | 1688 | baddr = (baddr / hSession->cols) * hSession->cols; /* 1st col */ |
| 1688 | - faddr = find_field_attribute(hSession,baddr); | |
| 1689 | + faddr = lib3270_field_addr(hSession,baddr); | |
| 1689 | 1690 | fa = hSession->ea_buf[faddr].fa; |
| 1690 | 1691 | if (faddr != baddr && !FA_IS_PROTECTED(fa)) |
| 1691 | 1692 | cursor_move(hSession,baddr); |
| ... | ... | @@ -2163,7 +2164,7 @@ int lib3270_get_field_end(H3270 *hSession, int baddr) |
| 2163 | 2164 | if (!hSession->formatted) |
| 2164 | 2165 | return errno = EINVAL; |
| 2165 | 2166 | |
| 2166 | - faddr = find_field_attribute(hSession,baddr); | |
| 2167 | + faddr = lib3270_field_addr(hSession,baddr); | |
| 2167 | 2168 | fa = hSession->ea_buf[faddr].fa; |
| 2168 | 2169 | if (faddr == baddr || FA_IS_PROTECTED(fa)) |
| 2169 | 2170 | return errno = EPERM; |
| ... | ... | @@ -2243,7 +2244,7 @@ static Boolean remargin(H3270 *hSession, int lmargin) |
| 2243 | 2244 | b0 = baddr; |
| 2244 | 2245 | ever = True; |
| 2245 | 2246 | } |
| 2246 | - faddr = find_field_attribute(hSession,baddr); | |
| 2247 | + faddr = lib3270_field_addr(hSession,baddr); | |
| 2247 | 2248 | fa = hSession->ea_buf[faddr].fa; |
| 2248 | 2249 | |
| 2249 | 2250 | if (faddr == baddr || FA_IS_PROTECTED(fa)) | ... | ... |
src/lib3270/linux/connect.c
src/lib3270/linux/event_dispatcher.c
| ... | ... | @@ -35,9 +35,8 @@ |
| 35 | 35 | #include "../private.h" |
| 36 | 36 | #include <sys/time.h> |
| 37 | 37 | #include <sys/types.h> |
| 38 | -// #include "../xioc.h" | |
| 39 | -// #include "telnetc.h" | |
| 40 | -// #include "utilc.h" | |
| 38 | +#include <lib3270/log.h> | |
| 39 | +#include <lib3270/trace.h> | |
| 41 | 40 | |
| 42 | 41 | #define MILLION 1000000L |
| 43 | 42 | #define TN (timeout_t *)NULL | ... | ... |
src/lib3270/log.c
src/lib3270/paste.c
| ... | ... | @@ -77,10 +77,11 @@ |
| 77 | 77 | #if defined(X3270_DBCS) /*[*/ |
| 78 | 78 | #include "widec.h" |
| 79 | 79 | #endif /*]*/ |
| 80 | -#include "api.h" | |
| 80 | +// #include "api.h" | |
| 81 | 81 | |
| 82 | 82 | #include <lib3270/popup.h> |
| 83 | 83 | #include <lib3270/selection.h> |
| 84 | +#include <lib3270/log.h> | |
| 84 | 85 | |
| 85 | 86 | /*---[ Struct ]-------------------------------------------------------------------------------------------------*/ |
| 86 | 87 | |
| ... | ... | @@ -117,7 +118,7 @@ |
| 117 | 118 | ever = True; |
| 118 | 119 | } |
| 119 | 120 | |
| 120 | - faddr = find_field_attribute(hSession,baddr); | |
| 121 | + faddr = lib3270_field_addr(hSession,baddr); | |
| 121 | 122 | fa = hSession->ea_buf[faddr].fa; |
| 122 | 123 | if (faddr == baddr || FA_IS_PROTECTED(fa)) |
| 123 | 124 | { |
| ... | ... | @@ -138,7 +139,7 @@ |
| 138 | 139 | |
| 139 | 140 | if(lib3270_get_toggle(hSession,LIB3270_TOGGLE_SMART_PASTE)) |
| 140 | 141 | { |
| 141 | - int faddr = find_field_attribute(hSession,hSession->cursor_addr); | |
| 142 | + int faddr = lib3270_field_addr(hSession,hSession->cursor_addr); | |
| 142 | 143 | if(FA_IS_PROTECTED(hSession->ea_buf[faddr].fa)) |
| 143 | 144 | hSession->cursor_addr++; |
| 144 | 145 | else |
| ... | ... | @@ -190,7 +191,7 @@ static int set_string(H3270 *hSession, const unsigned char *str) |
| 190 | 191 | |
| 191 | 192 | baddr = (hSession->cursor_addr + hSession->cols) % (hSession->cols * hSession->rows); /* down */ |
| 192 | 193 | baddr = (baddr / hSession->cols) * hSession->cols; /* 1st col */ |
| 193 | - faddr = find_field_attribute(hSession,baddr); | |
| 194 | + faddr = lib3270_field_addr(hSession,baddr); | |
| 194 | 195 | fa = hSession->ea_buf[faddr].fa; |
| 195 | 196 | if (faddr != baddr && !FA_IS_PROTECTED(fa)) |
| 196 | 197 | cursor_move(hSession,baddr); |
| ... | ... | @@ -232,7 +233,7 @@ static int set_string(H3270 *hSession, const unsigned char *str) |
| 232 | 233 | * @return -1 if error (sets errno) or number of processed characters. |
| 233 | 234 | * |
| 234 | 235 | */ |
| 235 | -LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, const unsigned char *str) | |
| 236 | +LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, unsigned int row, unsigned int col, const unsigned char *str) | |
| 236 | 237 | { |
| 237 | 238 | int rc = 0; |
| 238 | 239 | |
| ... | ... | @@ -248,7 +249,7 @@ LIB3270_EXPORT int lib3270_set_string_at(H3270 *hSession, int row, int col, cons |
| 248 | 249 | row--; |
| 249 | 250 | col--; |
| 250 | 251 | |
| 251 | - if(row >= 0 && col >= 0 && row <= hSession->rows && col <= hSession->cols) | |
| 252 | + if(row <= hSession->rows && col <= hSession->cols) | |
| 252 | 253 | { |
| 253 | 254 | hSession->cbk.suspend(hSession); |
| 254 | 255 | ... | ... |
src/lib3270/private.h
| ... | ... | @@ -36,7 +36,8 @@ |
| 36 | 36 | #include <config.h> /* autoconf settings */ |
| 37 | 37 | #include <lib3270.h> /* lib3270 API calls and defs */ |
| 38 | 38 | #include <lib3270/charset.h> |
| 39 | -#include "api.h" | |
| 39 | +#include <lib3270/session.h> | |
| 40 | +// #include "api.h" | |
| 40 | 41 | |
| 41 | 42 | #if defined(HAVE_LIBSSL) |
| 42 | 43 | #include <openssl/ssl.h> |
| ... | ... | @@ -158,12 +159,33 @@ struct toggle_name { |
| 158 | 159 | int index; |
| 159 | 160 | }; |
| 160 | 161 | |
| 162 | +/// @brief State macros | |
| 163 | +#define PCONNECTED lib3270_pconnected(hSession) | |
| 164 | +#define HALF_CONNECTED lib3270_half_connected(hSession) | |
| 165 | +#define CONNECTED lib3270_connected(hSession) | |
| 161 | 166 | |
| 162 | -/* input key type */ | |
| 167 | +#define IN_NEITHER lib3270_in_neither(hSession) | |
| 168 | +#define IN_ANSI lib3270_in_ansi(hSession) | |
| 169 | +#define IN_3270 lib3270_in_3270(hSession) | |
| 170 | +#define IN_SSCP lib3270_in_sscp(hSession) | |
| 171 | +#define IN_TN3270E lib3270_in_tn3270e(hSession) | |
| 172 | +#define IN_E lib3270_in_e(hSession) | |
| 163 | 173 | |
| 164 | -/* Naming convention for private actions. */ | |
| 174 | +/// @brief Naming convention for private actions. | |
| 165 | 175 | #define PA_PFX "PA-" |
| 166 | 176 | |
| 177 | +#define GR_BLINK 0x01 | |
| 178 | +#define GR_REVERSE 0x02 | |
| 179 | +#define GR_UNDERLINE 0x04 | |
| 180 | +#define GR_INTENSIFY 0x08 | |
| 181 | + | |
| 182 | +#define CS_MASK 0x03 ///< @brief mask for specific character sets */ | |
| 183 | +#define CS_BASE 0x00 ///< @brief base character set (X'00') */ | |
| 184 | +#define CS_APL 0x01 ///< @brief APL character set (X'01' or GE) */ | |
| 185 | +#define CS_LINEDRAW 0x02 ///< @brief DEC line-drawing character set (ANSI) */ | |
| 186 | +#define CS_DBCS 0x03 ///< @brief DBCS character set (X'F8') */ | |
| 187 | +#define CS_GE 0x04 ///< @brief cs flag for Graphic Escape */ | |
| 188 | + | |
| 167 | 189 | /// @brief Shorthand macros |
| 168 | 190 | #define CN ((char *) NULL) |
| 169 | 191 | #define PN ((XtPointer) NULL) |
| ... | ... | @@ -313,7 +335,7 @@ struct lib3270_state_callback |
| 313 | 335 | */ |
| 314 | 336 | struct _h3270 |
| 315 | 337 | { |
| 316 | - struct lib3270_session_callbacks cbk; // Callback table - Always the first one. | |
| 338 | + struct lib3270_session_callbacks cbk; ///< @brief Callback table - Always the first one. | |
| 317 | 339 | |
| 318 | 340 | // Session info |
| 319 | 341 | char id; ///< @brief Session Identifier. |
| ... | ... | @@ -746,5 +768,7 @@ LIB3270_INTERNAL int non_blocking(H3270 *session, Boolean on); |
| 746 | 768 | /// @brief Clear element at adress. |
| 747 | 769 | LIB3270_INTERNAL void clear_chr(H3270 *hSession, int baddr); |
| 748 | 770 | |
| 771 | + LIB3270_INTERNAL unsigned char get_field_attribute(H3270 *session, int baddr); | |
| 772 | + | |
| 749 | 773 | #endif |
| 750 | 774 | ... | ... |
src/lib3270/resolver.c
src/lib3270/resources.c
src/lib3270/rpq.c
| ... | ... | @@ -53,7 +53,7 @@ |
| 53 | 53 | #include <stdlib.h> |
| 54 | 54 | #endif // !ANDROID |
| 55 | 55 | |
| 56 | -#include "api.h" | |
| 56 | +// #include "api.h" | |
| 57 | 57 | |
| 58 | 58 | #include <assert.h> |
| 59 | 59 | #include <stdarg.h> |
| ... | ... | @@ -66,6 +66,8 @@ |
| 66 | 66 | #include "utilc.h" |
| 67 | 67 | #include "sf.h" |
| 68 | 68 | |
| 69 | +#include <lib3270/log.h> | |
| 70 | + | |
| 69 | 71 | /* Statics */ |
| 70 | 72 | static Boolean select_rpq_terms(H3270 *hSession); |
| 71 | 73 | static int get_rpq_timezone(H3270 *hSession); | ... | ... |
src/lib3270/screen.c
| ... | ... | @@ -50,8 +50,8 @@ |
| 50 | 50 | #include "errno.h" |
| 51 | 51 | #include "statusc.h" |
| 52 | 52 | #include "togglesc.h" |
| 53 | -#include "api.h" | |
| 54 | 53 | #include <lib3270/actions.h> |
| 54 | +#include <lib3270/log.h> | |
| 55 | 55 | |
| 56 | 56 | #if defined(_WIN32) |
| 57 | 57 | #include <windows.h> |
| ... | ... | @@ -165,10 +165,10 @@ int screen_init(H3270 *session) |
| 165 | 165 | static unsigned short color_from_fa(H3270 *hSession, unsigned char fa) |
| 166 | 166 | { |
| 167 | 167 | if (hSession->m3279) |
| 168 | - return get_color_pair(DEFCOLOR_MAP(fa),0) | COLOR_ATTR_FIELD; | |
| 168 | + return get_color_pair(DEFCOLOR_MAP(fa),0) | LIB3270_ATTR_FIELD; | |
| 169 | 169 | |
| 170 | 170 | // Green on black |
| 171 | - return get_color_pair(0,0) | COLOR_ATTR_FIELD | ((FA_IS_HIGH(fa)) ? COLOR_ATTR_INTENSIFY : 0); | |
| 171 | + return get_color_pair(0,0) | LIB3270_ATTR_FIELD | ((FA_IS_HIGH(fa)) ? LIB3270_ATTR_INTENSIFY : 0); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /* |
| ... | ... | @@ -322,7 +322,7 @@ void screen_update(H3270 *session, int bstart, int bend) |
| 322 | 322 | |
| 323 | 323 | fa = get_field_attribute(session,bstart); |
| 324 | 324 | a = color_from_fa(session,fa); |
| 325 | - fa_addr = find_field_attribute(session,bstart); // may be -1, that's okay | |
| 325 | + fa_addr = lib3270_field_addr(session,bstart); // may be -1, that's okay | |
| 326 | 326 | |
| 327 | 327 | for(baddr = bstart; baddr < bend; baddr++) |
| 328 | 328 | { |
| ... | ... | @@ -556,7 +556,7 @@ void set_status(H3270 *session, LIB3270_FLAG id, Boolean on) |
| 556 | 556 | void status_ctlr_done(H3270 *session) |
| 557 | 557 | { |
| 558 | 558 | CHECK_SESSION_HANDLE(session); |
| 559 | - set_status(session,OIA_FLAG_UNDERA,True); | |
| 559 | + set_status(session,LIB3270_FLAG_UNDERA,True); | |
| 560 | 560 | session->cbk.ctlr_done(session); |
| 561 | 561 | } |
| 562 | 562 | |
| ... | ... | @@ -697,7 +697,7 @@ void status_changed(H3270 *session, LIB3270_MESSAGE id) |
| 697 | 697 | void status_twait(H3270 *session) |
| 698 | 698 | { |
| 699 | 699 | CHECK_SESSION_HANDLE(session); |
| 700 | - set_status(session,OIA_FLAG_UNDERA,False); | |
| 700 | + set_status(session,LIB3270_FLAG_UNDERA,False); | |
| 701 | 701 | status_changed(session,LIB3270_MESSAGE_TWAIT); |
| 702 | 702 | } |
| 703 | 703 | |
| ... | ... | @@ -735,7 +735,7 @@ static void status_connect(H3270 *hSession, int connected, void GNUC_UNUSED(*dun |
| 735 | 735 | |
| 736 | 736 | if (connected) |
| 737 | 737 | { |
| 738 | - set_status(hSession,OIA_FLAG_BOXSOLID,IN_3270 && !IN_SSCP); | |
| 738 | + set_status(hSession,LIB3270_FLAG_BOXSOLID,IN_3270 && !IN_SSCP); | |
| 739 | 739 | |
| 740 | 740 | if (hSession->kybdlock & KL_AWAITING_FIRST) |
| 741 | 741 | id = LIB3270_MESSAGE_AWAITING_FIRST; |
| ... | ... | @@ -745,7 +745,7 @@ static void status_connect(H3270 *hSession, int connected, void GNUC_UNUSED(*dun |
| 745 | 745 | } |
| 746 | 746 | else |
| 747 | 747 | { |
| 748 | - set_status(hSession,OIA_FLAG_BOXSOLID,False); | |
| 748 | + set_status(hSession,LIB3270_FLAG_BOXSOLID,False); | |
| 749 | 749 | id = LIB3270_MESSAGE_DISCONNECTED; |
| 750 | 750 | } |
| 751 | 751 | |
| ... | ... | @@ -760,15 +760,15 @@ static void status_3270_mode(H3270 *hSession, int GNUC_UNUSED(ignored), void GNU |
| 760 | 760 | CHECK_SESSION_HANDLE(hSession); |
| 761 | 761 | |
| 762 | 762 | if(oia_boxsolid) |
| 763 | - set_status(hSession,OIA_FLAG_UNDERA,True); | |
| 764 | - set_status(hSession,OIA_FLAG_BOXSOLID,oia_boxsolid); | |
| 763 | + set_status(hSession,LIB3270_FLAG_UNDERA,True); | |
| 764 | + set_status(hSession,LIB3270_FLAG_BOXSOLID,oia_boxsolid); | |
| 765 | 765 | |
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | /* |
| 769 | 769 | static void status_printer(H3270 *session, int on, void *dunno) |
| 770 | 770 | { |
| 771 | - set_status(session,OIA_FLAG_PRINTER,on); | |
| 771 | + set_status(session,LIB3270_FLAG_PRINTER,on); | |
| 772 | 772 | } |
| 773 | 773 | */ |
| 774 | 774 | ... | ... |
src/lib3270/selection/actions.c
| ... | ... | @@ -32,6 +32,8 @@ |
| 32 | 32 | #include <lib3270/actions.h> |
| 33 | 33 | #include <lib3270/session.h> |
| 34 | 34 | #include <lib3270/selection.h> |
| 35 | + #include <lib3270/log.h> | |
| 36 | + #include <lib3270/trace.h> | |
| 35 | 37 | #include "3270ds.h" |
| 36 | 38 | |
| 37 | 39 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| ... | ... | @@ -48,7 +50,7 @@ LIB3270_EXPORT int lib3270_unselect(H3270 *hSession) |
| 48 | 50 | { |
| 49 | 51 | hSession->selected = 0; |
| 50 | 52 | |
| 51 | - for(a = 0; a < hSession->rows*hSession->cols; a++) | |
| 53 | + for(a = 0; a < ((int) (hSession->rows*hSession->cols)); a++) | |
| 52 | 54 | { |
| 53 | 55 | if(hSession->text[a].attr & LIB3270_ATTR_SELECTED) |
| 54 | 56 | { |
| ... | ... | @@ -211,10 +213,10 @@ LIB3270_EXPORT int lib3270_move_selected_area(H3270 *hSession, int from, int to) |
| 211 | 213 | if(col < 0) |
| 212 | 214 | cols = - (pos[f] % hSession->cols); |
| 213 | 215 | |
| 214 | - if(row >= (hSession->rows)) | |
| 216 | + if(row >= ((int) hSession->rows)) | |
| 215 | 217 | rows = hSession->rows - ((pos[f] / hSession->cols)+1); |
| 216 | 218 | |
| 217 | - if(col >= hSession->cols) | |
| 219 | + if(col >= ((int) hSession->cols)) | |
| 218 | 220 | cols = hSession->cols - ((pos[f] % hSession->cols)+1); |
| 219 | 221 | } |
| 220 | 222 | ... | ... |
src/lib3270/selection/selection.c
| ... | ... | @@ -32,6 +32,7 @@ |
| 32 | 32 | #include <lib3270/actions.h> |
| 33 | 33 | #include <lib3270/session.h> |
| 34 | 34 | #include <lib3270/selection.h> |
| 35 | + #include <lib3270/log.h> | |
| 35 | 36 | #include "3270ds.h" |
| 36 | 37 | #include "kybdc.h" |
| 37 | 38 | |
| ... | ... | @@ -221,9 +222,9 @@ LIB3270_EXPORT unsigned char lib3270_get_selection_flags(H3270 *hSession, int ba |
| 221 | 222 | if( (col == 0) || !(hSession->text[baddr-1].attr & LIB3270_ATTR_SELECTED) ) |
| 222 | 223 | rc |= SELECTION_LEFT; |
| 223 | 224 | |
| 224 | - /// FIXME: It should text if baddr is the last element before the +1. | |
| 225 | + /// FIXME: It should test if baddr is the last element before the +1. | |
| 225 | 226 | |
| 226 | - if( (col == hSession->cols) || !(hSession->text[baddr+1].attr & LIB3270_ATTR_SELECTED) ) | |
| 227 | + if( (col == ((int) hSession->cols)) || !(hSession->text[baddr+1].attr & LIB3270_ATTR_SELECTED) ) | |
| 227 | 228 | rc |= SELECTION_RIGHT; |
| 228 | 229 | } |
| 229 | 230 | |
| ... | ... | @@ -236,7 +237,7 @@ LIB3270_EXPORT unsigned char lib3270_get_selection_flags(H3270 *hSession, int ba |
| 236 | 237 | if( (row == 0) || !(hSession->text[baddr-hSession->cols].attr & LIB3270_ATTR_SELECTED) ) |
| 237 | 238 | rc |= SELECTION_TOP; |
| 238 | 239 | |
| 239 | - if( (row == hSession->rows) || !(hSession->text[baddr+hSession->cols].attr & LIB3270_ATTR_SELECTED) ) | |
| 240 | + if( (row == ((int) hSession->rows)) || !(hSession->text[baddr+hSession->cols].attr & LIB3270_ATTR_SELECTED) ) | |
| 240 | 241 | rc |= SELECTION_BOTTOM; |
| 241 | 242 | } |
| 242 | 243 | ... | ... |
src/lib3270/session.c
src/lib3270/sf.c
src/lib3270/ssl/linux/getcrl.c
src/lib3270/ssl/negotiate.c
src/lib3270/ssl/state.c
src/lib3270/telnet.c
src/lib3270/toggles.c
src/lib3270/utf8.c