diff --git a/src/include/lib3270.h b/src/include/lib3270.h index bb26b59..a24a53a 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -259,16 +259,11 @@ #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_COUNT 3 - typedef struct _lib3270_option_entry { - LIB3270_OPTION value; - const char * key; - const char * text; + LIB3270_OPTION option; + const char * name; + const char * description; const char * tooltip; } LIB3270_OPTION_ENTRY; @@ -398,7 +393,7 @@ * Set host id for the connect/reconnect operations. * * @param h Session handle. - * @param url URL of host to set in the format tn3270://hostname:service ou tn3270s://hostname:service . + * @param url URL of host to set in the format tn3270://hostname:service or tn3270s://hostname:service . * * @return Processed host url * @@ -415,7 +410,7 @@ */ LIB3270_EXPORT const char * lib3270_get_hostname(H3270 *h); - LIB3270_EXPORT void lib3270_set_hostname(H3270 *h, const char *hostname); + LIB3270_EXPORT void lib3270_set_hostname(H3270 *h, const char *hostname); /** diff --git a/src/lib3270/options.c b/src/lib3270/options.c index 326c4d0..fdd0df0 100644 --- a/src/lib3270/options.c +++ b/src/lib3270/options.c @@ -33,34 +33,32 @@ /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ - static const struct _host_type - { - const char * name; - LIB3270_OPTION option; - } host_type[] = - { - { "S390", LIB3270_OPTION_S390 }, - { "AS400", LIB3270_OPTION_AS400 }, - { "TSO", LIB3270_OPTION_TSO }, - { "VM/CMS", 0 } - }; - - /*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ - static const const LIB3270_OPTION_ENTRY options[LIB3270_OPTION_COUNT+1] = + static const const LIB3270_OPTION_ENTRY host_type[] = { { + LIB3270_OPTION_S390, + "S390", + N_( "IBM S/390" ), + NULL + }, + { LIB3270_OPTION_AS400, - "as400", - N_( "Host is AS/400" ), + "AS400", + N_( "IBM AS/400" ), NULL }, - { LIB3270_OPTION_TSO, - "tso", - N_( "Host is TSO" ), + "TSO", + N_( "Other (TSO)" ), + NULL + }, + { + 0, + "VM/CMS", + N_( "Other (VM/CMS)" ), NULL }, @@ -70,11 +68,9 @@ NULL, NULL } - }; - /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ LIB3270_EXPORT LIB3270_OPTION lib3270_get_options(H3270 *hSession) @@ -134,7 +130,7 @@ LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colort LIB3270_EXPORT const LIB3270_OPTION_ENTRY * lib3270_get_option_list(void) { - return options; + return host_type; } LIB3270_EXPORT int lib3270_is_tso(H3270 *hSession) @@ -145,6 +141,7 @@ LIB3270_EXPORT int lib3270_is_tso(H3270 *hSession) LIB3270_EXPORT LIB3270_OPTION lib3270_parse_host_type(const char *name) { + int f; for(f=0;f<(sizeof(host_type)/sizeof(host_type[0]));f++) diff --git a/src/pw3270/v3270/hostselect.c b/src/pw3270/v3270/hostselect.c index 3514823..5b59617 100644 --- a/src/pw3270/v3270/hostselect.c +++ b/src/pw3270/v3270/hostselect.c @@ -28,22 +28,11 @@ */ #include "hostselect.h" + #include #include /*--[ Widget definition ]----------------------------------------------------------------------------*/ - static const struct _host_type - { - const gchar * description; - LIB3270_OPTION option; - } host_type[] = - { - { N_( "IBM S/390" ), LIB3270_OPTION_S390 }, - { N_( "IBM AS/400" ), LIB3270_OPTION_AS400 }, - { N_( "Other (TSO)" ), LIB3270_OPTION_TSO }, - { N_( "Other (VM/CMS)" ), 0 } - }; - static const struct _colortable { unsigned short colors; @@ -191,11 +180,12 @@ static void V3270HostSelectWidget_init(V3270HostSelectWidget *widget) gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(widget->combo[0]), renderer, TRUE); gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(widget->combo[0]), renderer, "text", 0, NULL); - for(f=0;fcombo[0]),"changed",G_CALLBACK(systype_changed),widget); -- libgit2 0.21.2