Commit 8e82d3bca7124381cedd2216d03fbbd56a0d42f4
1 parent
0cd4a4ec
Exists in
master
and in
3 other branches
Ajustes para a nova caixa de diálogo
Showing
1 changed file
with
24 additions
and
15 deletions
Show diff stats
options.c
... | ... | @@ -33,6 +33,18 @@ |
33 | 33 | |
34 | 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 | + | |
36 | 48 | |
37 | 49 | /*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ |
38 | 50 | |
... | ... | @@ -80,13 +92,9 @@ LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt) |
80 | 92 | LIB3270_EXPORT unsigned short lib3270_get_color_type(H3270 *hSession) |
81 | 93 | { |
82 | 94 | CHECK_SESSION_HANDLE(hSession); |
83 | - | |
84 | - trace("******************* %d",hSession->colors); | |
85 | - | |
86 | 95 | return hSession->mono ? 2 : hSession->colors; |
87 | 96 | } |
88 | 97 | |
89 | - | |
90 | 98 | LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colortype) |
91 | 99 | { |
92 | 100 | CHECK_SESSION_HANDLE(hSession); |
... | ... | @@ -135,20 +143,21 @@ LIB3270_EXPORT int lib3270_is_tso(H3270 *hSession) |
135 | 143 | return (hSession->options & LIB3270_OPTION_TSO) != 0; |
136 | 144 | } |
137 | 145 | |
138 | -LIB3270_EXPORT int lib3270_set_host_type(H3270 *hSession, const char *name) | |
146 | +LIB3270_EXPORT LIB3270_OPTION lib3270_parse_host_type(const char *name) | |
139 | 147 | { |
140 | - static const struct _host_type | |
141 | - { | |
142 | - const char * name; | |
143 | - LIB3270_OPTION option; | |
144 | - } host_type[] = | |
148 | + int f; | |
149 | + | |
150 | + for(f=0;f<(sizeof(host_type)/sizeof(host_type[0]));f++) | |
145 | 151 | { |
146 | - { "S390", LIB3270_OPTION_S390 }, | |
147 | - { "AS400", LIB3270_OPTION_AS400 }, | |
148 | - { "TSO", LIB3270_OPTION_TSO }, | |
149 | - { "VM/CMS", 0 } | |
150 | - }; | |
152 | + if(!strcasecmp(host_type[f].name,name)) | |
153 | + return host_type[f].option; | |
154 | + } | |
151 | 155 | |
156 | + return 0; | |
157 | +} | |
158 | + | |
159 | +LIB3270_EXPORT int lib3270_set_host_type(H3270 *hSession, const char *name) | |
160 | +{ | |
152 | 161 | int f; |
153 | 162 | |
154 | 163 | for(f=0;f<(sizeof(host_type)/sizeof(host_type[0]));f++) | ... | ... |