Commit a9a627aa2171d9fc97c5ebdec41ad7c043a8a7aa

Authored by perry.werneck@gmail.com
1 parent 272a17ae

Iniciando "encaixe" dos modulos da versao 5

Showing 4 changed files with 11 additions and 95 deletions   Show diff stats
@@ -946,6 +946,12 @@ LIB3270_EXPORT int lib3270_in_e(H3270 *h) @@ -946,6 +946,12 @@ LIB3270_EXPORT int lib3270_in_e(H3270 *h)
946 return (h->cstate >= CONNECTED_INITIAL_E); 946 return (h->cstate >= CONNECTED_INITIAL_E);
947 } 947 }
948 948
  949 +LIB3270_EXPORT void * lib3270_get_widget(H3270 *h)
  950 +{
  951 + CHECK_SESSION_HANDLE(h);
  952 + return h->widget;
  953 +}
  954 +
949 LIB3270_EXPORT int lib3270_call_thread(int(*callback)(H3270 *h, void *), H3270 *h, void *parm) 955 LIB3270_EXPORT int lib3270_call_thread(int(*callback)(H3270 *h, void *), H3270 *h, void *parm)
950 { 956 {
951 int rc; 957 int rc;
@@ -109,8 +109,8 @@ @@ -109,8 +109,8 @@
109 #endif 109 #endif
110 110
111 /** 3270 connection handle */ 111 /** 3270 connection handle */
112 - #define LUNAME_SIZE 16  
113 - #define FULL_MODEL_NAME_SIZE 13 112 +// #define LUNAME_SIZE 16
  113 +// #define FULL_MODEL_NAME_SIZE 13
114 114
115 #define ST_RESOLVING LIB3270_STATE_RESOLVING 115 #define ST_RESOLVING LIB3270_STATE_RESOLVING
116 #define ST_HALF_CONNECT LIB3270_STATE_HALF_CONNECT 116 #define ST_HALF_CONNECT LIB3270_STATE_HALF_CONNECT
@@ -168,97 +168,7 @@ @@ -168,97 +168,7 @@
168 168
169 typedef struct _h3270 H3270; 169 typedef struct _h3270 H3270;
170 170
171 - struct _h3270  
172 - {  
173 - unsigned short sz; /**< Struct size */  
174 -  
175 - // Connection info  
176 - int secure_connection;  
177 - int sock; /**< Network socket */  
178 - int net_sock;  
179 - LIB3270_CSTATE cstate; /**< Connection state */  
180 -  
181 - #if defined(_WIN32) /*[*/  
182 - HANDLE sock_handle;  
183 - #endif /*]*/  
184 -  
185 - char * hostname;  
186 - char * connected_type;  
187 - char * connected_lu;  
188 - char luname[LUNAME_SIZE+1];  
189 -  
190 - char full_model_name[FULL_MODEL_NAME_SIZE+1];  
191 - char * model_name;  
192 - int model_num;  
193 - char * termtype;  
194 -  
195 - char * current_host; /**< the hostname part, stripped of qualifiers, luname and port number */  
196 - char * full_current_host; /**< the entire string, for use in reconnecting */  
197 - char * reconnect_host;  
198 - char * qualified_host;  
199 - char auto_reconnect_inprogress;  
200 -  
201 - LIB3270_MESSAGE oia_status;  
202 -  
203 - unsigned char oia_flag[LIB3270_FLAG_COUNT];  
204 -  
205 - unsigned short current_port;  
206 -  
207 - // screen info  
208 - int ov_rows;  
209 - int ov_cols;  
210 -// int first_changed;  
211 -// int last_changed;  
212 - int maxROWS;  
213 - int maxCOLS;  
214 - unsigned short rows;  
215 - unsigned short cols;  
216 - int cursor_addr;  
217 - char flipped;  
218 - int screen_alt; /**< alternate screen? */  
219 - int is_altbuffer;  
220 -  
221 - int formatted; /**< set in screen_disp */  
222 -  
223 - // host.c  
224 - char std_ds_host;  
225 - char no_login_host;  
226 - char non_tn3270e_host;  
227 - char passthru_host;  
228 - char ssl_host;  
229 - char ever_3270;  
230 -  
231 - // Widget info  
232 - void * widget;  
233 -  
234 - // xio  
235 - unsigned long ns_read_id;  
236 - unsigned long ns_exception_id;  
237 - char reading;  
238 - char excepting;  
239 -  
240 - /* State change callbacks. */  
241 - struct lib3270_state_callback *st_callbacks[N_ST];  
242 - struct lib3270_state_callback *st_last[N_ST];  
243 -  
244 - /* Session based callbacks */  
245 - void (*configure)(H3270 *session, unsigned short rows, unsigned short cols);  
246 - void (*update)(H3270 *session, int baddr, unsigned char c, unsigned short attr, unsigned char cursor);  
247 - void (*changed)(H3270 *session, int bstart, int bend);  
248 -  
249 - void (*update_cursor)(H3270 *session, unsigned short row, unsigned short col, unsigned char c, unsigned short attr);  
250 - void (*update_oia)(H3270 *session, OIA_FLAG id, unsigned char on);  
251 - void (*update_toggle)(H3270 *session, LIB3270_TOGGLE ix, unsigned char value, LIB3270_TOGGLE_TYPE reason, const char *name);  
252 - void (*update_luname)(H3270 *session, const char *name);  
253 - void (*update_status)(H3270 *session, LIB3270_STATUS id);  
254 - void (*update_connect)(H3270 *session, unsigned char connected);  
255 - void (*update_model)(H3270 *session, const char *name, int model, int rows, int cols);  
256 -  
257 - void (*set_timer)(H3270 *session, unsigned char on);  
258 - void (*erase)(H3270 *session);  
259 - void (*cursor)(H3270 *session, LIB3270_CURSOR id);  
260 -  
261 - }; 171 + #include <lib3270/session.h>
262 172
263 struct lib3270_state_callback 173 struct lib3270_state_callback
264 { 174 {
@@ -181,7 +181,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) @@ -181,7 +181,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model)
181 hSession->cstate = NOT_CONNECTED; 181 hSession->cstate = NOT_CONNECTED;
182 hSession->oia_status = -1; 182 hSession->oia_status = -1;
183 183
184 - strncpy(hSession->full_model_name,"IBM-",FULL_MODEL_NAME_SIZE); 184 + strncpy(hSession->full_model_name,"IBM-",LIB3270_FULL_MODEL_NAME_LENGTH);
185 hSession->model_name = &hSession->full_model_name[4]; 185 hSession->model_name = &hSession->full_model_name[4];
186 186
187 /* 187 /*
@@ -339,7 +339,7 @@ split_host(char *s, char *ansi, char *std_ds, char *passthru, @@ -339,7 +339,7 @@ split_host(char *s, char *ansi, char *std_ds, char *passthru,
339 } 339 }
340 break; 340 break;
341 } 341 }
342 - if (t - s < LUNAME_SIZE) { 342 + if (t - s < LIB3270_LUNAME_LENGTH) {
343 xluname[t - s] = *t; 343 xluname[t - s] = *t;
344 } 344 }
345 } 345 }