Commit b1377cfa6ad3c66ae5d6ae6f2d51d59fcbc06c6d
1 parent
c4963841
Exists in
master
and in
3 other branches
Evitando redundancias no dialogo de configuracao de hostname
Showing
1 changed file
with
19 additions
and
22 deletions
Show diff stats
options.c
| @@ -33,34 +33,32 @@ | @@ -33,34 +33,32 @@ | ||
| 33 | 33 | ||
| 34 | /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ | 34 | /*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ |
| 35 | 35 | ||
| 36 | - static const struct _host_type | ||
| 37 | - { | ||
| 38 | - const char * name; | ||
| 39 | - LIB3270_OPTION option; | ||
| 40 | - } host_type[] = | ||
| 41 | - { | ||
| 42 | - { "S390", LIB3270_OPTION_S390 }, | ||
| 43 | - { "AS400", LIB3270_OPTION_AS400 }, | ||
| 44 | - { "TSO", LIB3270_OPTION_TSO }, | ||
| 45 | - { "VM/CMS", 0 } | ||
| 46 | - }; | ||
| 47 | - | ||
| 48 | - | ||
| 49 | /*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ | 36 | /*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ |
| 50 | 37 | ||
| 51 | - static const const LIB3270_OPTION_ENTRY options[LIB3270_OPTION_COUNT+1] = | 38 | + static const const LIB3270_OPTION_ENTRY host_type[] = |
| 52 | { | 39 | { |
| 53 | { | 40 | { |
| 41 | + LIB3270_OPTION_S390, | ||
| 42 | + "S390", | ||
| 43 | + N_( "IBM S/390" ), | ||
| 44 | + NULL | ||
| 45 | + }, | ||
| 46 | + { | ||
| 54 | LIB3270_OPTION_AS400, | 47 | LIB3270_OPTION_AS400, |
| 55 | - "as400", | ||
| 56 | - N_( "Host is AS/400" ), | 48 | + "AS400", |
| 49 | + N_( "IBM AS/400" ), | ||
| 57 | NULL | 50 | NULL |
| 58 | }, | 51 | }, |
| 59 | - | ||
| 60 | { | 52 | { |
| 61 | LIB3270_OPTION_TSO, | 53 | LIB3270_OPTION_TSO, |
| 62 | - "tso", | ||
| 63 | - N_( "Host is TSO" ), | 54 | + "TSO", |
| 55 | + N_( "Other (TSO)" ), | ||
| 56 | + NULL | ||
| 57 | + }, | ||
| 58 | + { | ||
| 59 | + 0, | ||
| 60 | + "VM/CMS", | ||
| 61 | + N_( "Other (VM/CMS)" ), | ||
| 64 | NULL | 62 | NULL |
| 65 | }, | 63 | }, |
| 66 | 64 | ||
| @@ -70,11 +68,9 @@ | @@ -70,11 +68,9 @@ | ||
| 70 | NULL, | 68 | NULL, |
| 71 | NULL | 69 | NULL |
| 72 | } | 70 | } |
| 73 | - | ||
| 74 | }; | 71 | }; |
| 75 | 72 | ||
| 76 | 73 | ||
| 77 | - | ||
| 78 | /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ | 74 | /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ |
| 79 | 75 | ||
| 80 | LIB3270_EXPORT LIB3270_OPTION lib3270_get_options(H3270 *hSession) | 76 | 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 | @@ -134,7 +130,7 @@ LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colort | ||
| 134 | 130 | ||
| 135 | LIB3270_EXPORT const LIB3270_OPTION_ENTRY * lib3270_get_option_list(void) | 131 | LIB3270_EXPORT const LIB3270_OPTION_ENTRY * lib3270_get_option_list(void) |
| 136 | { | 132 | { |
| 137 | - return options; | 133 | + return host_type; |
| 138 | } | 134 | } |
| 139 | 135 | ||
| 140 | LIB3270_EXPORT int lib3270_is_tso(H3270 *hSession) | 136 | LIB3270_EXPORT int lib3270_is_tso(H3270 *hSession) |
| @@ -145,6 +141,7 @@ LIB3270_EXPORT int lib3270_is_tso(H3270 *hSession) | @@ -145,6 +141,7 @@ LIB3270_EXPORT int lib3270_is_tso(H3270 *hSession) | ||
| 145 | 141 | ||
| 146 | LIB3270_EXPORT LIB3270_OPTION lib3270_parse_host_type(const char *name) | 142 | LIB3270_EXPORT LIB3270_OPTION lib3270_parse_host_type(const char *name) |
| 147 | { | 143 | { |
| 144 | + | ||
| 148 | int f; | 145 | int f; |
| 149 | 146 | ||
| 150 | for(f=0;f<(sizeof(host_type)/sizeof(host_type[0]));f++) | 147 | for(f=0;f<(sizeof(host_type)/sizeof(host_type[0]));f++) |