diff --git a/src/classlib/local.cc b/src/classlib/local.cc index 0ba7485..5d9e256 100644 --- a/src/classlib/local.cc +++ b/src/classlib/local.cc @@ -425,7 +425,7 @@ int set_host(const char *uri) { - return _set_host(hSession,uri) != NULL ? 1 : 0; + return (_set_host(hSession,uri) == NULL) ? 0 : 1; } int disconnect(void) diff --git a/src/include/lib3270.h b/src/include/lib3270.h index c4ddf9f..e31b4bf 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -244,18 +244,24 @@ */ typedef enum lib3270_option { - LIB3270_OPTION_DEFAULTS = 0x0000, - LIB3270_OPTION_AS400 = 0x0001, /**< Prefix every PF with PA1 */ + /* Host types */ + LIB3270_OPTION_AS400 = 0x0001, /**< AS400 host - Prefix every PF with PA1 */ LIB3270_OPTION_TSO = 0x0002, /**< Host is TSO? */ - LIB3270_OPTION_SSL = 0x0004, + LIB3270_OPTION_S390 = 0x0006, /**< Host is S390? (TSO included) */ + + /* Other options */ + LIB3270_OPTION_SSL = 0x0010, /**< Secure connection ? */ + LIB3270_OPTION_WAIT = 0x8000 /**< Wait for session ready on connect ? */ } LIB3270_OPTION; + #define LIB3270_OPTION_HOST_TYPE 0x0007 + #define LIB3270_OPTION_DEFAULTS LIB3270_OPTION_S390 // LIB3270_OPTION_COLOR8 = 0x0001, /**< If active, pw3270 will respond to a Query(Color) with a list of 8 supported colors. */ - #define LIB3270_OPTION_DEFAULT 0 +// #define LIB3270_OPTION_DEFAULT 0 #define LIB3270_OPTION_COUNT 3 typedef struct _lib3270_option_entry @@ -1045,7 +1051,9 @@ LIB3270_EXPORT int lib3270_clear_operator_error(H3270 *hSession); LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt); + LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colortype); + LIB3270_EXPORT unsigned short lib3270_get_color_type(H3270 *hSession); LIB3270_EXPORT const LIB3270_OPTION_ENTRY * lib3270_get_option_list(void); diff --git a/src/include/lib3270/session.h b/src/include/lib3270/session.h index 366652d..62495f6 100644 --- a/src/include/lib3270/session.h +++ b/src/include/lib3270/session.h @@ -101,7 +101,7 @@ int oerr_lock : 1; int unlock_delay : 1; int auto_reconnect_inprogress : 1; - int colors : 5; + unsigned int colors : 5; int apl_mode : 1; int icrnl : 1; int inlcr : 1; diff --git a/src/include/pw3270/v3270.h b/src/include/pw3270/v3270.h index e3ed671..d914104 100644 --- a/src/include/pw3270/v3270.h +++ b/src/include/pw3270/v3270.h @@ -227,8 +227,13 @@ LIB3270_EXPORT const gchar * v3270_get_ssl_status_message(GtkWidget *widget); LIB3270_EXPORT void v3270_popup_security_dialog(GtkWidget *widget); + // File transfer LIB3270_EXPORT gint v3270_transfer_file(GtkWidget *widget, LIB3270_FT_OPTION options, const gchar *local, const gchar *remote, int lrecl, int blksize, int primspace, int secspace, int dft); + // Auxiliary widgets + LIB3270_EXPORT GtkWidget * v3270_host_select_new(GtkWidget *widget); + + G_END_DECLS #endif // V3270_H_INCLUDED diff --git a/src/lib3270/options.c b/src/lib3270/options.c index 8aca9f0..588b62e 100644 --- a/src/lib3270/options.c +++ b/src/lib3270/options.c @@ -77,6 +77,16 @@ LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt) hSession->options = opt; } +LIB3270_EXPORT unsigned short lib3270_get_color_type(H3270 *hSession) +{ + CHECK_SESSION_HANDLE(hSession); + + trace("******************* %d",hSession->colors); + + return hSession->mono ? 2 : hSession->colors; +} + + LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colortype) { CHECK_SESSION_HANDLE(hSession); diff --git a/src/lib3270/session.c b/src/lib3270/session.c index ec16fdd..7ddde39 100644 --- a/src/lib3270/session.c +++ b/src/lib3270/session.c @@ -303,6 +303,9 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char hSession->saved_wraparound_mode = 1; hSession->once_cset = -1; hSession->state = LIB3270_ANSI_STATE_DATA; + hSession->options = LIB3270_OPTION_DEFAULTS; + hSession->colors = 16; + hSession->m3279 = 1; for(f=0;f<4;f++) hSession->csd[f] = hSession->saved_csd[f] = LIB3270_ANSI_CSD_US; diff --git a/src/pw3270/hostdialog.c b/src/pw3270/hostdialog.c index 199f7e9..027c18c 100644 --- a/src/pw3270/hostdialog.c +++ b/src/pw3270/hostdialog.c @@ -39,7 +39,7 @@ LIB3270_OPTION option; } host_type[] = { - { "S390", N_( "IBM S/390" ), LIB3270_OPTION_TSO }, + { "S390", N_( "IBM S/390" ), LIB3270_OPTION_S390 }, { "AS400", N_( "IBM AS/400" ), LIB3270_OPTION_AS400 }, { "TSO", N_( "Other (TSO)" ), LIB3270_OPTION_TSO }, { "VM/CMS", N_( "Other (VM/CMS)" ), 0 } diff --git a/src/pw3270/v3270/widget.c b/src/pw3270/v3270/widget.c index fb86eb1..713abd3 100644 --- a/src/pw3270/v3270/widget.c +++ b/src/pw3270/v3270/widget.c @@ -1552,6 +1552,12 @@ int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype) return lib3270_set_color_type(GTK_V3270(widget)->host,colortype); } +unsigned short v3270_get_session_color_type(GtkWidget *widget) +{ + g_return_val_if_fail(GTK_IS_V3270(widget),-1); + return lib3270_get_color_type(GTK_V3270(widget)->host); +} + gboolean v3270_is_connected(GtkWidget *widget) { g_return_val_if_fail(GTK_IS_V3270(widget),FALSE); -- libgit2 0.21.2