diff --git a/pw3270.cbp b/pw3270.cbp
index 903da14..b81001e 100644
--- a/pw3270.cbp
+++ b/pw3270.cbp
@@ -73,7 +73,6 @@
-
@@ -88,7 +87,6 @@
-
@@ -119,11 +117,9 @@
-
-
@@ -138,13 +134,10 @@
-
-
-
@@ -160,13 +153,11 @@
-
-
diff --git a/src/include/lib3270.h b/src/include/lib3270.h
index 75f4482..0a3a1ef 100644
--- a/src/include/lib3270.h
+++ b/src/include/lib3270.h
@@ -153,11 +153,10 @@
{
LIB3270_FLAG_BOXSOLID, /**< System available */
LIB3270_FLAG_UNDERA, /**< Control Unit STATUS */
-// LIB3270_FLAG_SECURE, /**< Security status */
LIB3270_FLAG_TYPEAHEAD,
-// LIB3270_FLAG_PRINTER,
+ LIB3270_FLAG_PRINTER, /**< Printer session status */
LIB3270_FLAG_REVERSE,
- LIB3270_FLAG_SCRIPT,
+ LIB3270_FLAG_SCRIPT, /**< Script status */
LIB3270_FLAG_COUNT
diff --git a/src/include/lib3270/config.h.in b/src/include/lib3270/config.h.in
index 9eccfb0..e5ed01d 100644
--- a/src/include/lib3270/config.h.in
+++ b/src/include/lib3270/config.h.in
@@ -62,9 +62,8 @@
#define X3270_TRACE
#undef HAVE_PRINTER
+ #undef HAVE_SCRIPT
- #undef HAVE_IGEMAC
- #undef HAVE_MACUI
#undef HAVE_MALLOC_H
#endif /* LIB3270_CONFIG_INCLUDED */
diff --git a/src/include/v3270.h b/src/include/v3270.h
index fab21d0..1efe98a 100644
--- a/src/include/v3270.h
+++ b/src/include/v3270.h
@@ -104,7 +104,9 @@
V3270_OIA_SHIFT, /**< Shift Status */
V3270_OIA_TYPEAHEAD, /**< Typeahead indication ("T" or blank) */
V3270_OIA_INSERT, /**< Insert mode indication (Special symbol/"I" or blank) */
+#ifdef HAVE_SCRIPT
V3270_OIA_SCRIPT, /**< Script indication ("S" or blank) */
+#endif // HAVE_SCRIPT
V3270_OIA_LUNAME, /**< LU Name */
V3270_OIA_SPINNER, /**< command timing spinner */
V3270_OIA_TIMER, /**< command timing (mmm:ss, or blank) */
diff --git a/src/lib3270/actionsc.h b/src/lib3270/actionsc.h
index 91d8a94..f2f0dcd 100644
--- a/src/lib3270/actionsc.h
+++ b/src/lib3270/actionsc.h
@@ -17,27 +17,21 @@
* Global declarations for actions.c.
*/
+#error Deprecated
+
// extern enum iaction ia_cause;
-extern int actioncount;
+// extern int actioncount;
// extern XtActionsRec *actions;
// extern const char *ia_name[];
-// #if defined(X3270_TRACE) /*[*/
-// extern void action_debug(XtActionProc action, XEvent *event, String *params, Cardinal *num_params);
-// #else /*][*/
-// #define action_debug(a, e, p, n)
-// #endif /*]*/
-
-extern void action_init(void);
+// extern void action_init(void);
// extern void action_internal(XtActionProc action, enum iaction cause, const char *parm1, const char *parm2);
-#define action_name(x) #x
-// extern const char *action_name(XtActionProc action);
-// extern int check_usage(XtActionProc action, Cardinal nargs, Cardinal nargs_min, Cardinal nargs_max);
+// #define action_name(x) #x
-extern Boolean event_is_meta(int state);
+// extern Boolean event_is_meta(int state);
diff --git a/src/lib3270/ansi.c b/src/lib3270/ansi.c
index 12c1297..9774c34 100644
--- a/src/lib3270/ansi.c
+++ b/src/lib3270/ansi.c
@@ -52,7 +52,7 @@
#include "ctlrc.h"
#include "hostc.h"
#include "screenc.h"
-#include "scrollc.h"
+// #include "scrollc.h"
#include "tablesc.h"
#include "telnetc.h"
#include "trace_dsc.h"
diff --git a/src/lib3270/api.h b/src/lib3270/api.h
index 5f22fcd..056dc5e 100644
--- a/src/lib3270/api.h
+++ b/src/lib3270/api.h
@@ -153,7 +153,7 @@
// #define OIA_FLAG_SECURE LIB3270_FLAG_SECURE
#define OIA_FLAG_TYPEAHEAD LIB3270_FLAG_TYPEAHEAD
// #define OIA_FLAG_PRINTER LIB3270_FLAG_PRINTER
- #define OIA_FLAG_REVERSE LIB3270_FLAG_REVERSE
+// #define OIA_FLAG_REVERSE LIB3270_FLAG_REVERSE
#define OIA_FLAG_USER LIB3270_FLAG_COUNT
#define OIA_FLAG LIB3270_FLAG
diff --git a/src/lib3270/charsetc.h b/src/lib3270/charsetc.h
index ab2e612..ff5ce31 100644
--- a/src/lib3270/charsetc.h
+++ b/src/lib3270/charsetc.h
@@ -25,7 +25,7 @@
*/
// LIB3270_INTERNAL Boolean charset_changed;
-LIB3270_INTERNAL unsigned long cgcsgid;
+// LIB3270_INTERNAL unsigned long cgcsgid;
/*
#if defined(X3270_DBCS)
diff --git a/src/lib3270/childc.h b/src/lib3270/childc.h
index b3dd5ab..4fbef59 100644
--- a/src/lib3270/childc.h
+++ b/src/lib3270/childc.h
@@ -26,3 +26,5 @@ LIB3270_INTERNAL void child_ignore_output(void);
#define child_ignore_output()
#endif
*/
+
+#error Deprecated
diff --git a/src/lib3270/ctlr.c b/src/lib3270/ctlr.c
index eb774dc..d97ca9a 100644
--- a/src/lib3270/ctlr.c
+++ b/src/lib3270/ctlr.c
@@ -53,7 +53,7 @@
#include "kybdc.h"
#include "popupsc.h"
#include "screenc.h"
-#include "scrollc.h"
+// #include "scrollc.h"
#include "seec.h"
#include "sf.h"
#include "statusc.h"
diff --git a/src/lib3270/ctlrc.h b/src/lib3270/ctlrc.h
index ca2cd44..6f8fac1 100644
--- a/src/lib3270/ctlrc.h
+++ b/src/lib3270/ctlrc.h
@@ -72,14 +72,14 @@ LIB3270_INTERNAL void ctlr_erase(H3270 *session, int alt);
LIB3270_INTERNAL void ticking_start(H3270 *session, Boolean anyway);
enum dbcs_state {
- DBCS_NONE = 0, /* position is not DBCS */
- DBCS_LEFT, /* position is left half of DBCS character */
- DBCS_RIGHT, /* position is right half of DBCS character */
- DBCS_SI, /* position is SI terminating DBCS subfield */
- DBCS_SB, /* position is SBCS character after the SI */
- DBCS_LEFT_WRAP, /* position is left half of split DBCS */
- DBCS_RIGHT_WRAP, /* position is right half of split DBCS */
- DBCS_DEAD /* position is dead left-half DBCS */
+ DBCS_NONE = 0, /**< position is not DBCS */
+ DBCS_LEFT, /**< position is left half of DBCS character */
+ DBCS_RIGHT, /**< position is right half of DBCS character */
+ DBCS_SI, /**< position is SI terminating DBCS subfield */
+ DBCS_SB, /**< position is SBCS character after the SI */
+ DBCS_LEFT_WRAP, /**< position is left half of split DBCS */
+ DBCS_RIGHT_WRAP, /**< position is right half of split DBCS */
+ DBCS_DEAD /**< position is dead left-half DBCS */
};
#define IS_LEFT(d) ((d) == DBCS_LEFT || (d) == DBCS_LEFT_WRAP)
#define IS_RIGHT(d) ((d) == DBCS_RIGHT || (d) == DBCS_RIGHT_WRAP)
diff --git a/src/lib3270/ft.c b/src/lib3270/ft.c
index e8ac46d..2c505f5 100644
--- a/src/lib3270/ft.c
+++ b/src/lib3270/ft.c
@@ -41,7 +41,7 @@
#endif // HAVE_MALLOC_H
//#include "appres.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "ft_cutc.h"
#include "ft_dftc.h"
#include "ftc.h"
@@ -52,7 +52,7 @@
#endif
*/
#include "kybdc.h"
-#include "objects.h"
+// #include "objects.h"
#include "popupsc.h"
#include "screenc.h"
#include "tablesc.h"
diff --git a/src/lib3270/ft_cut.c b/src/lib3270/ft_cut.c
index a8ac0b6..5809aca 100644
--- a/src/lib3270/ft_cut.c
+++ b/src/lib3270/ft_cut.c
@@ -42,7 +42,7 @@
#if defined(X3270_FT) /*[*/
#include "3270ds.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "ctlrc.h"
#include "ft_cutc.h"
#include "ft_cut_ds.h"
diff --git a/src/lib3270/ft_dft.c b/src/lib3270/ft_dft.c
index 53a20a2..95f34e7 100644
--- a/src/lib3270/ft_dft.c
+++ b/src/lib3270/ft_dft.c
@@ -45,7 +45,7 @@
#include "3270ds.h"
#include "ft_dft_ds.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "kybdc.h"
#include "ft_dftc.h"
#include "ftc.h"
diff --git a/src/lib3270/globals.h b/src/lib3270/globals.h
index 5abd741..0b6a30b 100644
--- a/src/lib3270/globals.h
+++ b/src/lib3270/globals.h
@@ -69,6 +69,7 @@
#define N_( x ) x
#endif // HAVE_LIBINTL
+#define action_name(x) #x
/*
* OS-specific #defines. Except for the blocking-connect workarounds, these
diff --git a/src/lib3270/glue.c b/src/lib3270/glue.c
index 7c8210d..8c457ec 100644
--- a/src/lib3270/glue.c
+++ b/src/lib3270/glue.c
@@ -53,11 +53,11 @@
#include "3270ds.h"
#include "resources.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "ansic.h"
#include "charsetc.h"
#include "ctlrc.h"
-#include "gluec.h"
+// #include "gluec.h"
#include "hostc.h"
// #include "keymapc.h"
#include "kybdc.h"
@@ -71,7 +71,7 @@
#include "trace_dsc.h"
#include "utilc.h"
// #include "idlec.h"
-#include "printerc.h"
+// #include "printerc.h"
#if defined(X3270_FT)
#include "ftc.h"
diff --git a/src/lib3270/gluec.h b/src/lib3270/gluec.h
index e1c5956..f359f30 100644
--- a/src/lib3270/gluec.h
+++ b/src/lib3270/gluec.h
@@ -21,11 +21,13 @@
// extern int parse_command_line(int argc, const char **argv, const char **cl_hostname);
// extern int parse_program_parameters(int argc, const char **argv);
// LIB3270_INTERNAL void parse_xrm(const char *arg, const char *where);
-LIB3270_INTERNAL void notify_ssl_error(H3270 *session, const char *title, const char *msg, const char *state, const char *alert);
+// LIB3270_INTERNAL void notify_ssl_error(H3270 *session, const char *title, const char *msg, const char *state, const char *alert);
/* XtGlue.c */
-LIB3270_INTERNAL void (*Warning_redirect)(const char *);
+// LIB3270_INTERNAL void (*Warning_redirect)(const char *);
-#if !defined(_WIN32) /*[*/
-LIB3270_INTERNAL int select_setup(int *nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval **timeout, struct timeval *timebuf);
-#endif /*]*/
+// #if !defined(_WIN32)
+// LIB3270_INTERNAL int select_setup(int *nfds, fd_set *readfds, fd_set *writefds,fd_set *exceptfds, struct timeval **timeout, struct timeval *timebuf);
+// #endif
+
+#error Deprecated
diff --git a/src/lib3270/host.c b/src/lib3270/host.c
index dd22be3..0b495ed 100644
--- a/src/lib3270/host.c
+++ b/src/lib3270/host.c
@@ -42,7 +42,7 @@
// #include "appres.h"
#include "resources.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "hostc.h"
#include "statusc.h"
#include "popupsc.h"
diff --git a/src/lib3270/icmdc.h b/src/lib3270/icmdc.h
index 0171ebd..690c545 100644
--- a/src/lib3270/icmdc.h
+++ b/src/lib3270/icmdc.h
@@ -17,4 +17,6 @@
* Declarations for icmd.c.
*/
-LIB3270_INTERNAL int interactive_transfer(String **params, Cardinal *num_params);
+// LIB3270_INTERNAL int interactive_transfer(String **params, Cardinal *num_params);
+
+#error Deprecated
diff --git a/src/lib3270/keypadc.h b/src/lib3270/keypadc.h
index 14d1ea3..0ff2bc1 100644
--- a/src/lib3270/keypadc.h
+++ b/src/lib3270/keypadc.h
@@ -49,3 +49,5 @@ LIB3270_INTERNAL Dimension min_keypad_width(void);
#endif
*/
+
+#error Deprecated
diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c
index d389415..7a3ae40 100644
--- a/src/lib3270/kybd.c
+++ b/src/lib3270/kybd.c
@@ -59,7 +59,7 @@ struct ta;
// #include "ctlr.h"
#include "resources.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "ansic.h"
//#include "aplc.h"
#include "ctlrc.h"
@@ -68,7 +68,7 @@ struct ta;
// #include "keypadc.h"
#include "kybdc.h"
#include "popupsc.h"
-#include "printc.h"
+// #include "printc.h"
#include "screenc.h"
// #if defined(X3270_DISPLAY) /*[*/
// #include "selectc.h"
diff --git a/src/lib3270/localdefs.h b/src/lib3270/localdefs.h
index 0883085..b1226b4 100644
--- a/src/lib3270/localdefs.h
+++ b/src/lib3270/localdefs.h
@@ -33,12 +33,12 @@
/* These first definitions were cribbed from X11 -- but no X code is used. */
#define False 0
#define True 1
-typedef void *XtPointer;
-typedef void *Widget;
-typedef void *XEvent;
+//typedef void *XtPointer;
+// typedef void *Widget;
+// typedef void *XEvent;
typedef char Boolean;
typedef char *String;
-typedef unsigned int Cardinal;
+// typedef unsigned int Cardinal;
typedef unsigned long KeySym;
#define Bool int
diff --git a/src/lib3270/objects.h b/src/lib3270/objects.h
index c0ce6bd..7e42ab4 100644
--- a/src/lib3270/objects.h
+++ b/src/lib3270/objects.h
@@ -20,7 +20,9 @@
// #define ObjConfirmButton "confirmButton"
// #define ObjConfirm2Button "confirm2Button"
// #define ObjCancelButton "cancelButton"
-#define ObjDialog "dialog"
+// #define ObjDialog "dialog"
// #define ObjSmallLabel "smallLabel"
-#define ObjNameLabel "nameLabel"
-#define ObjDataLabel "dataLabel"
+// #define ObjNameLabel "nameLabel"
+// #define ObjDataLabel "dataLabel"
+
+#error Deprecated
diff --git a/src/lib3270/paste.c b/src/lib3270/paste.c
index 5b5bf28..8cf93e5 100644
--- a/src/lib3270/paste.c
+++ b/src/lib3270/paste.c
@@ -49,7 +49,7 @@
#include "3270ds.h"
#include "resources.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "ansic.h"
//#include "aplc.h"
#include "ctlrc.h"
@@ -58,7 +58,7 @@
// #include "keypadc.h"
#include "kybdc.h"
#include "popupsc.h"
-#include "printc.h"
+// #include "printc.h"
#include "screenc.h"
/*
diff --git a/src/lib3270/printc.h b/src/lib3270/printc.h
index 4b4a64f..f49332c 100644
--- a/src/lib3270/printc.h
+++ b/src/lib3270/printc.h
@@ -18,13 +18,10 @@
*/
// LIB3270_INTERNAL Boolean fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html);
-LIB3270_INTERNAL void PrintText_action(Widget w, XEvent *event, String *params,
- Cardinal *num_params);
-LIB3270_INTERNAL void PrintWindow_action(Widget w, XEvent *event, String *params,
- Cardinal *num_params);
-LIB3270_INTERNAL void print_text_option(Widget w, XtPointer client_data,
- XtPointer call_data);
-LIB3270_INTERNAL void print_window_option(Widget w, XtPointer client_data,
- XtPointer call_data);
-LIB3270_INTERNAL void save_text_option(Widget w, XtPointer client_data,
- XtPointer call_data);
+// LIB3270_INTERNAL void PrintText_action(Widget w, XEvent *event, String *params,Cardinal *num_params);
+// LIB3270_INTERNAL void PrintWindow_action(Widget w, XEvent *event, String *params,Cardinal *num_params);
+// LIB3270_INTERNAL void print_text_option(Widget w, XtPointer client_data,XtPointer call_data);
+// LIB3270_INTERNAL void print_window_option(Widget w, XtPointer client_data,XtPointer call_data);
+// LIB3270_INTERNAL void save_text_option(Widget w, XtPointer client_data,XtPointer call_data);
+
+#error Deprecated
diff --git a/src/lib3270/printerc.h b/src/lib3270/printerc.h
index 00d6dd3..bf4eff2 100644
--- a/src/lib3270/printerc.h
+++ b/src/lib3270/printerc.h
@@ -25,3 +25,5 @@
#if defined(_WIN32) /*[*/
// LIB3270_INTERNAL void printer_check(void);
#endif /*]*/
+
+#error Deprecated
diff --git a/src/lib3270/savec.h b/src/lib3270/savec.h
index 5aa4bf6..27646a4 100644
--- a/src/lib3270/savec.h
+++ b/src/lib3270/savec.h
@@ -20,3 +20,6 @@
LIB3270_INTERNAL char *command_string;
*/
+
+
+#error Deprecated
diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c
index 8608848..4842f40 100644
--- a/src/lib3270/screen.c
+++ b/src/lib3270/screen.c
@@ -42,7 +42,7 @@
#include "resources.h"
// #include "ctlr.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "ctlrc.h"
#include "hostc.h"
#include "kybdc.h"
diff --git a/src/lib3270/scrollc.h b/src/lib3270/scrollc.h
index 4cfb82e..93a98b1 100644
--- a/src/lib3270/scrollc.h
+++ b/src/lib3270/scrollc.h
@@ -16,3 +16,5 @@
// #define scroll_save(n, trim_blanks)
// #define scroll_to_bottom()
+
+#error Deprecated
diff --git a/src/lib3270/session.c b/src/lib3270/session.c
index 3993b41..3b16911 100644
--- a/src/lib3270/session.c
+++ b/src/lib3270/session.c
@@ -48,7 +48,7 @@
/*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/
- static H3270 h3270;
+ static H3270 *default_session = NULL;
/*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/
@@ -60,6 +60,9 @@ void lib3270_session_free(H3270 *h)
{
int f;
+ if(!h)
+ return;
+
// Terminate session
if(lib3270_connected(h))
lib3270_disconnect(h);
@@ -91,6 +94,11 @@ void lib3270_session_free(H3270 *h)
release_pointer(h->buffer[f]);
}
+ if(h == default_session)
+ default_session = NULL;
+
+ lib3270_free(h);
+
}
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)
initialize_tables(hSession);
// Default calls
- hSession->write = lib3270_sock_send;
- hSession->disconnect = lib3270_sock_disconnect;
- hSession->update = update_char;
- hSession->update_model = update_model;
- hSession->update_cursor = update_cursor;
- hSession->set_selection = nop_char;
- hSession->ctlr_done = nop;
- hSession->changed = changed;
- hSession->erase = screen_disp;
- hSession->suspend = nop;
- hSession->resume = screen_disp;
- hSession->update_oia = update_oia;
- hSession->update_selection = update_selection;
- hSession->cursor = set_cursor;
- hSession->message = message;
- hSession->update_ssl = update_ssl;
- hSession->display = screen_disp;
- hSession->set_width = set_width;
+ hSession->write = lib3270_sock_send;
+ hSession->disconnect = lib3270_sock_disconnect;
+ hSession->update = update_char;
+ hSession->update_model = update_model;
+ hSession->update_cursor = update_cursor;
+ hSession->set_selection = nop_char;
+ hSession->ctlr_done = nop;
+ hSession->changed = changed;
+ hSession->erase = screen_disp;
+ hSession->suspend = nop;
+ hSession->resume = screen_disp;
+ hSession->update_oia = update_oia;
+ hSession->update_selection = update_selection;
+ hSession->cursor = set_cursor;
+ hSession->message = message;
+ hSession->update_ssl = update_ssl;
+ hSession->display = screen_disp;
+ hSession->set_width = set_width;
// Set the defaults.
- hSession->extended = 1;
- hSession->typeahead = 1;
- hSession->oerr_lock = 1;
- hSession->unlock_delay = 1;
- hSession->icrnl = 1;
- hSession->onlcr = 1;
- hSession->host_charset = "bracket";
- hSession->sock = -1;
- hSession->model_num = -1;
- hSession->cstate = LIB3270_NOT_CONNECTED;
- hSession->oia_status = -1;
- hSession->kybdlock = KL_NOT_CONNECTED;
- hSession->aid = AID_NO;
- hSession->reply_mode = SF_SRM_FIELD;
- hSession->linemode = 1;
- hSession->tn3270e_submode = E_NONE;
- hSession->scroll_top = -1;
- hSession->scroll_bottom = -1;
- hSession->wraparound_mode = 1;
+ hSession->extended = 1;
+ hSession->typeahead = 1;
+ hSession->oerr_lock = 1;
+ hSession->unlock_delay = 1;
+ hSession->icrnl = 1;
+ hSession->onlcr = 1;
+ hSession->host_charset = "bracket";
+ hSession->sock = -1;
+ hSession->model_num = -1;
+ hSession->cstate = LIB3270_NOT_CONNECTED;
+ hSession->oia_status = -1;
+ hSession->kybdlock = KL_NOT_CONNECTED;
+ hSession->aid = AID_NO;
+ hSession->reply_mode = SF_SRM_FIELD;
+ hSession->linemode = 1;
+ hSession->tn3270e_submode = E_NONE;
+ hSession->scroll_top = -1;
+ hSession->scroll_bottom = -1;
+ hSession->wraparound_mode = 1;
hSession->saved_wraparound_mode = 1;
hSession->once_cset = -1;
hSession->state = LIB3270_ANSI_STATE_DATA;
@@ -222,19 +230,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model)
#endif // _WIN32
-/*
-#if !defined(_WIN32)
- hSession->host_charset = "bracket";
-#else
-
- if (is_nt)
- hSession->host_charset = "bracket";
- else
- hSession->host_charset = "bracket437";
-#endif
-*/
-
-
// Initialize toggles
initialize_toggles(hSession);
@@ -296,20 +291,18 @@ static void lib3270_session_init(H3270 *hSession, const char *model)
H3270 * lib3270_session_new(const char *model)
{
- static int configured = 0;
-
- H3270 *hSession = &h3270;
+ H3270 * hSession;
- trace("%s - configured=%d",__FUNCTION__,configured);
+ trace("%s - configured=%s",__FUNCTION__,default_session ? "Yes" : "No");
- if(configured)
+ if(default_session)
{
// TODO (perry#5#): Allocate a new structure.
errno = EBUSY;
- return hSession;
+ return lib3270_get_default_session_handle();
}
- configured = 1;
+ hSession = default_session = lib3270_malloc(sizeof(H3270));
lib3270_session_init(hSession, model);
@@ -343,10 +336,14 @@ H3270 * lib3270_session_new(const char *model)
return hSession;
}
- /*
-- * Parse the model number.
-- * Returns -1 (error), 0 (default), or the specified number.
-- */
+ /**
+ * Parse the model number.
+ *
+ * @param session Session Handle.
+ * @param m Model number.
+ *
+ * @return -1 (error), 0 (default), or the specified number.
+ */
static int parse_model_number(H3270 *session, const char *m)
{
int sl;
@@ -426,17 +423,17 @@ void check_session_handle(H3270 **hSession)
if(*hSession)
return;
-#ifdef DEBUG
- trace("** %s called with hSession == NULL",fname);
-#endif
+ *hSession = lib3270_get_default_session_handle();
- *hSession = &h3270;
+ lib3270_write_log(*hSession,"%s called with empty session",__FUNCTION__);
}
-
LIB3270_EXPORT H3270 * lib3270_get_default_session_handle(void)
{
- return &h3270;
+ if(default_session)
+ return default_session;
+
+ return lib3270_session_new("");
}
LIB3270_EXPORT void * lib3270_get_widget(H3270 *h)
diff --git a/src/lib3270/toggles.c b/src/lib3270/toggles.c
index 5b3a8f9..291c2aa 100644
--- a/src/lib3270/toggles.c
+++ b/src/lib3270/toggles.c
@@ -43,7 +43,7 @@
//#include "appres.h"
#include "ansic.h"
-#include "actionsc.h"
+//#include "actionsc.h"
#include "ctlrc.h"
#include "popupsc.h"
#include "screenc.h"
diff --git a/src/lib3270/trace_ds.c b/src/lib3270/trace_ds.c
index 8b40239..cc283d9 100644
--- a/src/lib3270/trace_ds.c
+++ b/src/lib3270/trace_ds.c
@@ -54,16 +54,16 @@
#include
#include "3270ds.h"
//#include "appres.h"
-#include "objects.h"
+// #include "objects.h"
#include "resources.h"
// #include "ctlr.h"
#include "charsetc.h"
-#include "childc.h"
+// #include "childc.h"
#include "ctlrc.h"
#include "popupsc.h"
-#include "printc.h"
-#include "savec.h"
+// #include "printc.h"
+// #include "savec.h"
#include "tablesc.h"
#include "telnetc.h"
#include "trace_dsc.h"
diff --git a/src/pw3270/v3270/oia.c b/src/pw3270/v3270/oia.c
index a1416ee..24c6d3a 100644
--- a/src/pw3270/v3270/oia.c
+++ b/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
#ifdef HAVE_PRINTER
{ V3270_OIA_PRINTER, setup_single_char_right },
#endif // HAVE_PRINTER
+#ifdef HAVE_SCRIPT
{ V3270_OIA_SCRIPT, setup_single_char_right },
+#endif // HAVE_SCRIPT
{ V3270_OIA_INSERT, setup_insert_position },
{ V3270_OIA_TYPEAHEAD, setup_single_char_right },
{ V3270_OIA_SHIFT, setup_double_char_position },
@@ -1051,7 +1053,20 @@ void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on)
update_text_field(terminal,on,V3270_OIA_TYPEAHEAD,"T");
break;
+#ifdef HAVE_PRINTER
+ case LIB3270_FLAG_PRINTER:
+ update_text_field(terminal,on,V3270_OIA_PRINTER,"P");
+ break;
+#endif // HAVE_PRINTER
+
+#ifdef HAVE_SCRIPT
+ case LIB3270_FLAG_SCRIPT:
+ update_text_field(terminal,on,V3270_OIA_SCRIPT,"S");
+ break;
+#endif // HAVE_SCRIPT
+
default:
return;
}
+
}
--
libgit2 0.21.2