Commit 3f9be98561f3afa99cfe820f7aee7e8fe7ba046f
1 parent
1d590664
Exists in
master
Documentando nova API
Showing
3 changed files
with
66 additions
and
30 deletions
Show diff stats
latest/src/include/lib3270.h
... | ... | @@ -98,11 +98,15 @@ |
98 | 98 | |
99 | 99 | } LIB3270_TOGGLE; |
100 | 100 | |
101 | + /** | |
102 | + * OIA Status indicators. | |
103 | + * | |
104 | + */ | |
101 | 105 | typedef enum _lib3270_flag |
102 | 106 | { |
103 | - LIB3270_FLAG_BOXSOLID, | |
104 | - LIB3270_FLAG_UNDERA, | |
105 | - LIB3270_FLAG_SECURE, | |
107 | + LIB3270_FLAG_BOXSOLID, /**< System available */ | |
108 | + LIB3270_FLAG_UNDERA, /**< Control Unit STATUS */ | |
109 | + LIB3270_FLAG_SECURE, /**< Security status */ | |
106 | 110 | LIB3270_FLAG_TYPEAHEAD, |
107 | 111 | LIB3270_FLAG_PRINTER, |
108 | 112 | LIB3270_FLAG_REVERSE, |
... | ... | @@ -114,6 +118,34 @@ |
114 | 118 | |
115 | 119 | |
116 | 120 | /** |
121 | + * 3270 program messages. | |
122 | + * | |
123 | + */ | |
124 | + typedef enum _LIB3270_MESSAGE | |
125 | + { | |
126 | + LIB3270_MESSAGE_NONE, /**< No message */ | |
127 | + LIB3270_MESSAGE_SYSWAIT, | |
128 | + LIB3270_MESSAGE_TWAIT, | |
129 | + LIB3270_MESSAGE_CONNECTED, | |
130 | + LIB3270_MESSAGE_DISCONNECTED, /**< Disconnected from host */ | |
131 | + LIB3270_MESSAGE_AWAITING_FIRST, | |
132 | + LIB3270_MESSAGE_MINUS, | |
133 | + LIB3270_MESSAGE_PROTECTED, | |
134 | + LIB3270_MESSAGE_NUMERIC, | |
135 | + LIB3270_MESSAGE_OVERFLOW, | |
136 | + LIB3270_MESSAGE_INHIBIT, | |
137 | + LIB3270_MESSAGE_KYBDLOCK, | |
138 | + | |
139 | + LIB3270_MESSAGE_X, | |
140 | + LIB3270_MESSAGE_RESOLVING, /**< Resolving hostname (running DNS query) */ | |
141 | + LIB3270_MESSAGE_CONNECTING, /**< Connecting to host */ | |
142 | + | |
143 | + LIB3270_MESSAGE_USER | |
144 | + | |
145 | + } LIB3270_MESSAGE; | |
146 | + | |
147 | + | |
148 | + /** | |
117 | 149 | * Cursor modes. |
118 | 150 | * |
119 | 151 | * Cursor modes set by library; an application can us it |
... | ... | @@ -214,7 +246,6 @@ |
214 | 246 | */ |
215 | 247 | LIB3270_EXPORT int lib3270_connect(H3270 *h,const char *n, int wait); |
216 | 248 | |
217 | - | |
218 | 249 | /** |
219 | 250 | * Disconnect from host. |
220 | 251 | * |
... | ... | @@ -340,7 +371,17 @@ |
340 | 371 | int LIB3270_EXPORT lib3270_register_io_handlers(const struct lib3270_io_callbacks *cbk); |
341 | 372 | |
342 | 373 | |
343 | - LIB3270_EXPORT LIB3270_STATUS lib3270_get_oia_status(H3270 *h); | |
374 | + /** | |
375 | + * Get program message. | |
376 | + * | |
377 | + * @see LIB3270_MESSAGE | |
378 | + * | |
379 | + * @param h Session handle. | |
380 | + * | |
381 | + * @return Latest program message. | |
382 | + * | |
383 | + */ | |
384 | + LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(H3270 *h); | |
344 | 385 | |
345 | 386 | /** |
346 | 387 | * Get connected LU name | ... | ... |
latest/src/include/lib3270/api.h
... | ... | @@ -158,28 +158,23 @@ |
158 | 158 | #define CONNECTED_SSCP LIB3270_CONNECTED_SSCP |
159 | 159 | #define CONNECTED_TN3270E LIB3270_CONNECTED_TN3270E |
160 | 160 | |
161 | - typedef enum _LIB3270_STATUS | |
162 | - { | |
163 | - LIB3270_STATUS_BLANK, | |
164 | - LIB3270_STATUS_SYSWAIT, | |
165 | - LIB3270_STATUS_TWAIT, | |
166 | - LIB3270_STATUS_CONNECTED, | |
167 | - LIB3270_STATUS_DISCONNECTED, | |
168 | - LIB3270_STATUS_AWAITING_FIRST, | |
169 | - LIB3270_STATUS_MINUS, | |
170 | - LIB3270_STATUS_PROTECTED, | |
171 | - LIB3270_STATUS_NUMERIC, | |
172 | - LIB3270_STATUS_OVERFLOW, | |
173 | - LIB3270_STATUS_INHIBIT, | |
174 | - LIB3270_STATUS_KYBDLOCK, | |
175 | - | |
176 | - LIB3270_STATUS_X, | |
177 | - LIB3270_STATUS_RESOLVING, | |
178 | - LIB3270_STATUS_CONNECTING, | |
179 | - | |
180 | - LIB3270_STATUS_USER | |
181 | - | |
182 | - } LIB3270_STATUS; | |
161 | + #define LIB3270_STATUS LIB3270_MESSAGE | |
162 | + #define LIB3270_STATUS_BLANK LIB3270_MESSAGE_NONE | |
163 | + #define LIB3270_STATUS_SYSWAIT LIB3270_MESSAGE_SYSWAIT | |
164 | + #define LIB3270_STATUS_TWAIT LIB3270_MESSAGE_TWAIT | |
165 | + #define LIB3270_STATUS_CONNECTED LIB3270_MESSAGE_CONNECTED | |
166 | + #define LIB3270_STATUS_DISCONNECTED LIB3270_MESSAGE_DISCONNECTED | |
167 | + #define LIB3270_STATUS_AWAITING_FIRST LIB3270_MESSAGE_AWAITING_FIRST | |
168 | + #define LIB3270_STATUS_MINUS LIB3270_MESSAGE_MINUS | |
169 | + #define LIB3270_STATUS_PROTECTED LIB3270_MESSAGE_PROTECTED | |
170 | + #define LIB3270_STATUS_NUMERIC LIB3270_MESSAGE_NUMERIC | |
171 | + #define LIB3270_STATUS_OVERFLOW LIB3270_MESSAGE_OVERFLOW | |
172 | + #define LIB3270_STATUS_INHIBIT LIB3270_MESSAGE_INHIBIT | |
173 | + #define LIB3270_STATUS_KYBDLOCK LIB3270_MESSAGE_KYBDLOCK | |
174 | + #define LIB3270_STATUS_X LIB3270_MESSAGE_X | |
175 | + #define LIB3270_STATUS_RESOLVING LIB3270_MESSAGE_RESOLVING | |
176 | + #define LIB3270_STATUS_CONNECTING LIB3270_MESSAGE_CONNECTING | |
177 | + #define LIB3270_STATUS_USER LIB3270_MESSAGE_USER | |
183 | 178 | |
184 | 179 | #define OIA_FLAG_BOXSOLID LIB3270_FLAG_BOXSOLID |
185 | 180 | #define OIA_FLAG_UNDERA LIB3270_FLAG_UNDERA |
... | ... | @@ -224,7 +219,7 @@ |
224 | 219 | char * qualified_host; |
225 | 220 | char auto_reconnect_inprogress; |
226 | 221 | |
227 | - LIB3270_STATUS oia_status; | |
222 | + LIB3270_MESSAGE oia_status; | |
228 | 223 | |
229 | 224 | unsigned char oia_flag[LIB3270_FLAG_COUNT]; |
230 | 225 | |
... | ... | @@ -579,7 +574,7 @@ |
579 | 574 | LIB3270_EXPORT void popup_system_error(const char *title, const char *message, const char *system); |
580 | 575 | LIB3270_EXPORT void popup_a_sockerr(char *fmt, ...); |
581 | 576 | |
582 | - #define query_3270_terminal_status(void) lib3270_get_oia_status(NULL) | |
577 | + #define query_3270_terminal_status(void) lib3270_get_program_message(NULL) | |
583 | 578 | |
584 | 579 | LIB3270_EXPORT int set_3270_model(H3270 *session, int model); |
585 | 580 | LIB3270_EXPORT int get_3270_model(H3270 *session); | ... | ... |
latest/src/lib/screen.c
... | ... | @@ -584,7 +584,7 @@ void status_reset(H3270 *session) |
584 | 584 | * |
585 | 585 | * @see LIB3270_STATUS |
586 | 586 | */ |
587 | -LIB3270_EXPORT LIB3270_STATUS lib3270_get_oia_status(H3270 *session) | |
587 | +LIB3270_EXPORT LIB3270_STATUS lib3270_get_program_message(H3270 *session) | |
588 | 588 | { |
589 | 589 | CHECK_SESSION_HANDLE(session); |
590 | 590 | return session->oia_status; | ... | ... |