Commit 289cdd1f2b134860b4268c9d981b52196aeacff4

Authored by perry.werneck@gmail.com
1 parent e63f81d4
Exists in master

Padronizando nome da função que obtem o nome de um toggle

latest/src/include/lib3270.h
@@ -403,6 +403,16 @@ @@ -403,6 +403,16 @@
403 LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name); 403 LIB3270_EXPORT LIB3270_TOGGLE lib3270_get_toggle_id(const char *name);
404 404
405 /** 405 /**
  406 + * Get the toggle name as string.
  407 + *
  408 + * @param id Toggle id
  409 + *
  410 + * @return Constant string with the toggle name or "" if invalid.
  411 + *
  412 + */
  413 + LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE ix);
  414 +
  415 + /**
406 * Revert toggle status. 416 * Revert toggle status.
407 * 417 *
408 * @param h Session handle. 418 * @param h Session handle.
latest/src/include/lib3270/toggle.h
@@ -75,7 +75,7 @@ @@ -75,7 +75,7 @@
75 75
76 LIB3270_EXPORT int set_3270_toggle(LIB3270_TOGGLE_ID ix, int value); 76 LIB3270_EXPORT int set_3270_toggle(LIB3270_TOGGLE_ID ix, int value);
77 77
78 - LIB3270_EXPORT const char * get_3270_toggle_name(LIB3270_TOGGLE_ID ix); 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) 80 #define get_3270_toggle_by_name(x) lib3270_get_toggle_id(x)
81 81
@@ -86,8 +86,9 @@ @@ -86,8 +86,9 @@
86 #define register_tchange(ix,callback) register_3270_toggle_monitor(ix,callback) 86 #define register_tchange(ix,callback) register_3270_toggle_monitor(ix,callback)
87 #define do_toggle(ix) lib3270_toggle(NULL,ix) 87 #define do_toggle(ix) lib3270_toggle(NULL,ix)
88 88
89 - #define get_toggle_name(ix) get_3270_toggle_name(ix)  
90 - #define set_toggle(ix,value) lib3270_set_toggle(NULL,ix,value)  
91 - #define get_toggle_by_name(name) lib3270_get_toggle_id(name) 89 + #define get_3270_toggle_name(ix) lib3270_get_toggle_name(ix)
  90 + #define get_toggle_name(ix) lib3270_get_toggle_name(ix)
  91 + #define set_toggle(ix,value) lib3270_set_toggle(NULL,ix,value)
  92 + #define get_toggle_by_name(name) lib3270_get_toggle_id(name)
92 93
93 #endif /* TOGGLE3270_H_INCLUDED */ 94 #endif /* TOGGLE3270_H_INCLUDED */
latest/src/lib/toggles.c
@@ -220,7 +220,7 @@ void shutdown_toggles(H3270 *session, struct toggle *toggle) @@ -220,7 +220,7 @@ void shutdown_toggles(H3270 *session, struct toggle *toggle)
220 #endif 220 #endif
221 } 221 }
222 222
223 -LIB3270_EXPORT const char * get_3270_toggle_name(LIB3270_TOGGLE_ID ix) 223 +LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE_ID ix)
224 { 224 {
225 if(ix < N_TOGGLES) 225 if(ix < N_TOGGLES)
226 return toggle_names[ix]; 226 return toggle_names[ix];