From 74cfe45102550d1a8cba94f061ad2884999a34e3 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Tue, 28 Feb 2012 11:24:24 +0000 Subject: [PATCH] Ainda trabalhando na reorganização da API para a versão 5 --- latest/src/include/lib3270.h | 10 ++++++++++ latest/src/include/lib3270/toggle.h | 6 ++++-- latest/src/lib/toggles.c | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/latest/src/include/lib3270.h b/latest/src/include/lib3270.h index b374eae..0272744 100644 --- a/latest/src/include/lib3270.h +++ b/latest/src/include/lib3270.h @@ -381,6 +381,16 @@ LIB3270_EXPORT unsigned char lib3270_get_toggle(H3270 *h, LIB3270_TOGGLE ix); /** + * Translate a string toggle name to the corresponding value. + * + * @param name Toggle name. + * + * @return Toggle ID or -1 if it's invalid. + * + */ + LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name); + + /** * Set toggle state. * * @param h Session handle. diff --git a/latest/src/include/lib3270/toggle.h b/latest/src/include/lib3270/toggle.h index 8b73581..19b4e74 100644 --- a/latest/src/include/lib3270/toggle.h +++ b/latest/src/include/lib3270/toggle.h @@ -76,7 +76,9 @@ LIB3270_EXPORT int set_3270_toggle(LIB3270_TOGGLE_ID ix, int value); LIB3270_EXPORT const char * get_3270_toggle_name(LIB3270_TOGGLE_ID ix); - LIB3270_EXPORT LIB3270_TOGGLE_ID get_3270_toggle_by_name(const char *name); +// LIB3270_EXPORT LIB3270_TOGGLE_ID get_3270_toggle_by_name(const char *name); + #define get_3270_toggle_by_name(x) lib3270_get_toggle_id(x) + LIB3270_EXPORT void update_toggle_actions(void); @@ -86,6 +88,6 @@ #define get_toggle_name(ix) get_3270_toggle_name(ix) #define set_toggle(ix,value) lib3270_set_toggle(NULL,ix,value) - #define get_toggle_by_name(name) get_3270_toggle_by_name(name) + #define get_toggle_by_name(name) lib3270_get_toggle_id(name) #endif /* TOGGLE3270_H_INCLUDED */ diff --git a/latest/src/lib/toggles.c b/latest/src/lib/toggles.c index 206f6e7..391f6d6 100644 --- a/latest/src/lib/toggles.c +++ b/latest/src/lib/toggles.c @@ -227,7 +227,7 @@ LIB3270_EXPORT const char * get_3270_toggle_name(LIB3270_TOGGLE_ID ix) return ""; } -LIB3270_EXPORT LIB3270_TOGGLE_ID get_3270_toggle_by_name(const char *name) +LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name) { int f; -- libgit2 0.21.2