Commit 7ac04a10da06484968e08be04067e5cb957fdf50
1 parent
dab117f1
Exists in
master
and in
3 other branches
Comentando globais sem uso
Showing
4 changed files
with
23 additions
and
80 deletions
Show diff stats
actions.c
| @@ -134,44 +134,4 @@ check_usage(XtActionProc action, Cardinal nargs, Cardinal nargs_min, | @@ -134,44 +134,4 @@ check_usage(XtActionProc action, Cardinal nargs, Cardinal nargs_min, | ||
| 134 | return -1; | 134 | return -1; |
| 135 | } */ | 135 | } */ |
| 136 | 136 | ||
| 137 | -/* | ||
| 138 | - * Wrapper for calling an action internally. | ||
| 139 | - */ | ||
| 140 | - /* | ||
| 141 | -void | ||
| 142 | -action_internal(XtActionProc action, enum iaction cause, const char *parm1, | ||
| 143 | - const char *parm2) | ||
| 144 | -{ | ||
| 145 | - Cardinal count = 0; | ||
| 146 | - String parms[2]; | ||
| 147 | - | ||
| 148 | - // Duplicate the parms, because XtActionProc doesn't grok 'const'. | ||
| 149 | - if (parm1 != CN) { | ||
| 150 | - parms[0] = NewString(parm1); | ||
| 151 | - count++; | ||
| 152 | - if (parm2 != CN) { | ||
| 153 | - parms[1] = NewString(parm2); | ||
| 154 | - count++; | ||
| 155 | - } | ||
| 156 | - } | ||
| 157 | - | ||
| 158 | - ia_cause = cause; | ||
| 159 | - (*action)((Widget) NULL, (XEvent *) NULL, | ||
| 160 | - count ? parms : (String *) NULL, | ||
| 161 | - &count); | ||
| 162 | - | ||
| 163 | - // Free the parm copies. | ||
| 164 | - switch (count) { | ||
| 165 | - case 2: | ||
| 166 | - lib3270_free(parms[1]); | ||
| 167 | - // fall through... | ||
| 168 | - case 1: | ||
| 169 | - lib3270_free(parms[0]); | ||
| 170 | - break; | ||
| 171 | - default: | ||
| 172 | - break; | ||
| 173 | - } | ||
| 174 | -} | ||
| 175 | -*/ | ||
| 176 | - | ||
| 177 | 137 |
ctlrc.h
| @@ -78,6 +78,8 @@ enum dbcs_state { | @@ -78,6 +78,8 @@ enum dbcs_state { | ||
| 78 | #define IS_LEFT(d) ((d) == DBCS_LEFT || (d) == DBCS_LEFT_WRAP) | 78 | #define IS_LEFT(d) ((d) == DBCS_LEFT || (d) == DBCS_LEFT_WRAP) |
| 79 | #define IS_RIGHT(d) ((d) == DBCS_RIGHT || (d) == DBCS_RIGHT_WRAP) | 79 | #define IS_RIGHT(d) ((d) == DBCS_RIGHT || (d) == DBCS_RIGHT_WRAP) |
| 80 | #define IS_DBCS(d) (IS_LEFT(d) || IS_RIGHT(d)) | 80 | #define IS_DBCS(d) (IS_LEFT(d) || IS_RIGHT(d)) |
| 81 | + | ||
| 82 | +/* | ||
| 81 | #define MAKE_LEFT(b) { \ | 83 | #define MAKE_LEFT(b) { \ |
| 82 | if (((b) % COLS) == ((ROWS * COLS) - 1)) \ | 84 | if (((b) % COLS) == ((ROWS * COLS) - 1)) \ |
| 83 | ea_buf[(b)].db = DBCS_LEFT_WRAP; \ | 85 | ea_buf[(b)].db = DBCS_LEFT_WRAP; \ |
| @@ -90,6 +92,8 @@ enum dbcs_state { | @@ -90,6 +92,8 @@ enum dbcs_state { | ||
| 90 | else \ | 92 | else \ |
| 91 | ea_buf[(b)].db = DBCS_RIGHT; \ | 93 | ea_buf[(b)].db = DBCS_RIGHT; \ |
| 92 | } | 94 | } |
| 95 | +*/ | ||
| 96 | + | ||
| 93 | #define SOSI(c) (((c) == EBC_so)? EBC_si: EBC_so) | 97 | #define SOSI(c) (((c) == EBC_so)? EBC_si: EBC_so) |
| 94 | 98 | ||
| 95 | enum dbcs_why { DBCS_FIELD, DBCS_SUBFIELD, DBCS_ATTRIBUTE }; | 99 | enum dbcs_why { DBCS_FIELD, DBCS_SUBFIELD, DBCS_ATTRIBUTE }; |
globals.h
| @@ -106,7 +106,6 @@ | @@ -106,7 +106,6 @@ | ||
| 106 | * Prerequisite #includes. | 106 | * Prerequisite #includes. |
| 107 | */ | 107 | */ |
| 108 | #include <stdio.h> /* Unix standard I/O library */ | 108 | #include <stdio.h> /* Unix standard I/O library */ |
| 109 | -// #include <stdlib.h> /* Other Unix library functions */ | ||
| 110 | #include <unistd.h> /* Unix system calls */ | 109 | #include <unistd.h> /* Unix system calls */ |
| 111 | #include <ctype.h> /* Character classes */ | 110 | #include <ctype.h> /* Character classes */ |
| 112 | #include <string.h> /* String manipulations */ | 111 | #include <string.h> /* String manipulations */ |
| @@ -123,33 +122,11 @@ | @@ -123,33 +122,11 @@ | ||
| 123 | #undef X3270_MENUS | 122 | #undef X3270_MENUS |
| 124 | #endif /*]*/ | 123 | #endif /*]*/ |
| 125 | 124 | ||
| 126 | -/* Local process (-e) header files. */ /* | ||
| 127 | -#if defined(X3270_LOCAL_PROCESS) && defined(HAVE_LIBUTIL) | ||
| 128 | - #define LOCAL_PROCESS 1 | ||
| 129 | - #include <termios.h> | ||
| 130 | - | ||
| 131 | - #if defined(HAVE_PTY_H) | ||
| 132 | - #include <pty.h> | ||
| 133 | - #endif | ||
| 134 | - | ||
| 135 | - #if defined(HAVE_LIBUTIL_H) | ||
| 136 | - #include <libutil.h> | ||
| 137 | - #endif | ||
| 138 | - | ||
| 139 | - #if defined(HAVE_UTIL_H) | ||
| 140 | - #include <util.h> | ||
| 141 | - #endif | ||
| 142 | -#endif | ||
| 143 | -*/ | ||
| 144 | - | ||
| 145 | /* Functions we may need to supply. */ | 125 | /* Functions we may need to supply. */ |
| 146 | #if defined(NEED_STRTOK_R) /*[*/ | 126 | #if defined(NEED_STRTOK_R) /*[*/ |
| 147 | extern char *strtok_r(char *str, const char *sep, char **last); | 127 | extern char *strtok_r(char *str, const char *sep, char **last); |
| 148 | #endif /*]*/ | 128 | #endif /*]*/ |
| 149 | 129 | ||
| 150 | -/* Stop conflicting with curses' COLS, even if we don't link with it. */ | ||
| 151 | -// #define COLS cCOLS | ||
| 152 | - | ||
| 153 | #define CHECK_SESSION_HANDLE(x) if(!x) x = &h3270; | 130 | #define CHECK_SESSION_HANDLE(x) if(!x) x = &h3270; |
| 154 | 131 | ||
| 155 | 132 | ||
| @@ -162,9 +139,10 @@ enum iaction { | @@ -162,9 +139,10 @@ enum iaction { | ||
| 162 | IA_IDLE | 139 | IA_IDLE |
| 163 | }; | 140 | }; |
| 164 | 141 | ||
| 165 | -LIB3270_INTERNAL int COLS; | ||
| 166 | -LIB3270_INTERNAL int ROWS; | ||
| 167 | -extern H3270 h3270; | 142 | +// LIB3270_INTERNAL int COLS; |
| 143 | +// LIB3270_INTERNAL int ROWS; | ||
| 144 | + | ||
| 145 | +LIB3270_INTERNAL H3270 h3270; | ||
| 168 | 146 | ||
| 169 | #if defined(X3270_DISPLAY) /*[*/ | 147 | #if defined(X3270_DISPLAY) /*[*/ |
| 170 | LIB3270_INTERNAL Atom a_3270, a_registry, a_encoding; | 148 | LIB3270_INTERNAL Atom a_3270, a_registry, a_encoding; |
| @@ -232,14 +210,14 @@ LIB3270_INTERNAL Boolean exiting; | @@ -232,14 +210,14 @@ LIB3270_INTERNAL Boolean exiting; | ||
| 232 | // LIB3270_INTERNAL int maxROWS; | 210 | // LIB3270_INTERNAL int maxROWS; |
| 233 | // LIB3270_INTERNAL char *model_name; | 211 | // LIB3270_INTERNAL char *model_name; |
| 234 | // LIB3270_INTERNAL int model_num; | 212 | // LIB3270_INTERNAL int model_num; |
| 235 | -LIB3270_INTERNAL Boolean no_login_host; | ||
| 236 | -LIB3270_INTERNAL Boolean non_tn3270e_host; | 213 | +// LIB3270_INTERNAL Boolean no_login_host; |
| 214 | +// LIB3270_INTERNAL Boolean non_tn3270e_host; | ||
| 237 | // LIB3270_INTERNAL int ov_cols, ov_rows; | 215 | // LIB3270_INTERNAL int ov_cols, ov_rows; |
| 238 | - LIB3270_INTERNAL Boolean passthru_host; | ||
| 239 | -extern const char *programname; | ||
| 240 | -LIB3270_INTERNAL char *qualified_host; | ||
| 241 | -LIB3270_INTERNAL char *reconnect_host; | ||
| 242 | -LIB3270_INTERNAL int screen_depth; | 216 | +// LIB3270_INTERNAL Boolean passthru_host; |
| 217 | +// extern const char *programname; | ||
| 218 | +// LIB3270_INTERNAL char *qualified_host; | ||
| 219 | +// LIB3270_INTERNAL char *reconnect_host; | ||
| 220 | +// LIB3270_INTERNAL int screen_depth; | ||
| 243 | LIB3270_INTERNAL Boolean scroll_initted; | 221 | LIB3270_INTERNAL Boolean scroll_initted; |
| 244 | 222 | ||
| 245 | //#if defined(HAVE_LIBSSL) /*[*/ | 223 | //#if defined(HAVE_LIBSSL) /*[*/ |
| @@ -247,13 +225,13 @@ LIB3270_INTERNAL Boolean scroll_initted; | @@ -247,13 +225,13 @@ LIB3270_INTERNAL Boolean scroll_initted; | ||
| 247 | //#endif /*]*/ | 225 | //#endif /*]*/ |
| 248 | 226 | ||
| 249 | LIB3270_INTERNAL Boolean shifted; | 227 | LIB3270_INTERNAL Boolean shifted; |
| 250 | -LIB3270_INTERNAL Boolean ssl_host; | 228 | +// LIB3270_INTERNAL Boolean ssl_host; |
| 251 | LIB3270_INTERNAL Boolean *standard_font; | 229 | LIB3270_INTERNAL Boolean *standard_font; |
| 252 | -LIB3270_INTERNAL Boolean std_ds_host; | ||
| 253 | -LIB3270_INTERNAL char *termtype; | ||
| 254 | -LIB3270_INTERNAL Widget toplevel; | 230 | +// LIB3270_INTERNAL Boolean std_ds_host; |
| 231 | +// LIB3270_INTERNAL char *termtype; | ||
| 232 | +// LIB3270_INTERNAL Widget toplevel; | ||
| 255 | // LIB3270_INTERNAL Boolean visible_control; | 233 | // LIB3270_INTERNAL Boolean visible_control; |
| 256 | -LIB3270_INTERNAL int *xtra_width; | 234 | +// LIB3270_INTERNAL int *xtra_width; |
| 257 | 235 | ||
| 258 | /* | 236 | /* |
| 259 | #if defined(X3270_DISPLAY) | 237 | #if defined(X3270_DISPLAY) |
| @@ -318,7 +296,7 @@ LIB3270_INTERNAL struct trans_list *trans_list; | @@ -318,7 +296,7 @@ LIB3270_INTERNAL struct trans_list *trans_list; | ||
| 318 | 296 | ||
| 319 | #define CN ((char *) NULL) | 297 | #define CN ((char *) NULL) |
| 320 | #define PN ((XtPointer) NULL) | 298 | #define PN ((XtPointer) NULL) |
| 321 | -#define Replace(var, value) { lib3270_free(var); var = (value); } | 299 | +#define Replace(var, value) { lib3270_free(var); var = (value); }; |
| 322 | 300 | ||
| 323 | /* Configuration change masks. */ | 301 | /* Configuration change masks. */ |
| 324 | #define NO_CHANGE 0x0000 /* no change */ | 302 | #define NO_CHANGE 0x0000 /* no change */ |
util.c
| @@ -880,10 +880,11 @@ rpf_free(rpf_t *r) | @@ -880,10 +880,11 @@ rpf_free(rpf_t *r) | ||
| 880 | r->cur_len = 0; | 880 | r->cur_len = 0; |
| 881 | } | 881 | } |
| 882 | 882 | ||
| 883 | -LIB3270_EXPORT void lib3270_free(void *p) | 883 | +LIB3270_EXPORT void * lib3270_free(void *p) |
| 884 | { | 884 | { |
| 885 | if(p) | 885 | if(p) |
| 886 | free(p); | 886 | free(p); |
| 887 | + return NULL; | ||
| 887 | } | 888 | } |
| 888 | 889 | ||
| 889 | LIB3270_EXPORT void * lib3270_realloc(void *p, int len) | 890 | LIB3270_EXPORT void * lib3270_realloc(void *p, int len) |