Commit 5b547559afb8b4ece6eca5f4da35f430a0a4cf3a

Authored by Perry Werneck
1 parent 5a66c388

Atualizando definições.

src/include/lib3270.h
@@ -170,27 +170,27 @@ @@ -170,27 +170,27 @@
170 170
171 171
172 /** 172 /**
173 - * 3270 program messages. 173 + * @brief 3270 program messages.
174 * 174 *
175 */ 175 */
176 typedef enum _LIB3270_MESSAGE 176 typedef enum _LIB3270_MESSAGE
177 { 177 {
178 - LIB3270_MESSAGE_NONE, /**< 0 - No message */  
179 - LIB3270_MESSAGE_SYSWAIT, /**< 1 - */  
180 - LIB3270_MESSAGE_TWAIT, /**< 2 - */  
181 - LIB3270_MESSAGE_CONNECTED, /**< 3 - Connected */  
182 - LIB3270_MESSAGE_DISCONNECTED, /**< 4 - Disconnected from host */  
183 - LIB3270_MESSAGE_AWAITING_FIRST, /**< 5 - */  
184 - LIB3270_MESSAGE_MINUS, /**< 6 - */  
185 - LIB3270_MESSAGE_PROTECTED, /**< 7 - */  
186 - LIB3270_MESSAGE_NUMERIC, /**< 8 - */  
187 - LIB3270_MESSAGE_OVERFLOW, /**< 9 - */  
188 - LIB3270_MESSAGE_INHIBIT, /**< 10 - */  
189 - LIB3270_MESSAGE_KYBDLOCK, /**< 11 - Keyboard is locked */  
190 -  
191 - LIB3270_MESSAGE_X, /**< 12 - */  
192 - LIB3270_MESSAGE_RESOLVING, /**< 13 - Resolving hostname (running DNS query) */  
193 - LIB3270_MESSAGE_CONNECTING, /**< 14 - Connecting to host */ 178 + LIB3270_MESSAGE_NONE, ///< @brief No message
  179 + LIB3270_MESSAGE_SYSWAIT, ///< @brief --
  180 + LIB3270_MESSAGE_TWAIT, ///< @brief --
  181 + LIB3270_MESSAGE_CONNECTED, ///< @brief Connected
  182 + LIB3270_MESSAGE_DISCONNECTED, ///< @brief Disconnected from host
  183 + LIB3270_MESSAGE_AWAITING_FIRST, ///< @brief --
  184 + LIB3270_MESSAGE_MINUS, ///< @brief --
  185 + LIB3270_MESSAGE_PROTECTED, ///< @brief --
  186 + LIB3270_MESSAGE_NUMERIC, ///< @brief --
  187 + LIB3270_MESSAGE_OVERFLOW, ///< @brief --
  188 + LIB3270_MESSAGE_INHIBIT, ///< @brief --
  189 + LIB3270_MESSAGE_KYBDLOCK, ///< @brief Keyboard is locked
  190 +
  191 + LIB3270_MESSAGE_X, ///< @brief --
  192 + LIB3270_MESSAGE_RESOLVING, ///< @brief Resolving hostname (running DNS query)
  193 + LIB3270_MESSAGE_CONNECTING, ///< @brief Connecting to host
194 194
195 LIB3270_MESSAGE_USER 195 LIB3270_MESSAGE_USER
196 196
src/lib3270/api.h
@@ -114,46 +114,43 @@ @@ -114,46 +114,43 @@
114 // #define ST_PRINTER LIB3270_STATE_PRINTER 114 // #define ST_PRINTER LIB3270_STATE_PRINTER
115 // #define ST_EXITING LIB3270_STATE_EXITING 115 // #define ST_EXITING LIB3270_STATE_EXITING
116 // #define ST_CHARSET LIB3270_STATE_CHARSET 116 // #define ST_CHARSET LIB3270_STATE_CHARSET
117 - #define N_ST LIB3270_STATE_USER  
118 - #define LIB3270_STATE_CHANGE LIB3270_STATE 117 +// #define N_ST LIB3270_STATE_USER
  118 +// #define LIB3270_STATE_CHANGE LIB3270_STATE
119 119
120 /** connection state */ 120 /** connection state */
121 - #define cstate LIB3270_CSTATE 121 +// #define cstate LIB3270_CSTATE
122 // #define NOT_CONNECTED LIB3270_NOT_CONNECTED 122 // #define NOT_CONNECTED LIB3270_NOT_CONNECTED
123 - #define RESOLVING LIB3270_RESOLVING  
124 - #define PENDING LIB3270_PENDING  
125 - #define CONNECTED_INITIAL LIB3270_CONNECTED_INITIAL  
126 - #define CONNECTED_ANSI LIB3270_CONNECTED_ANSI  
127 - #define CONNECTED_3270 LIB3270_CONNECTED_3270  
128 - #define CONNECTED_INITIAL_E LIB3270_CONNECTED_INITIAL_E  
129 - #define CONNECTED_NVT LIB3270_CONNECTED_NVT  
130 - #define CONNECTED_SSCP LIB3270_CONNECTED_SSCP  
131 - #define CONNECTED_TN3270E LIB3270_CONNECTED_TN3270E  
132 -  
133 - #define LIB3270_STATUS LIB3270_MESSAGE  
134 - #define LIB3270_STATUS_BLANK LIB3270_MESSAGE_NONE  
135 - #define LIB3270_STATUS_SYSWAIT LIB3270_MESSAGE_SYSWAIT  
136 - #define LIB3270_STATUS_TWAIT LIB3270_MESSAGE_TWAIT  
137 - #define LIB3270_STATUS_CONNECTED LIB3270_MESSAGE_CONNECTED  
138 - #define LIB3270_STATUS_DISCONNECTED LIB3270_MESSAGE_DISCONNECTED  
139 - #define LIB3270_STATUS_AWAITING_FIRST LIB3270_MESSAGE_AWAITING_FIRST  
140 - #define LIB3270_STATUS_MINUS LIB3270_MESSAGE_MINUS  
141 - #define LIB3270_STATUS_PROTECTED LIB3270_MESSAGE_PROTECTED  
142 - #define LIB3270_STATUS_NUMERIC LIB3270_MESSAGE_NUMERIC  
143 - #define LIB3270_STATUS_OVERFLOW LIB3270_MESSAGE_OVERFLOW  
144 - #define LIB3270_STATUS_INHIBIT LIB3270_MESSAGE_INHIBIT  
145 - #define LIB3270_STATUS_KYBDLOCK LIB3270_MESSAGE_KYBDLOCK  
146 - #define LIB3270_STATUS_X LIB3270_MESSAGE_X  
147 - #define LIB3270_STATUS_RESOLVING LIB3270_MESSAGE_RESOLVING  
148 - #define LIB3270_STATUS_CONNECTING LIB3270_MESSAGE_CONNECTING  
149 - #define LIB3270_STATUS_USER LIB3270_MESSAGE_USER 123 +// #define RESOLVING LIB3270_RESOLVING
  124 +// #define PENDING LIB3270_PENDING
  125 +// #define CONNECTED_INITIAL LIB3270_CONNECTED_INITIAL
  126 +// #define CONNECTED_ANSI LIB3270_CONNECTED_ANSI
  127 +// #define CONNECTED_3270 LIB3270_CONNECTED_3270
  128 +// #define CONNECTED_INITIAL_E LIB3270_CONNECTED_INITIAL_E
  129 +// #define CONNECTED_NVT LIB3270_CONNECTED_NVT
  130 +// #define CONNECTED_SSCP LIB3270_CONNECTED_SSCP
  131 +// #define CONNECTED_TN3270E LIB3270_CONNECTED_TN3270E
  132 +
  133 +// #define LIB3270_STATUS LIB3270_MESSAGE
  134 +// #define LIB3270_STATUS_BLANK LIB3270_MESSAGE_NONE
  135 +// #define LIB3270_STATUS_SYSWAIT LIB3270_MESSAGE_SYSWAIT
  136 +// #define LIB3270_STATUS_TWAIT LIB3270_MESSAGE_TWAIT
  137 +// #define LIB3270_STATUS_CONNECTED LIB3270_MESSAGE_CONNECTED
  138 +// #define LIB3270_STATUS_DISCONNECTED LIB3270_MESSAGE_DISCONNECTED
  139 +// #define LIB3270_STATUS_AWAITING_FIRST LIB3270_MESSAGE_AWAITING_FIRST
  140 +// #define LIB3270_MESSAGE_MINUS LIB3270_MESSAGE_MINUS
  141 +// #define LIB3270_STATUS_PROTECTED LIB3270_MESSAGE_PROTECTED
  142 +// #define LIB3270_STATUS_NUMERIC LIB3270_MESSAGE_NUMERIC
  143 +// #define LIB3270_STATUS_OVERFLOW LIB3270_MESSAGE_OVERFLOW
  144 +// #define LIB3270_STATUS_INHIBIT LIB3270_MESSAGE_INHIBIT
  145 +// #define LIB3270_STATUS_KYBDLOCK LIB3270_MESSAGE_KYBDLOCK
  146 +// #define LIB3270_STATUS_X LIB3270_MESSAGE_X
  147 +// #define LIB3270_MESSAGE_RESOLVING LIB3270_MESSAGE_RESOLVING
  148 +// #define LIB3270_STATUS_CONNECTING LIB3270_MESSAGE_CONNECTING
  149 +// #define LIB3270_STATUS_USER LIB3270_MESSAGE_USER
150 150
151 #define OIA_FLAG_BOXSOLID LIB3270_FLAG_BOXSOLID 151 #define OIA_FLAG_BOXSOLID LIB3270_FLAG_BOXSOLID
152 #define OIA_FLAG_UNDERA LIB3270_FLAG_UNDERA 152 #define OIA_FLAG_UNDERA LIB3270_FLAG_UNDERA
153 -// #define OIA_FLAG_SECURE LIB3270_FLAG_SECURE  
154 #define OIA_FLAG_TYPEAHEAD LIB3270_FLAG_TYPEAHEAD 153 #define OIA_FLAG_TYPEAHEAD LIB3270_FLAG_TYPEAHEAD
155 -// #define OIA_FLAG_PRINTER LIB3270_FLAG_PRINTER  
156 -// #define OIA_FLAG_REVERSE LIB3270_FLAG_REVERSE  
157 #define OIA_FLAG_USER LIB3270_FLAG_COUNT 154 #define OIA_FLAG_USER LIB3270_FLAG_COUNT
158 #define OIA_FLAG LIB3270_FLAG 155 #define OIA_FLAG LIB3270_FLAG
159 156
src/lib3270/ctlr.c
@@ -1980,7 +1980,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er @@ -1980,7 +1980,7 @@ enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean er
1980 do_reset(hSession,False); 1980 do_reset(hSession,False);
1981 } else if (hSession->kybdlock & KL_OIA_TWAIT) { 1981 } else if (hSession->kybdlock & KL_OIA_TWAIT) {
1982 lib3270_kybdlock_clear(hSession,KL_OIA_TWAIT); 1982 lib3270_kybdlock_clear(hSession,KL_OIA_TWAIT);
1983 - status_changed(hSession,LIB3270_STATUS_SYSWAIT); 1983 + status_changed(hSession,LIB3270_MESSAGE_SYSWAIT);
1984 } 1984 }
1985 if (wcc_sound_alarm) 1985 if (wcc_sound_alarm)
1986 lib3270_ring_bell(hSession); 1986 lib3270_ring_bell(hSession);
src/lib3270/host.c
@@ -110,9 +110,9 @@ void host_disconnect(H3270 *hSession, int failed) @@ -110,9 +110,9 @@ void host_disconnect(H3270 *hSession, int failed)
110 /* The host has entered 3270 or ANSI mode, or switched between them. */ 110 /* The host has entered 3270 or ANSI mode, or switched between them. */
111 void host_in3270(H3270 *hSession, LIB3270_CSTATE new_cstate) 111 void host_in3270(H3270 *hSession, LIB3270_CSTATE new_cstate)
112 { 112 {
113 - Boolean now3270 = (new_cstate == CONNECTED_3270 ||  
114 - new_cstate == CONNECTED_SSCP ||  
115 - new_cstate == CONNECTED_TN3270E); 113 + Boolean now3270 = (new_cstate == LIB3270_CONNECTED_3270 ||
  114 + new_cstate == LIB3270_CONNECTED_SSCP ||
  115 + new_cstate == LIB3270_CONNECTED_TN3270E);
116 116
117 hSession->cstate = new_cstate; 117 hSession->cstate = new_cstate;
118 hSession->ever_3270 = now3270; 118 hSession->ever_3270 = now3270;
@@ -121,7 +121,7 @@ void host_in3270(H3270 *hSession, LIB3270_CSTATE new_cstate) @@ -121,7 +121,7 @@ void host_in3270(H3270 *hSession, LIB3270_CSTATE new_cstate)
121 121
122 void lib3270_set_connected(H3270 *hSession) 122 void lib3270_set_connected(H3270 *hSession)
123 { 123 {
124 - hSession->cstate = CONNECTED_INITIAL; 124 + hSession->cstate = LIB3270_CONNECTED_INITIAL;
125 hSession->starting = 1; // Enable autostart 125 hSession->starting = 1; // Enable autostart
126 126
127 lib3270_st_changed(hSession, LIB3270_STATE_CONNECT, True); 127 lib3270_st_changed(hSession, LIB3270_STATE_CONNECT, True);
@@ -151,7 +151,7 @@ void lib3270_set_disconnected(H3270 *hSession) @@ -151,7 +151,7 @@ void lib3270_set_disconnected(H3270 *hSession)
151 } 151 }
152 152
153 /* Register a function interested in a state change. */ 153 /* Register a function interested in a state change. */
154 -LIB3270_EXPORT void lib3270_register_schange(H3270 *h, LIB3270_STATE_CHANGE tx, void (*func)(H3270 *, int, void *),void *data) 154 +LIB3270_EXPORT void lib3270_register_schange(H3270 *h, LIB3270_STATE tx, void (*func)(H3270 *, int, void *),void *data)
155 { 155 {
156 struct lib3270_state_callback *st; 156 struct lib3270_state_callback *st;
157 157
src/lib3270/kybd.c
@@ -502,7 +502,7 @@ static void key_AID(H3270 *hSession, unsigned char aid_code) @@ -502,7 +502,7 @@ static void key_AID(H3270 *hSession, unsigned char aid_code)
502 return; 502 return;
503 if (aid_code != AID_ENTER && aid_code != AID_CLEAR) 503 if (aid_code != AID_ENTER && aid_code != AID_CLEAR)
504 { 504 {
505 - status_changed(hSession,LIB3270_STATUS_MINUS); 505 + status_changed(hSession,LIB3270_MESSAGE_MINUS);
506 kybdlock_set(hSession,KL_OIA_MINUS); 506 kybdlock_set(hSession,KL_OIA_MINUS);
507 return; 507 return;
508 } 508 }
@@ -752,11 +752,13 @@ static Boolean key_Character(H3270 *hSession, int code, Boolean with_ge, Boolean @@ -752,11 +752,13 @@ static Boolean key_Character(H3270 *hSession, int code, Boolean with_ge, Boolean
752 baddr = hSession->cursor_addr; 752 baddr = hSession->cursor_addr;
753 faddr = find_field_attribute(hSession,baddr); 753 faddr = find_field_attribute(hSession,baddr);
754 fa = get_field_attribute(hSession,baddr); 754 fa = get_field_attribute(hSession,baddr);
  755 +
755 if (hSession->ea_buf[baddr].fa || FA_IS_PROTECTED(fa)) 756 if (hSession->ea_buf[baddr].fa || FA_IS_PROTECTED(fa))
756 { 757 {
757 operator_error(hSession,KL_OERR_PROTECTED); 758 operator_error(hSession,KL_OERR_PROTECTED);
758 return False; 759 return False;
759 } 760 }
  761 +
760 if (hSession->numeric_lock && FA_IS_NUMERIC(fa) && 762 if (hSession->numeric_lock && FA_IS_NUMERIC(fa) &&
761 !((code >= EBC_0 && code <= EBC_9) || 763 !((code >= EBC_0 && code <= EBC_9) ||
762 code == EBC_minus || code == EBC_period)) { 764 code == EBC_minus || code == EBC_period)) {
src/lib3270/private.h
@@ -249,7 +249,9 @@ struct lib3270_text @@ -249,7 +249,9 @@ struct lib3270_text
249 /** @brief lib3270 session data */ 249 /** @brief lib3270 session data */
250 struct _h3270 250 struct _h3270
251 { 251 {
252 - unsigned short sz; /**< Struct size */ 252 + struct lib3270_session_callbacks cbk; // Callback table - Always the first one.
  253 +
  254 +// unsigned short sz; /**< Struct size */
253 255
254 // Connection info 256 // Connection info
255 int sock; /**< Network socket */ 257 int sock; /**< Network socket */
@@ -556,7 +558,6 @@ struct _h3270 @@ -556,7 +558,6 @@ struct _h3270
556 // Callbacks. 558 // Callbacks.
557 struct lib3270_state_callback * st_callbacks[LIB3270_STATE_USER]; 559 struct lib3270_state_callback * st_callbacks[LIB3270_STATE_USER];
558 struct lib3270_state_callback * st_last[LIB3270_STATE_USER]; 560 struct lib3270_state_callback * st_last[LIB3270_STATE_USER];
559 - struct lib3270_session_callbacks cbk;  
560 561
561 }; 562 };
562 563
src/lib3270/resolver.c
@@ -189,7 +189,7 @@ int resolve_host_and_port(H3270 *hSession, const char *host, char *portname, uns @@ -189,7 +189,7 @@ int resolve_host_and_port(H3270 *hSession, const char *host, char *portname, uns
189 189
190 trace("Calling resolver for %s status=%d", p.host, (int) saved_status); 190 trace("Calling resolver for %s status=%d", p.host, (int) saved_status);
191 191
192 - status_changed(hSession,LIB3270_STATUS_RESOLVING); 192 + status_changed(hSession,LIB3270_MESSAGE_RESOLVING);
193 hSession->cursor(hSession,CURSOR_MODE_LOCKED); 193 hSession->cursor(hSession,CURSOR_MODE_LOCKED);
194 194
195 rc = lib3270_call_thread((int (*)(H3270 *, void *)) cresolve_host_and_port,hSession,&p); 195 rc = lib3270_call_thread((int (*)(H3270 *, void *)) cresolve_host_and_port,hSession,&p);
src/lib3270/screen.c
@@ -460,7 +460,7 @@ void status_ctlr_done(H3270 *session) @@ -460,7 +460,7 @@ void status_ctlr_done(H3270 *session)
460 460
461 void status_oerr(H3270 *session, int error_type) 461 void status_oerr(H3270 *session, int error_type)
462 { 462 {
463 - LIB3270_STATUS sts = LIB3270_MESSAGE_USER; 463 + LIB3270_MESSAGE sts = LIB3270_MESSAGE_USER;
464 464
465 CHECK_SESSION_HANDLE(session); 465 CHECK_SESSION_HANDLE(session);
466 466
@@ -520,9 +520,9 @@ void status_reset(H3270 *session) @@ -520,9 +520,9 @@ void status_reset(H3270 *session)
520 * 520 *
521 * @return status-code. 521 * @return status-code.
522 * 522 *
523 - * @see LIB3270_STATUS 523 + * @see LIB3270_MESSAGE
524 */ 524 */
525 -LIB3270_EXPORT LIB3270_STATUS lib3270_get_program_message(H3270 *session) 525 +LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_program_message(H3270 *session)
526 { 526 {
527 CHECK_SESSION_HANDLE(session); 527 CHECK_SESSION_HANDLE(session);
528 return session->oia_status; 528 return session->oia_status;
@@ -564,7 +564,7 @@ LIB3270_EXPORT int lib3270_is_ready(H3270 *hSession) @@ -564,7 +564,7 @@ LIB3270_EXPORT int lib3270_is_ready(H3270 *hSession)
564 } 564 }
565 565
566 566
567 -void status_changed(H3270 *session, LIB3270_STATUS id) 567 +void status_changed(H3270 *session, LIB3270_MESSAGE id)
568 { 568 {
569 CHECK_SESSION_HANDLE(session); 569 CHECK_SESSION_HANDLE(session);
570 570
@@ -580,7 +580,7 @@ void status_twait(H3270 *session) @@ -580,7 +580,7 @@ void status_twait(H3270 *session)
580 { 580 {
581 CHECK_SESSION_HANDLE(session); 581 CHECK_SESSION_HANDLE(session);
582 set_status(session,OIA_FLAG_UNDERA,False); 582 set_status(session,OIA_FLAG_UNDERA,False);
583 - status_changed(session,LIB3270_STATUS_TWAIT); 583 + status_changed(session,LIB3270_MESSAGE_TWAIT);
584 } 584 }
585 585
586 void set_viewsize(H3270 *session, int rows, int cols) 586 void set_viewsize(H3270 *session, int rows, int cols)
@@ -609,7 +609,7 @@ void status_lu(H3270 *session, const char *lu) @@ -609,7 +609,7 @@ void status_lu(H3270 *session, const char *lu)
609 609
610 static void status_connect(H3270 *hSession, int connected, void *dunno) 610 static void status_connect(H3270 *hSession, int connected, void *dunno)
611 { 611 {
612 - LIB3270_STATUS id = LIB3270_STATUS_USER; 612 + LIB3270_MESSAGE id = LIB3270_MESSAGE_USER;
613 613
614 ctlr_erase(hSession,1); 614 ctlr_erase(hSession,1);
615 615
@@ -618,15 +618,15 @@ static void status_connect(H3270 *hSession, int connected, void *dunno) @@ -618,15 +618,15 @@ static void status_connect(H3270 *hSession, int connected, void *dunno)
618 set_status(hSession,OIA_FLAG_BOXSOLID,IN_3270 && !IN_SSCP); 618 set_status(hSession,OIA_FLAG_BOXSOLID,IN_3270 && !IN_SSCP);
619 619
620 if (hSession->kybdlock & KL_AWAITING_FIRST) 620 if (hSession->kybdlock & KL_AWAITING_FIRST)
621 - id = LIB3270_STATUS_AWAITING_FIRST; 621 + id = LIB3270_MESSAGE_AWAITING_FIRST;
622 else 622 else
623 - id = LIB3270_STATUS_CONNECTED; 623 + id = LIB3270_MESSAGE_CONNECTED;
624 624
625 } 625 }
626 else 626 else
627 { 627 {
628 set_status(hSession,OIA_FLAG_BOXSOLID,False); 628 set_status(hSession,OIA_FLAG_BOXSOLID,False);
629 - id = LIB3270_STATUS_DISCONNECTED; 629 + id = LIB3270_MESSAGE_DISCONNECTED;
630 } 630 }
631 631
632 status_changed(hSession,id); 632 status_changed(hSession,id);
src/lib3270/session.c
@@ -70,7 +70,7 @@ void lib3270_session_free(H3270 *h) @@ -70,7 +70,7 @@ void lib3270_session_free(H3270 *h)
70 shutdown_toggles(h); 70 shutdown_toggles(h);
71 71
72 // Release state change callbacks 72 // Release state change callbacks
73 - for(f=0;f<N_ST;f++) 73 + for(f=0;f<LIB3270_STATE_USER;f++)
74 { 74 {
75 while(h->st_callbacks[f]) 75 while(h->st_callbacks[f])
76 { 76 {
@@ -187,7 +187,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char @@ -187,7 +187,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char
187 int f; 187 int f;
188 188
189 memset(hSession,0,sizeof(H3270)); 189 memset(hSession,0,sizeof(H3270));
190 - hSession->sz = sizeof(H3270); 190 +// hSession->sz = sizeof(H3270);
191 191
192 lib3270_set_host_charset(hSession,charset); 192 lib3270_set_host_charset(hSession,charset);
193 193
@@ -210,7 +210,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char @@ -210,7 +210,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char
210 hSession->cbk.update_ssl = update_ssl; 210 hSession->cbk.update_ssl = update_ssl;
211 hSession->cbk.display = screen_disp; 211 hSession->cbk.display = screen_disp;
212 hSession->cbk.set_width = nop_int; 212 hSession->cbk.set_width = nop_int;
213 - hSession->cbk.update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; 213 + hSession->cbk.update_status = (void (*)(H3270 *, LIB3270_MESSAGE)) nop_int;
214 hSession->cbk.autostart = nop; 214 hSession->cbk.autostart = nop;
215 hSession->cbk.set_timer = set_timer; 215 hSession->cbk.set_timer = set_timer;
216 hSession->cbk.print = print; 216 hSession->cbk.print = print;
@@ -222,7 +222,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char @@ -222,7 +222,6 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char
222 hSession->unlock_delay = 1; 222 hSession->unlock_delay = 1;
223 hSession->icrnl = 1; 223 hSession->icrnl = 1;
224 hSession->onlcr = 1; 224 hSession->onlcr = 1;
225 -// hSession->charset.host = "bracket";  
226 hSession->sock = -1; 225 hSession->sock = -1;
227 hSession->model_num = -1; 226 hSession->model_num = -1;
228 hSession->cstate = LIB3270_NOT_CONNECTED; 227 hSession->cstate = LIB3270_NOT_CONNECTED;
@@ -241,9 +240,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char @@ -241,9 +240,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char
241 hSession->options = LIB3270_OPTION_DEFAULTS; 240 hSession->options = LIB3270_OPTION_DEFAULTS;
242 hSession->colors = 16; 241 hSession->colors = 16;
243 hSession->m3279 = 1; 242 hSession->m3279 = 1;
244 -  
245 - // Keyboard unlock  
246 - hSession->unlock_delay_ms = 350; /* 0.35s after last unlock */ 243 + hSession->unlock_delay_ms = 350; // 0.35s after last unlock
247 244
248 // CSD 245 // CSD
249 for(f=0;f<4;f++) 246 for(f=0;f<4;f++)
src/lib3270/state.c
@@ -40,19 +40,19 @@ LIB3270_EXPORT LIB3270_CSTATE lib3270_get_connection_state(H3270 *h) @@ -40,19 +40,19 @@ LIB3270_EXPORT LIB3270_CSTATE lib3270_get_connection_state(H3270 *h)
40 LIB3270_EXPORT int lib3270_pconnected(H3270 *h) 40 LIB3270_EXPORT int lib3270_pconnected(H3270 *h)
41 { 41 {
42 CHECK_SESSION_HANDLE(h); 42 CHECK_SESSION_HANDLE(h);
43 - return (((int) h->cstate) >= (int)RESOLVING); 43 + return (((int) h->cstate) >= (int)LIB3270_RESOLVING);
44 } 44 }
45 45
46 LIB3270_EXPORT int lib3270_half_connected(H3270 *h) 46 LIB3270_EXPORT int lib3270_half_connected(H3270 *h)
47 { 47 {
48 CHECK_SESSION_HANDLE(h); 48 CHECK_SESSION_HANDLE(h);
49 - return (h->cstate == RESOLVING || h->cstate == PENDING); 49 + return (h->cstate == LIB3270_RESOLVING || h->cstate == LIB3270_PENDING);
50 } 50 }
51 51
52 LIB3270_EXPORT int lib3270_connected(H3270 *h) 52 LIB3270_EXPORT int lib3270_connected(H3270 *h)
53 { 53 {
54 CHECK_SESSION_HANDLE(h); 54 CHECK_SESSION_HANDLE(h);
55 - return ((int) h->cstate >= (int)CONNECTED_INITIAL); 55 + return ((int) h->cstate >= (int)LIB3270_CONNECTED_INITIAL);
56 } 56 }
57 57
58 LIB3270_EXPORT int lib3270_disconnected(H3270 *h) 58 LIB3270_EXPORT int lib3270_disconnected(H3270 *h)
@@ -65,43 +65,43 @@ LIB3270_EXPORT int lib3270_disconnected(H3270 *h) @@ -65,43 +65,43 @@ LIB3270_EXPORT int lib3270_disconnected(H3270 *h)
65 LIB3270_EXPORT int lib3270_in_neither(H3270 *h) 65 LIB3270_EXPORT int lib3270_in_neither(H3270 *h)
66 { 66 {
67 CHECK_SESSION_HANDLE(h); 67 CHECK_SESSION_HANDLE(h);
68 - return (h->cstate == CONNECTED_INITIAL); 68 + return (h->cstate == LIB3270_CONNECTED_INITIAL);
69 } 69 }
70 70
71 LIB3270_EXPORT int lib3270_in_ansi(H3270 *h) 71 LIB3270_EXPORT int lib3270_in_ansi(H3270 *h)
72 { 72 {
73 CHECK_SESSION_HANDLE(h); 73 CHECK_SESSION_HANDLE(h);
74 - return (h->cstate == CONNECTED_ANSI || h->cstate == CONNECTED_NVT); 74 + return (h->cstate == LIB3270_CONNECTED_ANSI || h->cstate == LIB3270_CONNECTED_NVT);
75 } 75 }
76 76
77 LIB3270_EXPORT int lib3270_in_3270(H3270 *h) 77 LIB3270_EXPORT int lib3270_in_3270(H3270 *h)
78 { 78 {
79 CHECK_SESSION_HANDLE(h); 79 CHECK_SESSION_HANDLE(h);
80 - return (h->cstate == CONNECTED_3270 || h->cstate == CONNECTED_TN3270E || h->cstate == CONNECTED_SSCP); 80 + return (h->cstate == LIB3270_CONNECTED_3270 || h->cstate == LIB3270_CONNECTED_TN3270E || h->cstate == LIB3270_CONNECTED_SSCP);
81 } 81 }
82 82
83 LIB3270_EXPORT int lib3270_in_sscp(H3270 *h) 83 LIB3270_EXPORT int lib3270_in_sscp(H3270 *h)
84 { 84 {
85 CHECK_SESSION_HANDLE(h); 85 CHECK_SESSION_HANDLE(h);
86 - return (h->cstate == CONNECTED_SSCP); 86 + return (h->cstate == LIB3270_CONNECTED_SSCP);
87 } 87 }
88 88
89 LIB3270_EXPORT int lib3270_in_tn3270e(H3270 *h) 89 LIB3270_EXPORT int lib3270_in_tn3270e(H3270 *h)
90 { 90 {
91 CHECK_SESSION_HANDLE(h); 91 CHECK_SESSION_HANDLE(h);
92 - return (h->cstate == CONNECTED_TN3270E); 92 + return (h->cstate == LIB3270_CONNECTED_TN3270E);
93 } 93 }
94 94
95 LIB3270_EXPORT int lib3270_is_connected(H3270 *h) 95 LIB3270_EXPORT int lib3270_is_connected(H3270 *h)
96 { 96 {
97 CHECK_SESSION_HANDLE(h); 97 CHECK_SESSION_HANDLE(h);
98 - return (h->cstate == CONNECTED_TN3270E); 98 + return (h->cstate == LIB3270_CONNECTED_TN3270E);
99 } 99 }
100 100
101 LIB3270_EXPORT int lib3270_in_e(H3270 *h) 101 LIB3270_EXPORT int lib3270_in_e(H3270 *h)
102 { 102 {
103 CHECK_SESSION_HANDLE(h); 103 CHECK_SESSION_HANDLE(h);
104 - return (h->cstate >= CONNECTED_INITIAL_E); 104 + return (h->cstate >= LIB3270_CONNECTED_INITIAL_E);
105 } 105 }
106 106
107 107
src/lib3270/statusc.h
@@ -29,7 +29,7 @@ LIB3270_INTERNAL void status_twait(H3270 *session); @@ -29,7 +29,7 @@ LIB3270_INTERNAL void status_twait(H3270 *session);
29 29
30 30
31 31
32 -LIB3270_INTERNAL void status_changed(H3270 *session, LIB3270_STATUS id); 32 +LIB3270_INTERNAL void status_changed(H3270 *session, LIB3270_MESSAGE id);
33 33
34 LIB3270_INTERNAL void set_status(H3270 *session, OIA_FLAG id, Boolean on); 34 LIB3270_INTERNAL void set_status(H3270 *session, OIA_FLAG id, Boolean on);
35 35
src/lib3270/telnet.c
@@ -1171,7 +1171,7 @@ static int telnet_fsm(H3270 *hSession, unsigned char c) @@ -1171,7 +1171,7 @@ static int telnet_fsm(H3270 *hSession, unsigned char c)
1171 if (hSession->linemode) 1171 if (hSession->linemode)
1172 cooked_init(hSession); 1172 cooked_init(hSession);
1173 #endif /*]*/ 1173 #endif /*]*/
1174 - host_in3270(hSession,CONNECTED_ANSI); 1174 + host_in3270(hSession,LIB3270_CONNECTED_ANSI);
1175 lib3270_kybdlock_clear(hSession,KL_AWAITING_FIRST); 1175 lib3270_kybdlock_clear(hSession,KL_AWAITING_FIRST);
1176 status_reset(hSession); 1176 status_reset(hSession);
1177 ps_process(hSession); 1177 ps_process(hSession);
@@ -2406,19 +2406,19 @@ static void check_in3270(H3270 *hSession) @@ -2406,19 +2406,19 @@ static void check_in3270(H3270 *hSession)
2406 #if defined(X3270_TN3270E) /*[*/ 2406 #if defined(X3270_TN3270E) /*[*/
2407 if (hSession->myopts[TELOPT_TN3270E]) { 2407 if (hSession->myopts[TELOPT_TN3270E]) {
2408 if (!hSession->tn3270e_negotiated) 2408 if (!hSession->tn3270e_negotiated)
2409 - new_cstate = CONNECTED_INITIAL_E; 2409 + new_cstate = LIB3270_CONNECTED_INITIAL_E;
2410 else switch (hSession->tn3270e_submode) { 2410 else switch (hSession->tn3270e_submode) {
2411 case E_NONE: 2411 case E_NONE:
2412 - new_cstate = CONNECTED_INITIAL_E; 2412 + new_cstate = LIB3270_CONNECTED_INITIAL_E;
2413 break; 2413 break;
2414 case E_NVT: 2414 case E_NVT:
2415 - new_cstate = CONNECTED_NVT; 2415 + new_cstate = LIB3270_CONNECTED_NVT;
2416 break; 2416 break;
2417 case E_3270: 2417 case E_3270:
2418 - new_cstate = CONNECTED_TN3270E; 2418 + new_cstate = LIB3270_CONNECTED_TN3270E;
2419 break; 2419 break;
2420 case E_SSCP: 2420 case E_SSCP:
2421 - new_cstate = CONNECTED_SSCP; 2421 + new_cstate = LIB3270_CONNECTED_SSCP;
2422 break; 2422 break;
2423 } 2423 }
2424 } else 2424 } else
@@ -2428,12 +2428,12 @@ static void check_in3270(H3270 *hSession) @@ -2428,12 +2428,12 @@ static void check_in3270(H3270 *hSession)
2428 hSession->myopts[TELOPT_TTYPE] && 2428 hSession->myopts[TELOPT_TTYPE] &&
2429 hSession->hisopts[TELOPT_BINARY] && 2429 hSession->hisopts[TELOPT_BINARY] &&
2430 hSession->hisopts[TELOPT_EOR]) { 2430 hSession->hisopts[TELOPT_EOR]) {
2431 - new_cstate = CONNECTED_3270;  
2432 - } else if (hSession->cstate == CONNECTED_INITIAL) { 2431 + new_cstate = LIB3270_CONNECTED_3270;
  2432 + } else if (hSession->cstate == LIB3270_CONNECTED_INITIAL) {
2433 /* Nothing has happened, yet. */ 2433 /* Nothing has happened, yet. */
2434 return; 2434 return;
2435 } else { 2435 } else {
2436 - new_cstate = CONNECTED_ANSI; 2436 + new_cstate = LIB3270_CONNECTED_ANSI;
2437 } 2437 }
2438 2438
2439 if (new_cstate != hSession->cstate) { 2439 if (new_cstate != hSession->cstate) {
@@ -2454,7 +2454,7 @@ static void check_in3270(H3270 *hSession) @@ -2454,7 +2454,7 @@ static void check_in3270(H3270 *hSession)
2454 #endif /*]*/ 2454 #endif /*]*/
2455 2455
2456 /* Allocate the initial 3270 input buffer. */ 2456 /* Allocate the initial 3270 input buffer. */
2457 - if(new_cstate >= CONNECTED_INITIAL && !(hSession->ibuf_size && hSession->ibuf)) 2457 + if(new_cstate >= LIB3270_CONNECTED_INITIAL && !(hSession->ibuf_size && hSession->ibuf))
2458 { 2458 {
2459 hSession->ibuf = (unsigned char *) lib3270_malloc(BUFSIZ); 2459 hSession->ibuf = (unsigned char *) lib3270_malloc(BUFSIZ);
2460 hSession->ibuf_size = BUFSIZ; 2460 hSession->ibuf_size = BUFSIZ;
@@ -2463,8 +2463,8 @@ static void check_in3270(H3270 *hSession) @@ -2463,8 +2463,8 @@ static void check_in3270(H3270 *hSession)
2463 2463
2464 #if defined(X3270_ANSI) /*[*/ 2464 #if defined(X3270_ANSI) /*[*/
2465 /* Reinitialize line mode. */ 2465 /* Reinitialize line mode. */
2466 - if ((new_cstate == CONNECTED_ANSI && hSession->linemode) ||  
2467 - new_cstate == CONNECTED_NVT) 2466 + if ((new_cstate == LIB3270_CONNECTED_ANSI && hSession->linemode) ||
  2467 + new_cstate == LIB3270_CONNECTED_NVT)
2468 cooked_init(hSession); 2468 cooked_init(hSession);
2469 #endif /*]*/ 2469 #endif /*]*/
2470 2470