From b1377cfa6ad3c66ae5d6ae6f2d51d59fcbc06c6d Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Wed, 11 Dec 2013 01:06:48 +0000 Subject: [PATCH] Evitando redundancias no dialogo de configuracao de hostname --- options.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/options.c b/options.c index 326c4d0..fdd0df0 100644 --- a/options.c +++ b/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++) -- libgit2 0.21.2