Commit 74cfe45102550d1a8cba94f061ad2884999a34e3
1 parent
aa5003dc
Exists in
master
Ainda trabalhando na reorganização da API para a versão 5
Showing
3 changed files
with
15 additions
and
3 deletions
Show diff stats
latest/src/include/lib3270.h
... | ... | @@ -381,6 +381,16 @@ |
381 | 381 | LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *h, LIB3270_TOGGLE ix); |
382 | 382 | |
383 | 383 | /** |
384 | + * Translate a string toggle name to the corresponding value. | |
385 | + * | |
386 | + * @param name Toggle name. | |
387 | + * | |
388 | + * @return Toggle ID or -1 if it's invalid. | |
389 | + * | |
390 | + */ | |
391 | + LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name); | |
392 | + | |
393 | + /** | |
384 | 394 | * Set toggle state. |
385 | 395 | * |
386 | 396 | * @param h Session handle. | ... | ... |
latest/src/include/lib3270/toggle.h
... | ... | @@ -76,7 +76,9 @@ |
76 | 76 | LIB3270_EXPORT int set_3270_toggle(LIB3270_TOGGLE_ID ix, int value); |
77 | 77 | |
78 | 78 | LIB3270_EXPORT const char * get_3270_toggle_name(LIB3270_TOGGLE_ID ix); |
79 | - LIB3270_EXPORT LIB3270_TOGGLE_ID get_3270_toggle_by_name(const char *name); | |
79 | +// LIB3270_EXPORT LIB3270_TOGGLE_ID get_3270_toggle_by_name(const char *name); | |
80 | + #define get_3270_toggle_by_name(x) lib3270_get_toggle_id(x) | |
81 | + | |
80 | 82 | |
81 | 83 | LIB3270_EXPORT void update_toggle_actions(void); |
82 | 84 | |
... | ... | @@ -86,6 +88,6 @@ |
86 | 88 | |
87 | 89 | #define get_toggle_name(ix) get_3270_toggle_name(ix) |
88 | 90 | #define set_toggle(ix,value) lib3270_set_toggle(NULL,ix,value) |
89 | - #define get_toggle_by_name(name) get_3270_toggle_by_name(name) | |
91 | + #define get_toggle_by_name(name) lib3270_get_toggle_id(name) | |
90 | 92 | |
91 | 93 | #endif /* TOGGLE3270_H_INCLUDED */ | ... | ... |
latest/src/lib/toggles.c
... | ... | @@ -227,7 +227,7 @@ LIB3270_EXPORT const char * get_3270_toggle_name(LIB3270_TOGGLE_ID ix) |
227 | 227 | return ""; |
228 | 228 | } |
229 | 229 | |
230 | -LIB3270_EXPORT LIB3270_TOGGLE_ID get_3270_toggle_by_name(const char *name) | |
230 | +LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name) | |
231 | 231 | { |
232 | 232 | int f; |
233 | 233 | ... | ... |