Commit 3856aadb5ee58d3cd1ec2078f40d2f1bd595999f
1 parent
9ef16f95
Exists in
master
and in
5 other branches
Removendo includes obsoletas, sessão passa a ser criada automaticamente caso alg…
…uma função da lib seja chamada com NULL no handle
Showing
33 changed files
with
159 additions
and
147 deletions
Show diff stats
pw3270.cbp
| @@ -73,7 +73,6 @@ | @@ -73,7 +73,6 @@ | ||
| 73 | <Unit filename="src/lib3270/3270ds.h" /> | 73 | <Unit filename="src/lib3270/3270ds.h" /> |
| 74 | <Unit filename="src/lib3270/Makefile.in" /> | 74 | <Unit filename="src/lib3270/Makefile.in" /> |
| 75 | <Unit filename="src/lib3270/X11keysym.h" /> | 75 | <Unit filename="src/lib3270/X11keysym.h" /> |
| 76 | - <Unit filename="src/lib3270/actionsc.h" /> | ||
| 77 | <Unit filename="src/lib3270/ansi.c"> | 76 | <Unit filename="src/lib3270/ansi.c"> |
| 78 | <Option compilerVar="CC" /> | 77 | <Option compilerVar="CC" /> |
| 79 | </Unit> | 78 | </Unit> |
| @@ -88,7 +87,6 @@ | @@ -88,7 +87,6 @@ | ||
| 88 | <Option compilerVar="CC" /> | 87 | <Option compilerVar="CC" /> |
| 89 | </Unit> | 88 | </Unit> |
| 90 | <Unit filename="src/lib3270/charsetc.h" /> | 89 | <Unit filename="src/lib3270/charsetc.h" /> |
| 91 | - <Unit filename="src/lib3270/childc.h" /> | ||
| 92 | <Unit filename="src/lib3270/ctlr.c"> | 90 | <Unit filename="src/lib3270/ctlr.c"> |
| 93 | <Option compilerVar="CC" /> | 91 | <Option compilerVar="CC" /> |
| 94 | </Unit> | 92 | </Unit> |
| @@ -119,11 +117,9 @@ | @@ -119,11 +117,9 @@ | ||
| 119 | <Unit filename="src/lib3270/html.c"> | 117 | <Unit filename="src/lib3270/html.c"> |
| 120 | <Option compilerVar="CC" /> | 118 | <Option compilerVar="CC" /> |
| 121 | </Unit> | 119 | </Unit> |
| 122 | - <Unit filename="src/lib3270/icmdc.h" /> | ||
| 123 | <Unit filename="src/lib3270/iocalls.c"> | 120 | <Unit filename="src/lib3270/iocalls.c"> |
| 124 | <Option compilerVar="CC" /> | 121 | <Option compilerVar="CC" /> |
| 125 | </Unit> | 122 | </Unit> |
| 126 | - <Unit filename="src/lib3270/keypadc.h" /> | ||
| 127 | <Unit filename="src/lib3270/kybd.c"> | 123 | <Unit filename="src/lib3270/kybd.c"> |
| 128 | <Option compilerVar="CC" /> | 124 | <Option compilerVar="CC" /> |
| 129 | </Unit> | 125 | </Unit> |
| @@ -138,13 +134,10 @@ | @@ -138,13 +134,10 @@ | ||
| 138 | <Unit filename="src/lib3270/mkfb.c"> | 134 | <Unit filename="src/lib3270/mkfb.c"> |
| 139 | <Option compilerVar="CC" /> | 135 | <Option compilerVar="CC" /> |
| 140 | </Unit> | 136 | </Unit> |
| 141 | - <Unit filename="src/lib3270/objects.h" /> | ||
| 142 | <Unit filename="src/lib3270/paste.c"> | 137 | <Unit filename="src/lib3270/paste.c"> |
| 143 | <Option compilerVar="CC" /> | 138 | <Option compilerVar="CC" /> |
| 144 | </Unit> | 139 | </Unit> |
| 145 | <Unit filename="src/lib3270/popupsc.h" /> | 140 | <Unit filename="src/lib3270/popupsc.h" /> |
| 146 | - <Unit filename="src/lib3270/printc.h" /> | ||
| 147 | - <Unit filename="src/lib3270/printerc.h" /> | ||
| 148 | <Unit filename="src/lib3270/proxy.c"> | 141 | <Unit filename="src/lib3270/proxy.c"> |
| 149 | <Option compilerVar="CC" /> | 142 | <Option compilerVar="CC" /> |
| 150 | </Unit> | 143 | </Unit> |
| @@ -160,13 +153,11 @@ | @@ -160,13 +153,11 @@ | ||
| 160 | <Unit filename="src/lib3270/rpq.c"> | 153 | <Unit filename="src/lib3270/rpq.c"> |
| 161 | <Option compilerVar="CC" /> | 154 | <Option compilerVar="CC" /> |
| 162 | </Unit> | 155 | </Unit> |
| 163 | - <Unit filename="src/lib3270/savec.h" /> | ||
| 164 | <Unit filename="src/lib3270/screen.c"> | 156 | <Unit filename="src/lib3270/screen.c"> |
| 165 | <Option compilerVar="CC" /> | 157 | <Option compilerVar="CC" /> |
| 166 | </Unit> | 158 | </Unit> |
| 167 | <Unit filename="src/lib3270/screen.h" /> | 159 | <Unit filename="src/lib3270/screen.h" /> |
| 168 | <Unit filename="src/lib3270/screenc.h" /> | 160 | <Unit filename="src/lib3270/screenc.h" /> |
| 169 | - <Unit filename="src/lib3270/scrollc.h" /> | ||
| 170 | <Unit filename="src/lib3270/see.c"> | 161 | <Unit filename="src/lib3270/see.c"> |
| 171 | <Option compilerVar="CC" /> | 162 | <Option compilerVar="CC" /> |
| 172 | </Unit> | 163 | </Unit> |
src/include/lib3270.h
| @@ -153,11 +153,10 @@ | @@ -153,11 +153,10 @@ | ||
| 153 | { | 153 | { |
| 154 | LIB3270_FLAG_BOXSOLID, /**< System available */ | 154 | LIB3270_FLAG_BOXSOLID, /**< System available */ |
| 155 | LIB3270_FLAG_UNDERA, /**< Control Unit STATUS */ | 155 | LIB3270_FLAG_UNDERA, /**< Control Unit STATUS */ |
| 156 | -// LIB3270_FLAG_SECURE, /**< Security status */ | ||
| 157 | LIB3270_FLAG_TYPEAHEAD, | 156 | LIB3270_FLAG_TYPEAHEAD, |
| 158 | -// LIB3270_FLAG_PRINTER, | 157 | + LIB3270_FLAG_PRINTER, /**< Printer session status */ |
| 159 | LIB3270_FLAG_REVERSE, | 158 | LIB3270_FLAG_REVERSE, |
| 160 | - LIB3270_FLAG_SCRIPT, | 159 | + LIB3270_FLAG_SCRIPT, /**< Script status */ |
| 161 | 160 | ||
| 162 | LIB3270_FLAG_COUNT | 161 | LIB3270_FLAG_COUNT |
| 163 | 162 |
src/include/lib3270/config.h.in
| @@ -62,9 +62,8 @@ | @@ -62,9 +62,8 @@ | ||
| 62 | #define X3270_TRACE | 62 | #define X3270_TRACE |
| 63 | 63 | ||
| 64 | #undef HAVE_PRINTER | 64 | #undef HAVE_PRINTER |
| 65 | + #undef HAVE_SCRIPT | ||
| 65 | 66 | ||
| 66 | - #undef HAVE_IGEMAC | ||
| 67 | - #undef HAVE_MACUI | ||
| 68 | #undef HAVE_MALLOC_H | 67 | #undef HAVE_MALLOC_H |
| 69 | 68 | ||
| 70 | #endif /* LIB3270_CONFIG_INCLUDED */ | 69 | #endif /* LIB3270_CONFIG_INCLUDED */ |
src/include/v3270.h
| @@ -104,7 +104,9 @@ | @@ -104,7 +104,9 @@ | ||
| 104 | V3270_OIA_SHIFT, /**< Shift Status */ | 104 | V3270_OIA_SHIFT, /**< Shift Status */ |
| 105 | V3270_OIA_TYPEAHEAD, /**< Typeahead indication ("T" or blank) */ | 105 | V3270_OIA_TYPEAHEAD, /**< Typeahead indication ("T" or blank) */ |
| 106 | V3270_OIA_INSERT, /**< Insert mode indication (Special symbol/"I" or blank) */ | 106 | V3270_OIA_INSERT, /**< Insert mode indication (Special symbol/"I" or blank) */ |
| 107 | +#ifdef HAVE_SCRIPT | ||
| 107 | V3270_OIA_SCRIPT, /**< Script indication ("S" or blank) */ | 108 | V3270_OIA_SCRIPT, /**< Script indication ("S" or blank) */ |
| 109 | +#endif // HAVE_SCRIPT | ||
| 108 | V3270_OIA_LUNAME, /**< LU Name */ | 110 | V3270_OIA_LUNAME, /**< LU Name */ |
| 109 | V3270_OIA_SPINNER, /**< command timing spinner */ | 111 | V3270_OIA_SPINNER, /**< command timing spinner */ |
| 110 | V3270_OIA_TIMER, /**< command timing (mmm:ss, or blank) */ | 112 | V3270_OIA_TIMER, /**< command timing (mmm:ss, or blank) */ |
src/lib3270/actionsc.h
| @@ -17,27 +17,21 @@ | @@ -17,27 +17,21 @@ | ||
| 17 | * Global declarations for actions.c. | 17 | * Global declarations for actions.c. |
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | +#error Deprecated | ||
| 21 | + | ||
| 20 | // extern enum iaction ia_cause; | 22 | // extern enum iaction ia_cause; |
| 21 | 23 | ||
| 22 | -extern int actioncount; | 24 | +// extern int actioncount; |
| 23 | // extern XtActionsRec *actions; | 25 | // extern XtActionsRec *actions; |
| 24 | 26 | ||
| 25 | // extern const char *ia_name[]; | 27 | // extern const char *ia_name[]; |
| 26 | 28 | ||
| 27 | -// #if defined(X3270_TRACE) /*[*/ | ||
| 28 | -// extern void action_debug(XtActionProc action, XEvent *event, String *params, Cardinal *num_params); | ||
| 29 | -// #else /*][*/ | ||
| 30 | -// #define action_debug(a, e, p, n) | ||
| 31 | -// #endif /*]*/ | ||
| 32 | - | ||
| 33 | -extern void action_init(void); | 29 | +// extern void action_init(void); |
| 34 | 30 | ||
| 35 | // extern void action_internal(XtActionProc action, enum iaction cause, const char *parm1, const char *parm2); | 31 | // extern void action_internal(XtActionProc action, enum iaction cause, const char *parm1, const char *parm2); |
| 36 | 32 | ||
| 37 | -#define action_name(x) #x | ||
| 38 | -// extern const char *action_name(XtActionProc action); | ||
| 39 | -// extern int check_usage(XtActionProc action, Cardinal nargs, Cardinal nargs_min, Cardinal nargs_max); | 33 | +// #define action_name(x) #x |
| 40 | 34 | ||
| 41 | -extern Boolean event_is_meta(int state); | 35 | +// extern Boolean event_is_meta(int state); |
| 42 | 36 | ||
| 43 | 37 |
src/lib3270/ansi.c
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | #include "ctlrc.h" | 52 | #include "ctlrc.h" |
| 53 | #include "hostc.h" | 53 | #include "hostc.h" |
| 54 | #include "screenc.h" | 54 | #include "screenc.h" |
| 55 | -#include "scrollc.h" | 55 | +// #include "scrollc.h" |
| 56 | #include "tablesc.h" | 56 | #include "tablesc.h" |
| 57 | #include "telnetc.h" | 57 | #include "telnetc.h" |
| 58 | #include "trace_dsc.h" | 58 | #include "trace_dsc.h" |
src/lib3270/api.h
| @@ -153,7 +153,7 @@ | @@ -153,7 +153,7 @@ | ||
| 153 | // #define OIA_FLAG_SECURE LIB3270_FLAG_SECURE | 153 | // #define OIA_FLAG_SECURE LIB3270_FLAG_SECURE |
| 154 | #define OIA_FLAG_TYPEAHEAD LIB3270_FLAG_TYPEAHEAD | 154 | #define OIA_FLAG_TYPEAHEAD LIB3270_FLAG_TYPEAHEAD |
| 155 | // #define OIA_FLAG_PRINTER LIB3270_FLAG_PRINTER | 155 | // #define OIA_FLAG_PRINTER LIB3270_FLAG_PRINTER |
| 156 | - #define OIA_FLAG_REVERSE LIB3270_FLAG_REVERSE | 156 | +// #define OIA_FLAG_REVERSE LIB3270_FLAG_REVERSE |
| 157 | #define OIA_FLAG_USER LIB3270_FLAG_COUNT | 157 | #define OIA_FLAG_USER LIB3270_FLAG_COUNT |
| 158 | #define OIA_FLAG LIB3270_FLAG | 158 | #define OIA_FLAG LIB3270_FLAG |
| 159 | 159 |
src/lib3270/charsetc.h
| @@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
| 25 | */ | 25 | */ |
| 26 | 26 | ||
| 27 | // LIB3270_INTERNAL Boolean charset_changed; | 27 | // LIB3270_INTERNAL Boolean charset_changed; |
| 28 | -LIB3270_INTERNAL unsigned long cgcsgid; | 28 | +// LIB3270_INTERNAL unsigned long cgcsgid; |
| 29 | 29 | ||
| 30 | /* | 30 | /* |
| 31 | #if defined(X3270_DBCS) | 31 | #if defined(X3270_DBCS) |
src/lib3270/childc.h
src/lib3270/ctlr.c
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | #include "kybdc.h" | 53 | #include "kybdc.h" |
| 54 | #include "popupsc.h" | 54 | #include "popupsc.h" |
| 55 | #include "screenc.h" | 55 | #include "screenc.h" |
| 56 | -#include "scrollc.h" | 56 | +// #include "scrollc.h" |
| 57 | #include "seec.h" | 57 | #include "seec.h" |
| 58 | #include "sf.h" | 58 | #include "sf.h" |
| 59 | #include "statusc.h" | 59 | #include "statusc.h" |
src/lib3270/ctlrc.h
| @@ -72,14 +72,14 @@ LIB3270_INTERNAL void ctlr_erase(H3270 *session, int alt); | @@ -72,14 +72,14 @@ LIB3270_INTERNAL void ctlr_erase(H3270 *session, int alt); | ||
| 72 | LIB3270_INTERNAL void ticking_start(H3270 *session, Boolean anyway); | 72 | LIB3270_INTERNAL void ticking_start(H3270 *session, Boolean anyway); |
| 73 | 73 | ||
| 74 | enum dbcs_state { | 74 | enum dbcs_state { |
| 75 | - DBCS_NONE = 0, /* position is not DBCS */ | ||
| 76 | - DBCS_LEFT, /* position is left half of DBCS character */ | ||
| 77 | - DBCS_RIGHT, /* position is right half of DBCS character */ | ||
| 78 | - DBCS_SI, /* position is SI terminating DBCS subfield */ | ||
| 79 | - DBCS_SB, /* position is SBCS character after the SI */ | ||
| 80 | - DBCS_LEFT_WRAP, /* position is left half of split DBCS */ | ||
| 81 | - DBCS_RIGHT_WRAP, /* position is right half of split DBCS */ | ||
| 82 | - DBCS_DEAD /* position is dead left-half DBCS */ | 75 | + DBCS_NONE = 0, /**< position is not DBCS */ |
| 76 | + DBCS_LEFT, /**< position is left half of DBCS character */ | ||
| 77 | + DBCS_RIGHT, /**< position is right half of DBCS character */ | ||
| 78 | + DBCS_SI, /**< position is SI terminating DBCS subfield */ | ||
| 79 | + DBCS_SB, /**< position is SBCS character after the SI */ | ||
| 80 | + DBCS_LEFT_WRAP, /**< position is left half of split DBCS */ | ||
| 81 | + DBCS_RIGHT_WRAP, /**< position is right half of split DBCS */ | ||
| 82 | + DBCS_DEAD /**< position is dead left-half DBCS */ | ||
| 83 | }; | 83 | }; |
| 84 | #define IS_LEFT(d) ((d) == DBCS_LEFT || (d) == DBCS_LEFT_WRAP) | 84 | #define IS_LEFT(d) ((d) == DBCS_LEFT || (d) == DBCS_LEFT_WRAP) |
| 85 | #define IS_RIGHT(d) ((d) == DBCS_RIGHT || (d) == DBCS_RIGHT_WRAP) | 85 | #define IS_RIGHT(d) ((d) == DBCS_RIGHT || (d) == DBCS_RIGHT_WRAP) |
src/lib3270/ft.c
| @@ -41,7 +41,7 @@ | @@ -41,7 +41,7 @@ | ||
| 41 | #endif // HAVE_MALLOC_H | 41 | #endif // HAVE_MALLOC_H |
| 42 | 42 | ||
| 43 | //#include "appres.h" | 43 | //#include "appres.h" |
| 44 | -#include "actionsc.h" | 44 | +//#include "actionsc.h" |
| 45 | #include "ft_cutc.h" | 45 | #include "ft_cutc.h" |
| 46 | #include "ft_dftc.h" | 46 | #include "ft_dftc.h" |
| 47 | #include "ftc.h" | 47 | #include "ftc.h" |
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | #endif | 52 | #endif |
| 53 | */ | 53 | */ |
| 54 | #include "kybdc.h" | 54 | #include "kybdc.h" |
| 55 | -#include "objects.h" | 55 | +// #include "objects.h" |
| 56 | #include "popupsc.h" | 56 | #include "popupsc.h" |
| 57 | #include "screenc.h" | 57 | #include "screenc.h" |
| 58 | #include "tablesc.h" | 58 | #include "tablesc.h" |
src/lib3270/ft_cut.c
| @@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
| 42 | #if defined(X3270_FT) /*[*/ | 42 | #if defined(X3270_FT) /*[*/ |
| 43 | 43 | ||
| 44 | #include "3270ds.h" | 44 | #include "3270ds.h" |
| 45 | -#include "actionsc.h" | 45 | +//#include "actionsc.h" |
| 46 | #include "ctlrc.h" | 46 | #include "ctlrc.h" |
| 47 | #include "ft_cutc.h" | 47 | #include "ft_cutc.h" |
| 48 | #include "ft_cut_ds.h" | 48 | #include "ft_cut_ds.h" |
src/lib3270/ft_dft.c
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | #include "3270ds.h" | 45 | #include "3270ds.h" |
| 46 | #include "ft_dft_ds.h" | 46 | #include "ft_dft_ds.h" |
| 47 | 47 | ||
| 48 | -#include "actionsc.h" | 48 | +//#include "actionsc.h" |
| 49 | #include "kybdc.h" | 49 | #include "kybdc.h" |
| 50 | #include "ft_dftc.h" | 50 | #include "ft_dftc.h" |
| 51 | #include "ftc.h" | 51 | #include "ftc.h" |
src/lib3270/globals.h
| @@ -69,6 +69,7 @@ | @@ -69,6 +69,7 @@ | ||
| 69 | #define N_( x ) x | 69 | #define N_( x ) x |
| 70 | #endif // HAVE_LIBINTL | 70 | #endif // HAVE_LIBINTL |
| 71 | 71 | ||
| 72 | +#define action_name(x) #x | ||
| 72 | 73 | ||
| 73 | /* | 74 | /* |
| 74 | * OS-specific #defines. Except for the blocking-connect workarounds, these | 75 | * OS-specific #defines. Except for the blocking-connect workarounds, these |
src/lib3270/glue.c
| @@ -53,11 +53,11 @@ | @@ -53,11 +53,11 @@ | ||
| 53 | #include "3270ds.h" | 53 | #include "3270ds.h" |
| 54 | #include "resources.h" | 54 | #include "resources.h" |
| 55 | 55 | ||
| 56 | -#include "actionsc.h" | 56 | +//#include "actionsc.h" |
| 57 | #include "ansic.h" | 57 | #include "ansic.h" |
| 58 | #include "charsetc.h" | 58 | #include "charsetc.h" |
| 59 | #include "ctlrc.h" | 59 | #include "ctlrc.h" |
| 60 | -#include "gluec.h" | 60 | +// #include "gluec.h" |
| 61 | #include "hostc.h" | 61 | #include "hostc.h" |
| 62 | // #include "keymapc.h" | 62 | // #include "keymapc.h" |
| 63 | #include "kybdc.h" | 63 | #include "kybdc.h" |
| @@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
| 71 | #include "trace_dsc.h" | 71 | #include "trace_dsc.h" |
| 72 | #include "utilc.h" | 72 | #include "utilc.h" |
| 73 | // #include "idlec.h" | 73 | // #include "idlec.h" |
| 74 | -#include "printerc.h" | 74 | +// #include "printerc.h" |
| 75 | 75 | ||
| 76 | #if defined(X3270_FT) | 76 | #if defined(X3270_FT) |
| 77 | #include "ftc.h" | 77 | #include "ftc.h" |
src/lib3270/gluec.h
| @@ -21,11 +21,13 @@ | @@ -21,11 +21,13 @@ | ||
| 21 | // extern int parse_command_line(int argc, const char **argv, const char **cl_hostname); | 21 | // extern int parse_command_line(int argc, const char **argv, const char **cl_hostname); |
| 22 | // extern int parse_program_parameters(int argc, const char **argv); | 22 | // extern int parse_program_parameters(int argc, const char **argv); |
| 23 | // LIB3270_INTERNAL void parse_xrm(const char *arg, const char *where); | 23 | // LIB3270_INTERNAL void parse_xrm(const char *arg, const char *where); |
| 24 | -LIB3270_INTERNAL void notify_ssl_error(H3270 *session, const char *title, const char *msg, const char *state, const char *alert); | 24 | +// LIB3270_INTERNAL void notify_ssl_error(H3270 *session, const char *title, const char *msg, const char *state, const char *alert); |
| 25 | 25 | ||
| 26 | /* XtGlue.c */ | 26 | /* XtGlue.c */ |
| 27 | -LIB3270_INTERNAL void (*Warning_redirect)(const char *); | 27 | +// LIB3270_INTERNAL void (*Warning_redirect)(const char *); |
| 28 | 28 | ||
| 29 | -#if !defined(_WIN32) /*[*/ | ||
| 30 | -LIB3270_INTERNAL int select_setup(int *nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval **timeout, struct timeval *timebuf); | ||
| 31 | -#endif /*]*/ | 29 | +// #if !defined(_WIN32) |
| 30 | +// LIB3270_INTERNAL int select_setup(int *nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval **timeout, struct timeval *timebuf); | ||
| 31 | +// #endif | ||
| 32 | + | ||
| 33 | +#error Deprecated |
src/lib3270/host.c
| @@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
| 42 | // #include "appres.h" | 42 | // #include "appres.h" |
| 43 | #include "resources.h" | 43 | #include "resources.h" |
| 44 | 44 | ||
| 45 | -#include "actionsc.h" | 45 | +//#include "actionsc.h" |
| 46 | #include "hostc.h" | 46 | #include "hostc.h" |
| 47 | #include "statusc.h" | 47 | #include "statusc.h" |
| 48 | #include "popupsc.h" | 48 | #include "popupsc.h" |
src/lib3270/icmdc.h
| @@ -17,4 +17,6 @@ | @@ -17,4 +17,6 @@ | ||
| 17 | * Declarations for icmd.c. | 17 | * Declarations for icmd.c. |
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | -LIB3270_INTERNAL int interactive_transfer(String **params, Cardinal *num_params); | 20 | +// LIB3270_INTERNAL int interactive_transfer(String **params, Cardinal *num_params); |
| 21 | + | ||
| 22 | +#error Deprecated |
src/lib3270/keypadc.h
src/lib3270/kybd.c
| @@ -59,7 +59,7 @@ struct ta; | @@ -59,7 +59,7 @@ struct ta; | ||
| 59 | // #include "ctlr.h" | 59 | // #include "ctlr.h" |
| 60 | #include "resources.h" | 60 | #include "resources.h" |
| 61 | 61 | ||
| 62 | -#include "actionsc.h" | 62 | +//#include "actionsc.h" |
| 63 | #include "ansic.h" | 63 | #include "ansic.h" |
| 64 | //#include "aplc.h" | 64 | //#include "aplc.h" |
| 65 | #include "ctlrc.h" | 65 | #include "ctlrc.h" |
| @@ -68,7 +68,7 @@ struct ta; | @@ -68,7 +68,7 @@ struct ta; | ||
| 68 | // #include "keypadc.h" | 68 | // #include "keypadc.h" |
| 69 | #include "kybdc.h" | 69 | #include "kybdc.h" |
| 70 | #include "popupsc.h" | 70 | #include "popupsc.h" |
| 71 | -#include "printc.h" | 71 | +// #include "printc.h" |
| 72 | #include "screenc.h" | 72 | #include "screenc.h" |
| 73 | // #if defined(X3270_DISPLAY) /*[*/ | 73 | // #if defined(X3270_DISPLAY) /*[*/ |
| 74 | // #include "selectc.h" | 74 | // #include "selectc.h" |
src/lib3270/localdefs.h
| @@ -33,12 +33,12 @@ | @@ -33,12 +33,12 @@ | ||
| 33 | /* These first definitions were cribbed from X11 -- but no X code is used. */ | 33 | /* These first definitions were cribbed from X11 -- but no X code is used. */ |
| 34 | #define False 0 | 34 | #define False 0 |
| 35 | #define True 1 | 35 | #define True 1 |
| 36 | -typedef void *XtPointer; | ||
| 37 | -typedef void *Widget; | ||
| 38 | -typedef void *XEvent; | 36 | +//typedef void *XtPointer; |
| 37 | +// typedef void *Widget; | ||
| 38 | +// typedef void *XEvent; | ||
| 39 | typedef char Boolean; | 39 | typedef char Boolean; |
| 40 | typedef char *String; | 40 | typedef char *String; |
| 41 | -typedef unsigned int Cardinal; | 41 | +// typedef unsigned int Cardinal; |
| 42 | typedef unsigned long KeySym; | 42 | typedef unsigned long KeySym; |
| 43 | #define Bool int | 43 | #define Bool int |
| 44 | 44 |
src/lib3270/objects.h
| @@ -20,7 +20,9 @@ | @@ -20,7 +20,9 @@ | ||
| 20 | // #define ObjConfirmButton "confirmButton" | 20 | // #define ObjConfirmButton "confirmButton" |
| 21 | // #define ObjConfirm2Button "confirm2Button" | 21 | // #define ObjConfirm2Button "confirm2Button" |
| 22 | // #define ObjCancelButton "cancelButton" | 22 | // #define ObjCancelButton "cancelButton" |
| 23 | -#define ObjDialog "dialog" | 23 | +// #define ObjDialog "dialog" |
| 24 | // #define ObjSmallLabel "smallLabel" | 24 | // #define ObjSmallLabel "smallLabel" |
| 25 | -#define ObjNameLabel "nameLabel" | ||
| 26 | -#define ObjDataLabel "dataLabel" | 25 | +// #define ObjNameLabel "nameLabel" |
| 26 | +// #define ObjDataLabel "dataLabel" | ||
| 27 | + | ||
| 28 | +#error Deprecated |
src/lib3270/paste.c
| @@ -49,7 +49,7 @@ | @@ -49,7 +49,7 @@ | ||
| 49 | #include "3270ds.h" | 49 | #include "3270ds.h" |
| 50 | #include "resources.h" | 50 | #include "resources.h" |
| 51 | 51 | ||
| 52 | -#include "actionsc.h" | 52 | +//#include "actionsc.h" |
| 53 | #include "ansic.h" | 53 | #include "ansic.h" |
| 54 | //#include "aplc.h" | 54 | //#include "aplc.h" |
| 55 | #include "ctlrc.h" | 55 | #include "ctlrc.h" |
| @@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
| 58 | // #include "keypadc.h" | 58 | // #include "keypadc.h" |
| 59 | #include "kybdc.h" | 59 | #include "kybdc.h" |
| 60 | #include "popupsc.h" | 60 | #include "popupsc.h" |
| 61 | -#include "printc.h" | 61 | +// #include "printc.h" |
| 62 | #include "screenc.h" | 62 | #include "screenc.h" |
| 63 | 63 | ||
| 64 | /* | 64 | /* |
src/lib3270/printc.h
| @@ -18,13 +18,10 @@ | @@ -18,13 +18,10 @@ | ||
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | // LIB3270_INTERNAL Boolean fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html); | 20 | // LIB3270_INTERNAL Boolean fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html); |
| 21 | -LIB3270_INTERNAL void PrintText_action(Widget w, XEvent *event, String *params, | ||
| 22 | - Cardinal *num_params); | ||
| 23 | -LIB3270_INTERNAL void PrintWindow_action(Widget w, XEvent *event, String *params, | ||
| 24 | - Cardinal *num_params); | ||
| 25 | -LIB3270_INTERNAL void print_text_option(Widget w, XtPointer client_data, | ||
| 26 | - XtPointer call_data); | ||
| 27 | -LIB3270_INTERNAL void print_window_option(Widget w, XtPointer client_data, | ||
| 28 | - XtPointer call_data); | ||
| 29 | -LIB3270_INTERNAL void save_text_option(Widget w, XtPointer client_data, | ||
| 30 | - XtPointer call_data); | 21 | +// LIB3270_INTERNAL void PrintText_action(Widget w, XEvent *event, String *params,Cardinal *num_params); |
| 22 | +// LIB3270_INTERNAL void PrintWindow_action(Widget w, XEvent *event, String *params,Cardinal *num_params); | ||
| 23 | +// LIB3270_INTERNAL void print_text_option(Widget w, XtPointer client_data,XtPointer call_data); | ||
| 24 | +// LIB3270_INTERNAL void print_window_option(Widget w, XtPointer client_data,XtPointer call_data); | ||
| 25 | +// LIB3270_INTERNAL void save_text_option(Widget w, XtPointer client_data,XtPointer call_data); | ||
| 26 | + | ||
| 27 | +#error Deprecated |
src/lib3270/printerc.h
src/lib3270/savec.h
src/lib3270/screen.c
| @@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
| 42 | #include "resources.h" | 42 | #include "resources.h" |
| 43 | // #include "ctlr.h" | 43 | // #include "ctlr.h" |
| 44 | 44 | ||
| 45 | -#include "actionsc.h" | 45 | +//#include "actionsc.h" |
| 46 | #include "ctlrc.h" | 46 | #include "ctlrc.h" |
| 47 | #include "hostc.h" | 47 | #include "hostc.h" |
| 48 | #include "kybdc.h" | 48 | #include "kybdc.h" |
src/lib3270/scrollc.h
src/lib3270/session.c
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | 48 | ||
| 49 | /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ | 49 | /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ |
| 50 | 50 | ||
| 51 | - static H3270 h3270; | 51 | + static H3270 *default_session = NULL; |
| 52 | 52 | ||
| 53 | /*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ | 53 | /*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ |
| 54 | 54 | ||
| @@ -60,6 +60,9 @@ void lib3270_session_free(H3270 *h) | @@ -60,6 +60,9 @@ void lib3270_session_free(H3270 *h) | ||
| 60 | { | 60 | { |
| 61 | int f; | 61 | int f; |
| 62 | 62 | ||
| 63 | + if(!h) | ||
| 64 | + return; | ||
| 65 | + | ||
| 63 | // Terminate session | 66 | // Terminate session |
| 64 | if(lib3270_connected(h)) | 67 | if(lib3270_connected(h)) |
| 65 | lib3270_disconnect(h); | 68 | lib3270_disconnect(h); |
| @@ -91,6 +94,11 @@ void lib3270_session_free(H3270 *h) | @@ -91,6 +94,11 @@ void lib3270_session_free(H3270 *h) | ||
| 91 | release_pointer(h->buffer[f]); | 94 | release_pointer(h->buffer[f]); |
| 92 | } | 95 | } |
| 93 | 96 | ||
| 97 | + if(h == default_session) | ||
| 98 | + default_session = NULL; | ||
| 99 | + | ||
| 100 | + lib3270_free(h); | ||
| 101 | + | ||
| 94 | } | 102 | } |
| 95 | 103 | ||
| 96 | static void update_char(H3270 *session, int addr, unsigned char chr, unsigned short attr, unsigned char cursor) | 104 | static void update_char(H3270 *session, int addr, unsigned char chr, unsigned short attr, unsigned char cursor) |
| @@ -169,45 +177,45 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | @@ -169,45 +177,45 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | ||
| 169 | initialize_tables(hSession); | 177 | initialize_tables(hSession); |
| 170 | 178 | ||
| 171 | // Default calls | 179 | // Default calls |
| 172 | - hSession->write = lib3270_sock_send; | ||
| 173 | - hSession->disconnect = lib3270_sock_disconnect; | ||
| 174 | - hSession->update = update_char; | ||
| 175 | - hSession->update_model = update_model; | ||
| 176 | - hSession->update_cursor = update_cursor; | ||
| 177 | - hSession->set_selection = nop_char; | ||
| 178 | - hSession->ctlr_done = nop; | ||
| 179 | - hSession->changed = changed; | ||
| 180 | - hSession->erase = screen_disp; | ||
| 181 | - hSession->suspend = nop; | ||
| 182 | - hSession->resume = screen_disp; | ||
| 183 | - hSession->update_oia = update_oia; | ||
| 184 | - hSession->update_selection = update_selection; | ||
| 185 | - hSession->cursor = set_cursor; | ||
| 186 | - hSession->message = message; | ||
| 187 | - hSession->update_ssl = update_ssl; | ||
| 188 | - hSession->display = screen_disp; | ||
| 189 | - hSession->set_width = set_width; | 180 | + hSession->write = lib3270_sock_send; |
| 181 | + hSession->disconnect = lib3270_sock_disconnect; | ||
| 182 | + hSession->update = update_char; | ||
| 183 | + hSession->update_model = update_model; | ||
| 184 | + hSession->update_cursor = update_cursor; | ||
| 185 | + hSession->set_selection = nop_char; | ||
| 186 | + hSession->ctlr_done = nop; | ||
| 187 | + hSession->changed = changed; | ||
| 188 | + hSession->erase = screen_disp; | ||
| 189 | + hSession->suspend = nop; | ||
| 190 | + hSession->resume = screen_disp; | ||
| 191 | + hSession->update_oia = update_oia; | ||
| 192 | + hSession->update_selection = update_selection; | ||
| 193 | + hSession->cursor = set_cursor; | ||
| 194 | + hSession->message = message; | ||
| 195 | + hSession->update_ssl = update_ssl; | ||
| 196 | + hSession->display = screen_disp; | ||
| 197 | + hSession->set_width = set_width; | ||
| 190 | 198 | ||
| 191 | // Set the defaults. | 199 | // Set the defaults. |
| 192 | - hSession->extended = 1; | ||
| 193 | - hSession->typeahead = 1; | ||
| 194 | - hSession->oerr_lock = 1; | ||
| 195 | - hSession->unlock_delay = 1; | ||
| 196 | - hSession->icrnl = 1; | ||
| 197 | - hSession->onlcr = 1; | ||
| 198 | - hSession->host_charset = "bracket"; | ||
| 199 | - hSession->sock = -1; | ||
| 200 | - hSession->model_num = -1; | ||
| 201 | - hSession->cstate = LIB3270_NOT_CONNECTED; | ||
| 202 | - hSession->oia_status = -1; | ||
| 203 | - hSession->kybdlock = KL_NOT_CONNECTED; | ||
| 204 | - hSession->aid = AID_NO; | ||
| 205 | - hSession->reply_mode = SF_SRM_FIELD; | ||
| 206 | - hSession->linemode = 1; | ||
| 207 | - hSession->tn3270e_submode = E_NONE; | ||
| 208 | - hSession->scroll_top = -1; | ||
| 209 | - hSession->scroll_bottom = -1; | ||
| 210 | - hSession->wraparound_mode = 1; | 200 | + hSession->extended = 1; |
| 201 | + hSession->typeahead = 1; | ||
| 202 | + hSession->oerr_lock = 1; | ||
| 203 | + hSession->unlock_delay = 1; | ||
| 204 | + hSession->icrnl = 1; | ||
| 205 | + hSession->onlcr = 1; | ||
| 206 | + hSession->host_charset = "bracket"; | ||
| 207 | + hSession->sock = -1; | ||
| 208 | + hSession->model_num = -1; | ||
| 209 | + hSession->cstate = LIB3270_NOT_CONNECTED; | ||
| 210 | + hSession->oia_status = -1; | ||
| 211 | + hSession->kybdlock = KL_NOT_CONNECTED; | ||
| 212 | + hSession->aid = AID_NO; | ||
| 213 | + hSession->reply_mode = SF_SRM_FIELD; | ||
| 214 | + hSession->linemode = 1; | ||
| 215 | + hSession->tn3270e_submode = E_NONE; | ||
| 216 | + hSession->scroll_top = -1; | ||
| 217 | + hSession->scroll_bottom = -1; | ||
| 218 | + hSession->wraparound_mode = 1; | ||
| 211 | hSession->saved_wraparound_mode = 1; | 219 | hSession->saved_wraparound_mode = 1; |
| 212 | hSession->once_cset = -1; | 220 | hSession->once_cset = -1; |
| 213 | hSession->state = LIB3270_ANSI_STATE_DATA; | 221 | hSession->state = LIB3270_ANSI_STATE_DATA; |
| @@ -222,19 +230,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | @@ -222,19 +230,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | ||
| 222 | #endif // _WIN32 | 230 | #endif // _WIN32 |
| 223 | 231 | ||
| 224 | 232 | ||
| 225 | -/* | ||
| 226 | -#if !defined(_WIN32) | ||
| 227 | - hSession->host_charset = "bracket"; | ||
| 228 | -#else | ||
| 229 | - | ||
| 230 | - if (is_nt) | ||
| 231 | - hSession->host_charset = "bracket"; | ||
| 232 | - else | ||
| 233 | - hSession->host_charset = "bracket437"; | ||
| 234 | -#endif | ||
| 235 | -*/ | ||
| 236 | - | ||
| 237 | - | ||
| 238 | // Initialize toggles | 233 | // Initialize toggles |
| 239 | initialize_toggles(hSession); | 234 | initialize_toggles(hSession); |
| 240 | 235 | ||
| @@ -296,20 +291,18 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | @@ -296,20 +291,18 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | ||
| 296 | 291 | ||
| 297 | H3270 * lib3270_session_new(const char *model) | 292 | H3270 * lib3270_session_new(const char *model) |
| 298 | { | 293 | { |
| 299 | - static int configured = 0; | ||
| 300 | - | ||
| 301 | - H3270 *hSession = &h3270; | 294 | + H3270 * hSession; |
| 302 | 295 | ||
| 303 | - trace("%s - configured=%d",__FUNCTION__,configured); | 296 | + trace("%s - configured=%s",__FUNCTION__,default_session ? "Yes" : "No"); |
| 304 | 297 | ||
| 305 | - if(configured) | 298 | + if(default_session) |
| 306 | { | 299 | { |
| 307 | // TODO (perry#5#): Allocate a new structure. | 300 | // TODO (perry#5#): Allocate a new structure. |
| 308 | errno = EBUSY; | 301 | errno = EBUSY; |
| 309 | - return hSession; | 302 | + return lib3270_get_default_session_handle(); |
| 310 | } | 303 | } |
| 311 | 304 | ||
| 312 | - configured = 1; | 305 | + hSession = default_session = lib3270_malloc(sizeof(H3270)); |
| 313 | 306 | ||
| 314 | lib3270_session_init(hSession, model); | 307 | lib3270_session_init(hSession, model); |
| 315 | 308 | ||
| @@ -343,10 +336,14 @@ H3270 * lib3270_session_new(const char *model) | @@ -343,10 +336,14 @@ H3270 * lib3270_session_new(const char *model) | ||
| 343 | return hSession; | 336 | return hSession; |
| 344 | } | 337 | } |
| 345 | 338 | ||
| 346 | - /* | ||
| 347 | -- * Parse the model number. | ||
| 348 | -- * Returns -1 (error), 0 (default), or the specified number. | ||
| 349 | -- */ | 339 | + /** |
| 340 | + * Parse the model number. | ||
| 341 | + * | ||
| 342 | + * @param session Session Handle. | ||
| 343 | + * @param m Model number. | ||
| 344 | + * | ||
| 345 | + * @return -1 (error), 0 (default), or the specified number. | ||
| 346 | + */ | ||
| 350 | static int parse_model_number(H3270 *session, const char *m) | 347 | static int parse_model_number(H3270 *session, const char *m) |
| 351 | { | 348 | { |
| 352 | int sl; | 349 | int sl; |
| @@ -426,17 +423,17 @@ void check_session_handle(H3270 **hSession) | @@ -426,17 +423,17 @@ void check_session_handle(H3270 **hSession) | ||
| 426 | if(*hSession) | 423 | if(*hSession) |
| 427 | return; | 424 | return; |
| 428 | 425 | ||
| 429 | -#ifdef DEBUG | ||
| 430 | - trace("** %s called with hSession == NULL",fname); | ||
| 431 | -#endif | 426 | + *hSession = lib3270_get_default_session_handle(); |
| 432 | 427 | ||
| 433 | - *hSession = &h3270; | 428 | + lib3270_write_log(*hSession,"%s called with empty session",__FUNCTION__); |
| 434 | } | 429 | } |
| 435 | 430 | ||
| 436 | - | ||
| 437 | LIB3270_EXPORT H3270 * lib3270_get_default_session_handle(void) | 431 | LIB3270_EXPORT H3270 * lib3270_get_default_session_handle(void) |
| 438 | { | 432 | { |
| 439 | - return &h3270; | 433 | + if(default_session) |
| 434 | + return default_session; | ||
| 435 | + | ||
| 436 | + return lib3270_session_new(""); | ||
| 440 | } | 437 | } |
| 441 | 438 | ||
| 442 | LIB3270_EXPORT void * lib3270_get_widget(H3270 *h) | 439 | LIB3270_EXPORT void * lib3270_get_widget(H3270 *h) |
src/lib3270/toggles.c
| @@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
| 43 | //#include "appres.h" | 43 | //#include "appres.h" |
| 44 | 44 | ||
| 45 | #include "ansic.h" | 45 | #include "ansic.h" |
| 46 | -#include "actionsc.h" | 46 | +//#include "actionsc.h" |
| 47 | #include "ctlrc.h" | 47 | #include "ctlrc.h" |
| 48 | #include "popupsc.h" | 48 | #include "popupsc.h" |
| 49 | #include "screenc.h" | 49 | #include "screenc.h" |
src/lib3270/trace_ds.c
| @@ -54,16 +54,16 @@ | @@ -54,16 +54,16 @@ | ||
| 54 | #include <fcntl.h> | 54 | #include <fcntl.h> |
| 55 | #include "3270ds.h" | 55 | #include "3270ds.h" |
| 56 | //#include "appres.h" | 56 | //#include "appres.h" |
| 57 | -#include "objects.h" | 57 | +// #include "objects.h" |
| 58 | #include "resources.h" | 58 | #include "resources.h" |
| 59 | // #include "ctlr.h" | 59 | // #include "ctlr.h" |
| 60 | 60 | ||
| 61 | #include "charsetc.h" | 61 | #include "charsetc.h" |
| 62 | -#include "childc.h" | 62 | +// #include "childc.h" |
| 63 | #include "ctlrc.h" | 63 | #include "ctlrc.h" |
| 64 | #include "popupsc.h" | 64 | #include "popupsc.h" |
| 65 | -#include "printc.h" | ||
| 66 | -#include "savec.h" | 65 | +// #include "printc.h" |
| 66 | +// #include "savec.h" | ||
| 67 | #include "tablesc.h" | 67 | #include "tablesc.h" |
| 68 | #include "telnetc.h" | 68 | #include "telnetc.h" |
| 69 | #include "trace_dsc.h" | 69 | #include "trace_dsc.h" |
src/pw3270/v3270/oia.c
| @@ -505,7 +505,9 @@ void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_me | @@ -505,7 +505,9 @@ void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_me | ||
| 505 | #ifdef HAVE_PRINTER | 505 | #ifdef HAVE_PRINTER |
| 506 | { V3270_OIA_PRINTER, setup_single_char_right }, | 506 | { V3270_OIA_PRINTER, setup_single_char_right }, |
| 507 | #endif // HAVE_PRINTER | 507 | #endif // HAVE_PRINTER |
| 508 | +#ifdef HAVE_SCRIPT | ||
| 508 | { V3270_OIA_SCRIPT, setup_single_char_right }, | 509 | { V3270_OIA_SCRIPT, setup_single_char_right }, |
| 510 | +#endif // HAVE_SCRIPT | ||
| 509 | { V3270_OIA_INSERT, setup_insert_position }, | 511 | { V3270_OIA_INSERT, setup_insert_position }, |
| 510 | { V3270_OIA_TYPEAHEAD, setup_single_char_right }, | 512 | { V3270_OIA_TYPEAHEAD, setup_single_char_right }, |
| 511 | { V3270_OIA_SHIFT, setup_double_char_position }, | 513 | { V3270_OIA_SHIFT, setup_double_char_position }, |
| @@ -1051,7 +1053,20 @@ void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on) | @@ -1051,7 +1053,20 @@ void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on) | ||
| 1051 | update_text_field(terminal,on,V3270_OIA_TYPEAHEAD,"T"); | 1053 | update_text_field(terminal,on,V3270_OIA_TYPEAHEAD,"T"); |
| 1052 | break; | 1054 | break; |
| 1053 | 1055 | ||
| 1056 | +#ifdef HAVE_PRINTER | ||
| 1057 | + case LIB3270_FLAG_PRINTER: | ||
| 1058 | + update_text_field(terminal,on,V3270_OIA_PRINTER,"P"); | ||
| 1059 | + break; | ||
| 1060 | +#endif // HAVE_PRINTER | ||
| 1061 | + | ||
| 1062 | +#ifdef HAVE_SCRIPT | ||
| 1063 | + case LIB3270_FLAG_SCRIPT: | ||
| 1064 | + update_text_field(terminal,on,V3270_OIA_SCRIPT,"S"); | ||
| 1065 | + break; | ||
| 1066 | +#endif // HAVE_SCRIPT | ||
| 1067 | + | ||
| 1054 | default: | 1068 | default: |
| 1055 | return; | 1069 | return; |
| 1056 | } | 1070 | } |
| 1071 | + | ||
| 1057 | } | 1072 | } |