Commit 0e1033e82da7283e5564863ba4fb15e0b2176233
1 parent
009c88fd
Exists in
master
Corrigindo commit anterior - faltaram defines
Showing
2 changed files
with
43 additions
and
0 deletions
Show diff stats
latest/src/include/lib3270.h
... | ... | @@ -32,6 +32,8 @@ |
32 | 32 | |
33 | 33 | #ifndef LIB3270_H_INCLUDED |
34 | 34 | |
35 | + #define LIB3270_H_INCLUDED 1 | |
36 | + | |
35 | 37 | /** |
36 | 38 | * Character attributes |
37 | 39 | */ |
... | ... | @@ -68,6 +70,32 @@ |
68 | 70 | |
69 | 71 | } LIB3270_ATTR; |
70 | 72 | |
73 | + typedef enum _lib3270_toggle | |
74 | + { | |
75 | + LIB3270_TOGGLE_MONOCASE, | |
76 | + LIB3270_TOGGLE_ALT_CURSOR, | |
77 | + LIB3270_TOGGLE_CURSOR_BLINK, | |
78 | + LIB3270_TOGGLE_SHOW_TIMING, | |
79 | + LIB3270_TOGGLE_CURSOR_POS, | |
80 | + LIB3270_TOGGLE_DS_TRACE, | |
81 | + LIB3270_TOGGLE_SCROLL_BAR, | |
82 | + LIB3270_TOGGLE_LINE_WRAP, | |
83 | + LIB3270_TOGGLE_BLANK_FILL, | |
84 | + LIB3270_TOGGLE_SCREEN_TRACE, | |
85 | + LIB3270_TOGGLE_EVENT_TRACE, | |
86 | + LIB3270_TOGGLE_MARGINED_PASTE, | |
87 | + LIB3270_TOGGLE_RECTANGLE_SELECT, | |
88 | + LIB3270_TOGGLE_CROSSHAIR, | |
89 | + LIB3270_TOGGLE_VISIBLE_CONTROL, | |
90 | + LIB3270_TOGGLE_AID_WAIT, | |
91 | + LIB3270_TOGGLE_FULL_SCREEN, | |
92 | + LIB3270_TOGGLE_RECONNECT, | |
93 | + LIB3270_TOGGLE_INSERT, | |
94 | + LIB3270_TOGGLE_KEYPAD, | |
95 | + LIB3270_TOGGLE_SMART_PASTE, | |
96 | + | |
97 | + LIB3270_TOGGLE_COUNT | |
98 | + } LIB3270_TOGGLE; | |
71 | 99 | |
72 | 100 | #include <lib3270/api.h> |
73 | 101 | |
... | ... | @@ -198,8 +226,21 @@ |
198 | 226 | */ |
199 | 227 | LIB3270_EXPORT int lib3270_get_contents(H3270 *h, int first, int last, unsigned char *chr, unsigned short *attr); |
200 | 228 | |
229 | + /** | |
230 | + * get toggle state. | |
231 | + * | |
232 | + * @param h Session handle. | |
233 | + * @param ix Toggle id. | |
234 | + * | |
235 | + * @return 0 if the toggle is disabled, non zero if enabled. | |
236 | + * | |
237 | + */ | |
238 | + LIB3270_EXPORT unsigned char lib3270_get_toogle(H3270 *h, LIB3270_TOGGLE ix); | |
239 | + | |
201 | 240 | LIB3270_EXPORT STATUS_CODE lib3270_get_oia_status(H3270 *h); |
202 | 241 | LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h); |
203 | 242 | LIB3270_EXPORT const char * lib3270_get_host(H3270 *h); |
204 | 243 | |
244 | + | |
245 | + | |
205 | 246 | #endif // LIB3270_H_INCLUDED | ... | ... |
latest/src/lib/toggles.c
... | ... | @@ -94,6 +94,8 @@ LIB3270_EXPORT void register_3270_toggle_monitor(LIB3270_TOGGLE_ID ix, void (*ca |
94 | 94 | |
95 | 95 | LIB3270_EXPORT unsigned char lib3270_get_toogle(H3270 *session, LIB3270_TOGGLE ix) |
96 | 96 | { |
97 | + CHECK_SESSION_HANDLE(session); | |
98 | + | |
97 | 99 | if(ix < 0 || ix >= N_TOGGLES) |
98 | 100 | return 0; |
99 | 101 | return (unsigned char) appres.toggle[ix].value != 0; | ... | ... |