Commit a41a0aa37ea013d729327262dbe599ae038e8cec
1 parent
5934e186
Exists in
master
Tamanho do terminal não estava sendo salvo no arquivo de configuração; mais ajus…
…tes para permitir o uso de multiplas sessões
Showing
22 changed files
with
102 additions
and
110 deletions
Show diff stats
latest/Makefile.in
... | ... | @@ -358,7 +358,7 @@ Debug: $(BINDIR)/Debug/$(PACKAGE_NAME)@EXEEXT@ \ |
358 | 358 | $(foreach LIB, $(LIBRARIES), $(BINDIR)/Debug/$(LIB)@DLLEXT@) |
359 | 359 | |
360 | 360 | run: Debug |
361 | - @PATH="$(PATH):.bin/Debug/lib" $(BINDIR)/Debug/$(PACKAGE_NAME)@EXEEXT@ --program-data="$(PWD)" --model=5 --plugin-path=$(BINDIR)/Debug/plugins | |
361 | + @PATH="$(PATH):.bin/Debug/lib" $(BINDIR)/Debug/$(PACKAGE_NAME)@EXEEXT@ --program-data="$(PWD)" --plugin-path=$(BINDIR)/Debug/plugins | |
362 | 362 | |
363 | 363 | distclean: clean |
364 | 364 | @$(MAKE) -C src/lib distclean | ... | ... |
latest/src/gtk2/actions1.c
... | ... | @@ -32,6 +32,7 @@ |
32 | 32 | |
33 | 33 | #include <lib3270/config.h> |
34 | 34 | #include <gdk/gdk.h> |
35 | + #include <stdlib.h> | |
35 | 36 | |
36 | 37 | #include "gui.h" |
37 | 38 | #include "fonts.h" |
... | ... | @@ -755,7 +756,7 @@ |
755 | 756 | gtk_action_group_set_sensitive(action_group[id],status); |
756 | 757 | } |
757 | 758 | |
758 | - static void set_ft_action_state(int state) | |
759 | + static void set_ft_action_state(H3270 *session,int state) | |
759 | 760 | { |
760 | 761 | gtk_action_group_set_sensitive(action_group[ACTION_GROUP_FT],state); |
761 | 762 | } |
... | ... | @@ -789,7 +790,7 @@ |
789 | 790 | action_by_id[f] = dunno; |
790 | 791 | |
791 | 792 | #ifdef X3270_FT |
792 | - set_ft_action_state(0); | |
793 | + set_ft_action_state(hSession,0); | |
793 | 794 | register_schange(ST_3270_MODE, set_ft_action_state); |
794 | 795 | #else |
795 | 796 | gtk_action_group_set_sensitive(ft_actions,FALSE); | ... | ... |
latest/src/gtk2/main.c
... | ... | @@ -76,7 +76,7 @@ static gchar * log_filename = NULL; |
76 | 76 | /*---[ Implement ]----------------------------------------------------------------------------------------------*/ |
77 | 77 | |
78 | 78 | /* Callback for connection state changes. */ |
79 | -static void connect_main(int status) | |
79 | +static void connect_main(H3270 *session, int status) | |
80 | 80 | { |
81 | 81 | gboolean online = (CONNECTED) ? TRUE : FALSE; |
82 | 82 | |
... | ... | @@ -129,7 +129,7 @@ static void connect_main(int status) |
129 | 129 | |
130 | 130 | } |
131 | 131 | |
132 | -static void connect_in3270(int status) | |
132 | +static void connect_in3270(H3270 *session, int status) | |
133 | 133 | { |
134 | 134 | #ifdef X3270_FT |
135 | 135 | action_group_set_sensitive(ACTION_GROUP_FT,status); |
... | ... | @@ -290,17 +290,17 @@ static int program_init(void) |
290 | 290 | g_free(ptr); |
291 | 291 | } |
292 | 292 | |
293 | - Trace("%s","Opening configuration file"); | |
293 | +// Trace("%s","Opening configuration file"); | |
294 | 294 | if(Register3270IOCallbacks(&program_io_callbacks)) |
295 | 295 | return show_lib3270_register_error(_( "Can't register as I/O manager." )); |
296 | 296 | |
297 | - Trace("%s","Setting screen callbacks"); | |
297 | +// Trace("%s","Setting screen callbacks"); | |
298 | 298 | if(Register3270ScreenCallbacks(&program_screen_callbacks)) |
299 | 299 | return show_lib3270_register_error(_( "Can't register as screen manager." )); |
300 | 300 | |
301 | 301 | |
302 | 302 | #ifdef X3270_FT |
303 | - Trace("%s","Starting FT feature"); | |
303 | +// Trace("%s","Starting FT feature"); | |
304 | 304 | if(initft()) |
305 | 305 | return show_lib3270_register_error(_( "Can't register as file-transfer manager." )); |
306 | 306 | #endif |
... | ... | @@ -585,7 +585,7 @@ int main(int argc, char *argv[]) |
585 | 585 | LoadPlugins(); |
586 | 586 | |
587 | 587 | Trace("Initializing library with %s...",argv[0]); |
588 | - hSession = new_3270_session(); | |
588 | + hSession = new_3270_session(GetString("Terminal","Model","")); | |
589 | 589 | |
590 | 590 | if(rc) |
591 | 591 | { |
... | ... | @@ -622,8 +622,8 @@ int main(int argc, char *argv[]) |
622 | 622 | return -1; |
623 | 623 | } |
624 | 624 | |
625 | - connect_main(0); | |
626 | - connect_in3270(0); | |
625 | + connect_main(hSession,0); | |
626 | + connect_in3270(hSession,0); | |
627 | 627 | |
628 | 628 | register_schange(ST_CONNECT, connect_main); |
629 | 629 | register_schange(ST_3270_MODE, connect_in3270); | ... | ... |
latest/src/gtk2/screen.c
latest/src/include/lib3270/api.h
... | ... | @@ -446,7 +446,7 @@ |
446 | 446 | |
447 | 447 | LIB3270_EXPORT int Register3270ScreenCallbacks(const struct lib3270_screen_callbacks *cbk); |
448 | 448 | |
449 | - LIB3270_EXPORT H3270 * new_3270_session(void); | |
449 | + LIB3270_EXPORT H3270 * new_3270_session(const char *model); | |
450 | 450 | |
451 | 451 | LIB3270_EXPORT const struct lib3270_option * get_3270_option_table(int sz); |
452 | 452 | |
... | ... | @@ -531,7 +531,7 @@ |
531 | 531 | LIB3270_EXPORT int host_connect(const char *n, int wait); |
532 | 532 | LIB3270_EXPORT int host_reconnect(int wait); |
533 | 533 | LIB3270_EXPORT void host_disconnect(H3270 *h, int disable); |
534 | - LIB3270_EXPORT void register_schange(LIB3270_STATE_CHANGE tx, void (*func)(int)); | |
534 | + LIB3270_EXPORT void register_schange(LIB3270_STATE_CHANGE tx, void (*func)(H3270 *, int)); | |
535 | 535 | |
536 | 536 | /* Console/Trace window */ |
537 | 537 | LIB3270_EXPORT HCONSOLE console_window_new(const char *title, const char *label); | ... | ... |
latest/src/jni/pw3270_jni.c
... | ... | @@ -100,7 +100,7 @@ int lib3270_jni_init(void) |
100 | 100 | Trace("Running %s on %s %s %s (pid: %d)",__FUNCTION__,__FILE__,__DATE__,__TIME__,getpid()); |
101 | 101 | #endif |
102 | 102 | |
103 | - hSession = new_3270_session(); | |
103 | + hSession = new_3270_session(""); | |
104 | 104 | Trace("%s ends",__FUNCTION__); |
105 | 105 | return 0; |
106 | 106 | } | ... | ... |
latest/src/lib/ansi.c
latest/src/lib/ctlr.c
... | ... | @@ -72,11 +72,8 @@ extern unsigned char aid; |
72 | 72 | |
73 | 73 | /* Globals */ |
74 | 74 | int ROWS, COLS; |
75 | -// int ov_rows, ov_cols; | |
76 | - | |
77 | 75 | int maxROWS = 0; |
78 | 76 | int maxCOLS = 0; |
79 | -// int model_num = -1; | |
80 | 77 | |
81 | 78 | int cursor_addr, buffer_addr; |
82 | 79 | Boolean screen_alt = False; /* alternate screen? */ |
... | ... | @@ -102,8 +99,8 @@ static unsigned char default_bg; |
102 | 99 | static unsigned char default_gr; |
103 | 100 | static unsigned char default_cs; |
104 | 101 | static unsigned char default_ic; |
105 | -static void ctlr_half_connect(int ignored); | |
106 | -static void ctlr_connect(int ignored); | |
102 | +static void ctlr_half_connect(H3270 *session, int ignored); | |
103 | +static void ctlr_connect(H3270 *session, int ignored); | |
107 | 104 | static int sscp_start; |
108 | 105 | static void ticking_stop(void); |
109 | 106 | static void ctlr_add_ic(int baddr, unsigned char ic); |
... | ... | @@ -131,20 +128,6 @@ static unsigned char code_table[64] = { |
131 | 128 | #define REGION_CHANGED(f, l) if(IN_ANSI) changed(&h3270,f,l) |
132 | 129 | #define ONE_CHANGED(n) if(IN_ANSI) changed(&h3270,n,n+1); |
133 | 130 | |
134 | -/* | |
135 | -#define ALL_CHANGED { \ | |
136 | - screen_changed(0,ROWS*COLS); \ | |
137 | - if (IN_ANSI) { first_changed = 0; last_changed = ROWS*COLS; } } | |
138 | - | |
139 | -#define REGION_CHANGED(f, l) { \ | |
140 | - screen_changed(f,l); \ | |
141 | - if (IN_ANSI) { \ | |
142 | - if (first_changed == -1 || f < first_changed) first_changed = f; \ | |
143 | - if (last_changed == -1 || l > last_changed) last_changed = l; } } | |
144 | - | |
145 | -#define ONE_CHANGED(n) REGION_CHANGED(n, n+1) | |
146 | -*/ | |
147 | - | |
148 | 131 | #define DECODE_BADDR(c1, c2) \ |
149 | 132 | ((((c1) & 0xC0) == 0x00) ? \ |
150 | 133 | (((c1) & 0x3F) << 8) | (c2) : \ |
... | ... | @@ -175,8 +158,7 @@ ctlr_init(unsigned cmask unused) |
175 | 158 | /* |
176 | 159 | * Reinitialize the emulated 3270 hardware. |
177 | 160 | */ |
178 | -void | |
179 | -ctlr_reinit(unsigned cmask) | |
161 | +void ctlr_reinit(H3270 *session, unsigned cmask) | |
180 | 162 | { |
181 | 163 | static struct ea *real_ea_buf = NULL; |
182 | 164 | static struct ea *real_aea_buf = NULL; |
... | ... | @@ -222,7 +204,7 @@ int set_3270_model(H3270 *session, int model) |
222 | 204 | return EBUSY; |
223 | 205 | |
224 | 206 | ctlr_set_rows_cols(session,model,session->ov_cols,session->ov_rows); |
225 | - ctlr_reinit(MODEL_CHANGE); | |
207 | + ctlr_reinit(session,MODEL_CHANGE); | |
226 | 208 | return 0; |
227 | 209 | } |
228 | 210 | |
... | ... | @@ -300,7 +282,7 @@ set_formatted(void) |
300 | 282 | * Called when a host is half connected. |
301 | 283 | */ |
302 | 284 | static void |
303 | -ctlr_half_connect(int ignored unused) | |
285 | +ctlr_half_connect(H3270 *session, int ignored unused) | |
304 | 286 | { |
305 | 287 | ticking_start(True); |
306 | 288 | } |
... | ... | @@ -310,7 +292,7 @@ ctlr_half_connect(int ignored unused) |
310 | 292 | * Called when a host connects, disconnects, or changes ANSI/3270 modes. |
311 | 293 | */ |
312 | 294 | static void |
313 | -ctlr_connect(int ignored unused) | |
295 | +ctlr_connect(H3270 *session, int ignored unused) | |
314 | 296 | { |
315 | 297 | ticking_stop(); |
316 | 298 | status_untiming(); | ... | ... |
latest/src/lib/ctlrc.h
... | ... | @@ -40,7 +40,7 @@ LIB3270_INTERNAL void ctlr_erase_all_unprotected(void); |
40 | 40 | LIB3270_INTERNAL void ctlr_init(unsigned cmask); |
41 | 41 | LIB3270_INTERNAL void ctlr_read_buffer(unsigned char aid_byte); |
42 | 42 | LIB3270_INTERNAL void ctlr_read_modified(unsigned char aid_byte, Boolean all); |
43 | -LIB3270_INTERNAL void ctlr_reinit(unsigned cmask); | |
43 | +LIB3270_INTERNAL void ctlr_reinit(H3270 *session, unsigned cmask); | |
44 | 44 | LIB3270_INTERNAL void ctlr_scroll(void); |
45 | 45 | LIB3270_INTERNAL void ctlr_shrink(void); |
46 | 46 | LIB3270_INTERNAL void ctlr_snap_buffer(void); | ... | ... |
latest/src/lib/ft.c
... | ... | @@ -57,8 +57,8 @@ |
57 | 57 | #include "telnetc.h" |
58 | 58 | #include "utilc.h" |
59 | 59 | |
60 | -static void ft_connected(int ignored); | |
61 | -static void ft_in3270(int ignored unused); | |
60 | +static void ft_connected(H3270 *session, int ignored); | |
61 | +static void ft_in3270(H3270 *session, int ignored unused); | |
62 | 62 | |
63 | 63 | /* Macros. */ |
64 | 64 | #define eos(s) strchr((s), '\0') |
... | ... | @@ -372,14 +372,14 @@ ft_aborting(void) |
372 | 372 | } |
373 | 373 | |
374 | 374 | /* Process a disconnect abort. */ |
375 | -static void ft_connected(int ignored) | |
375 | +static void ft_connected(H3270 *session, int ignored) | |
376 | 376 | { |
377 | 377 | if (!CONNECTED && ft_state != FT_NONE) |
378 | 378 | ft_complete(MSG_("ftDisconnected","Host disconnected, transfer cancelled")); |
379 | 379 | } |
380 | 380 | |
381 | 381 | /* Process an abort from no longer being in 3270 mode. */ |
382 | -static void ft_in3270(int ignored) | |
382 | +static void ft_in3270(H3270 *session, int ignored) | |
383 | 383 | { |
384 | 384 | if (!IN_3270 && ft_state != FT_NONE) |
385 | 385 | ft_complete(MSG_("ftNot3270","Not in 3270 mode, transfer cancelled")); | ... | ... |
latest/src/lib/glue.c
... | ... | @@ -100,20 +100,19 @@ |
100 | 100 | |
101 | 101 | #define LAST_ARG "--" |
102 | 102 | |
103 | -/* Statics */ | |
104 | -static int parse_model_number(char *m); | |
105 | - | |
106 | -/* Globals */ | |
107 | -H3270 h3270; | |
108 | -const char *programname; | |
109 | -// char full_model_name[FULL_MODEL_NAME_SIZE] = "IBM-"; | |
110 | -//char *model_name = &full_model_name[4]; | |
111 | -AppRes appres; | |
112 | -int children = 0; | |
113 | -Boolean exiting = False; | |
114 | -char *command_string = CN; | |
115 | -static Boolean sfont = False; | |
116 | -Boolean *standard_font = &sfont; | |
103 | +/*---[ Statics ]--------------------------------------------------------------------------------------------------------------*/ | |
104 | + | |
105 | + static int parse_model_number(const char *m); | |
106 | + | |
107 | +/*---[ Globals ]--------------------------------------------------------------------------------------------------------------*/ | |
108 | + H3270 h3270; | |
109 | + const char * programname; | |
110 | + AppRes appres; | |
111 | + int children = 0; | |
112 | + Boolean exiting = False; | |
113 | +// char * command_string = CN; | |
114 | + static Boolean sfont = False; | |
115 | + Boolean * standard_font = &sfont; | |
117 | 116 | |
118 | 117 | #if defined(WC3270) || defined(LIB3270)/*[*/ |
119 | 118 | char *profile_name = CN; |
... | ... | @@ -150,10 +149,12 @@ const char *toggle_names[N_TOGGLES] = |
150 | 149 | * This function will create and initialize a new 3270 session, but, now |
151 | 150 | * it just returns a static 3270 session structure. |
152 | 151 | * |
152 | + * @param model Terminal model (Can be overrided by command-line options | |
153 | + * | |
153 | 154 | * @return lib3270 internal session structure. |
154 | 155 | * |
155 | 156 | */ |
156 | -H3270 * new_3270_session(void) | |
157 | +H3270 * new_3270_session(const char *model) | |
157 | 158 | { |
158 | 159 | static int configured = 0; |
159 | 160 | |
... | ... | @@ -198,12 +199,17 @@ H3270 * new_3270_session(void) |
198 | 199 | /* |
199 | 200 | * Sort out model and color modes, based on the model number resource. |
200 | 201 | */ |
202 | + if(*appres.model) | |
203 | + model = appres.model; | |
201 | 204 | |
202 | - Trace("Parsing model: %s",appres.model); | |
203 | - model_number = parse_model_number(appres.model); | |
205 | + if(!*model) | |
206 | + model = "2"; // No model, use the default one | |
207 | + | |
208 | +// Trace("Parsing model: %s",appres.model); | |
209 | + model_number = parse_model_number(model); | |
204 | 210 | if (model_number < 0) |
205 | 211 | { |
206 | - popup_an_error("Invalid model number: %s", appres.model); | |
212 | + popup_an_error("Invalid model number: %s", model); | |
207 | 213 | model_number = 0; |
208 | 214 | } |
209 | 215 | |
... | ... | @@ -254,7 +260,7 @@ H3270 * new_3270_session(void) |
254 | 260 | (void) charset_init(CN); |
255 | 261 | } |
256 | 262 | |
257 | - if(screen_init()) | |
263 | + if(screen_init(hSession)) | |
258 | 264 | return NULL; |
259 | 265 | |
260 | 266 | kybd_init(); |
... | ... | @@ -325,7 +331,7 @@ static void initialize(void) |
325 | 331 | appres.compose_map = "latin1"; |
326 | 332 | #endif /*]*/ |
327 | 333 | |
328 | - appres.model = "2"; | |
334 | + appres.model = ""; | |
329 | 335 | appres.hostsfile = CN; |
330 | 336 | appres.port = "telnet"; |
331 | 337 | |
... | ... | @@ -515,8 +521,7 @@ const struct lib3270_option * get_3270_option_table(int sz) |
515 | 521 | * Parse the model number. |
516 | 522 | * Returns -1 (error), 0 (default), or the specified number. |
517 | 523 | */ |
518 | -static int | |
519 | -parse_model_number(char *m) | |
524 | +static int parse_model_number(const char *m) | |
520 | 525 | { |
521 | 526 | int sl; |
522 | 527 | int n; |
... | ... | @@ -645,7 +650,7 @@ static struct { |
645 | 650 | #endif /*]*/ |
646 | 651 | { ResLoginMacro,offset(login_macro), XRM_STRING }, |
647 | 652 | { ResM3279, offset(m3279), XRM_BOOLEAN }, |
648 | - { ResModel, offset(model), XRM_STRING }, | |
653 | +// { ResModel, offset(model), XRM_STRING }, | |
649 | 654 | { ResModifiedSel, offset(modified_sel), XRM_BOOLEAN }, |
650 | 655 | #if defined(C3270) && !defined(_WIN32) /*[*/ |
651 | 656 | { ResMono, offset(mono), XRM_BOOLEAN }, | ... | ... |
latest/src/lib/host.c
... | ... | @@ -972,22 +972,26 @@ save_recent(const char *hn) |
972 | 972 | |
973 | 973 | /* Support for state change callbacks. */ |
974 | 974 | |
975 | -struct st_callback { | |
976 | - struct st_callback *next; | |
977 | - void (*func)(int); | |
975 | +struct st_callback | |
976 | +{ | |
977 | + struct st_callback * next; /**< Next callback in chain */ | |
978 | + H3270 * session; /**< Session owning this callback */ | |
979 | + void (*func)(H3270 *,int); /**< Callback method */ | |
978 | 980 | }; |
979 | 981 | static struct st_callback *st_callbacks[N_ST]; |
980 | 982 | static struct st_callback *st_last[N_ST]; |
981 | 983 | |
982 | 984 | /* Register a function interested in a state change. */ |
983 | 985 | void |
984 | -register_schange(LIB3270_STATE_CHANGE tx, void (*func)(int)) | |
986 | +register_schange(LIB3270_STATE_CHANGE tx, void (*func)(H3270 *, int)) | |
985 | 987 | { |
986 | 988 | struct st_callback *st; |
987 | 989 | |
988 | 990 | st = (struct st_callback *)Malloc(sizeof(*st)); |
989 | - st->func = func; | |
990 | - st->next = (struct st_callback *)NULL; | |
991 | + | |
992 | + st->func = func; | |
993 | + st->next = (struct st_callback *)NULL; | |
994 | + | |
991 | 995 | if (st_last[tx] != (struct st_callback *)NULL) |
992 | 996 | st_last[tx]->next = st; |
993 | 997 | else |
... | ... | @@ -1001,10 +1005,9 @@ st_changed(int tx, int mode) |
1001 | 1005 | { |
1002 | 1006 | struct st_callback *st; |
1003 | 1007 | |
1004 | - for (st = st_callbacks[tx]; | |
1005 | - st != (struct st_callback *)NULL; | |
1006 | - st = st->next) { | |
1007 | - (*st->func)(mode); | |
1008 | + for (st = st_callbacks[tx];st != (struct st_callback *)NULL;st = st->next) | |
1009 | + { | |
1010 | + (*st->func)(&h3270,mode); | |
1008 | 1011 | } |
1009 | 1012 | } |
1010 | 1013 | ... | ... |
latest/src/lib/kybd.c
... | ... | @@ -405,7 +405,7 @@ kybd_inhibit(Boolean inhibit) |
405 | 405 | * Called when a host connects or disconnects. |
406 | 406 | */ |
407 | 407 | static void |
408 | -kybd_connect(int connected) | |
408 | +kybd_connect(H3270 *session, int connected) | |
409 | 409 | { |
410 | 410 | if (kybdlock & KL_DEFERRED_UNLOCK) |
411 | 411 | RemoveTimeOut(unlock_id); |
... | ... | @@ -424,7 +424,7 @@ kybd_connect(int connected) |
424 | 424 | * Called when we switch between 3270 and ANSI modes. |
425 | 425 | */ |
426 | 426 | static void |
427 | -kybd_in3270(int in3270 unused) | |
427 | +kybd_in3270(H3270 *session, int in3270 unused) | |
428 | 428 | { |
429 | 429 | if (kybdlock & KL_DEFERRED_UNLOCK) |
430 | 430 | RemoveTimeOut(unlock_id); | ... | ... |
latest/src/lib/printer.c
... | ... | @@ -101,8 +101,8 @@ static void printer_otimeout(H3270 *session); |
101 | 101 | static void printer_etimeout(H3270 *session); |
102 | 102 | static void printer_dump(struct pr3o *p, Boolean is_err, Boolean is_dead); |
103 | 103 | #endif /*]*/ |
104 | -static void printer_host_connect(int connected unused); | |
105 | -static void printer_exiting(int b unused); | |
104 | +static void printer_host_connect(H3270 *session, int connected unused); | |
105 | +static void printer_exiting(H3270 *session, int b unused); | |
106 | 106 | |
107 | 107 | /* Globals */ |
108 | 108 | |
... | ... | @@ -657,7 +657,7 @@ printer_stop(void) |
657 | 657 | |
658 | 658 | /* The emulator is exiting. Make sure the printer session is cleaned up. */ |
659 | 659 | static void |
660 | -printer_exiting(int b unused) | |
660 | +printer_exiting(H3270 *session, int b unused) | |
661 | 661 | { |
662 | 662 | printer_stop(); |
663 | 663 | } |
... | ... | @@ -684,7 +684,7 @@ lu_callback(Widget w, XtPointer client_data, XtPointer call_data unused) |
684 | 684 | |
685 | 685 | /* Host connect/disconnect/3270-mode event. */ |
686 | 686 | static void |
687 | -printer_host_connect(int connected unused) | |
687 | +printer_host_connect(H3270 *session, int connected unused) | |
688 | 688 | { |
689 | 689 | if (IN_3270) { |
690 | 690 | char *printer_lu = appres.printer_lu; | ... | ... |
latest/src/lib/proxy.c
... | ... | @@ -688,10 +688,10 @@ proxy_socks5(int fd, char *host, unsigned short port, int force_d) |
688 | 688 | int rv; |
689 | 689 | |
690 | 690 | /* Resolve the hostname. */ |
691 | - status_resolving(1); | |
691 | + status_resolving(&h3270,1); | |
692 | 692 | rv = resolve_host_and_port(host, CN, &rport, &ha.sa, &ha_len, |
693 | 693 | errmsg, sizeof(errmsg)); |
694 | - status_resolving(0); | |
694 | + status_resolving(&h3270,0); | |
695 | 695 | if (rv == -2) |
696 | 696 | use_name = 1; |
697 | 697 | else if (rv < 0) { | ... | ... |
latest/src/lib/screen.c
... | ... | @@ -89,12 +89,12 @@ enum ts { TS_AUTO, TS_ON, TS_OFF }; |
89 | 89 | |
90 | 90 | // int windows_cp = 0; |
91 | 91 | |
92 | -static void status_connect(int ignored); | |
93 | -static void status_3270_mode(int ignored); | |
94 | -static void status_printer(int on); | |
92 | +static void status_connect(H3270 *session, int ignored); | |
93 | +static void status_3270_mode(H3270 *session, int ignored); | |
94 | +static void status_printer(H3270 *session, int on); | |
95 | 95 | static int color_from_fa(unsigned char fa); |
96 | 96 | // static Boolean ts_value(const char *s, enum ts *tsp); |
97 | -static void relabel(int ignored); | |
97 | +static void relabel(H3270 *session, int ignored); | |
98 | 98 | |
99 | 99 | void set_display_charset(char *dcs) |
100 | 100 | { |
... | ... | @@ -114,7 +114,7 @@ static void addch(int row, int col, int c, int attr) |
114 | 114 | * @return 0 if ok, non zero if not |
115 | 115 | * |
116 | 116 | */ |
117 | -int screen_init(void) | |
117 | +int screen_init(H3270 *session) | |
118 | 118 | { |
119 | 119 | |
120 | 120 | /* Initialize the console. */ |
... | ... | @@ -148,7 +148,7 @@ int screen_init(void) |
148 | 148 | |
149 | 149 | /* Set up the controller. */ |
150 | 150 | ctlr_init(-1); |
151 | - ctlr_reinit(-1); | |
151 | + ctlr_reinit(session,-1); | |
152 | 152 | |
153 | 153 | /* Set the window label. */ |
154 | 154 | #if defined(WC3270) /*[*/ |
... | ... | @@ -603,7 +603,7 @@ status_oerr(int error_type) |
603 | 603 | |
604 | 604 | } |
605 | 605 | |
606 | -void status_resolving(Boolean on) | |
606 | +void status_resolving(H3270 *session, Boolean on) | |
607 | 607 | { |
608 | 608 | if(callbacks && callbacks->cursor) |
609 | 609 | callbacks->cursor(on ? CURSOR_MODE_LOCKED : CURSOR_MODE_NORMAL); |
... | ... | @@ -611,7 +611,7 @@ void status_resolving(Boolean on) |
611 | 611 | status_changed(on ? STATUS_CODE_RESOLVING : STATUS_CODE_BLANK); |
612 | 612 | } |
613 | 613 | |
614 | -void status_connecting(Boolean on) | |
614 | +void status_connecting(H3270 *session, Boolean on) | |
615 | 615 | { |
616 | 616 | if(callbacks && callbacks->cursor) |
617 | 617 | callbacks->cursor(on ? CURSOR_MODE_LOCKED : CURSOR_MODE_NORMAL); |
... | ... | @@ -699,7 +699,7 @@ void status_lu(const char *lu) |
699 | 699 | callbacks->lu(lu); |
700 | 700 | } |
701 | 701 | |
702 | -static void status_connect(int connected) | |
702 | +static void status_connect(H3270 *session, int connected) | |
703 | 703 | { |
704 | 704 | STATUS_CODE id = STATUS_CODE_USER; |
705 | 705 | |
... | ... | @@ -727,7 +727,7 @@ static void status_connect(int connected) |
727 | 727 | |
728 | 728 | } |
729 | 729 | |
730 | -static void status_3270_mode(int ignored unused) | |
730 | +static void status_3270_mode(H3270 *session, int ignored unused) | |
731 | 731 | { |
732 | 732 | Boolean oia_boxsolid = (IN_3270 && !IN_SSCP); |
733 | 733 | if(oia_boxsolid) |
... | ... | @@ -736,7 +736,7 @@ static void status_3270_mode(int ignored unused) |
736 | 736 | |
737 | 737 | } |
738 | 738 | |
739 | -static void status_printer(int on) | |
739 | +static void status_printer(H3270 *session, int on) | |
740 | 740 | { |
741 | 741 | set(OIA_FLAG_PRINTER,on); |
742 | 742 | } |
... | ... | @@ -802,7 +802,7 @@ screen_title(char *text) |
802 | 802 | } |
803 | 803 | |
804 | 804 | static void |
805 | -relabel(int ignored unused) | |
805 | +relabel(H3270 *session, int ignored unused) | |
806 | 806 | { |
807 | 807 | #if defined(WC3270) /*[*/ |
808 | 808 | if (appres.title != CN) | ... | ... |
latest/src/lib/screen.h
... | ... | @@ -20,6 +20,6 @@ LIB3270_INTERNAL Boolean screen_has_changes; |
20 | 20 | |
21 | 21 | LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend); |
22 | 22 | |
23 | -LIB3270_INTERNAL void status_connecting(Boolean on); | |
24 | -LIB3270_INTERNAL void status_resolving(Boolean on); | |
23 | +LIB3270_INTERNAL void status_connecting(H3270 *session, Boolean on); | |
24 | +LIB3270_INTERNAL void status_resolving(H3270 *session, Boolean on); | |
25 | 25 | ... | ... |
latest/src/lib/screenc.h
... | ... | @@ -26,7 +26,7 @@ LIB3270_INTERNAL void screen_132(void); |
26 | 26 | LIB3270_INTERNAL void screen_80(void); |
27 | 27 | LIB3270_INTERNAL void screen_erase(H3270 *session); |
28 | 28 | LIB3270_INTERNAL void screen_changed(H3270 *session, int bstart, int bend); |
29 | -LIB3270_INTERNAL int screen_init(void); | |
29 | +LIB3270_INTERNAL int screen_init(H3270 *session); | |
30 | 30 | LIB3270_INTERNAL void screen_flip(void); |
31 | 31 | LIB3270_INTERNAL FILE *start_pager(void); |
32 | 32 | LIB3270_INTERNAL Boolean screen_new_display_charsets(char *cslist, char *csname); | ... | ... |
latest/src/lib/telnet.c
... | ... | @@ -516,14 +516,14 @@ int net_connect(const char *host, char *portname, Boolean ls, Boolean *resolving |
516 | 516 | haddr.sin.sin_port = passthru_port; |
517 | 517 | ha_len = sizeof(struct sockaddr_in); |
518 | 518 | } else if (proxy_type > 0) { |
519 | - status_resolving(1); | |
519 | + status_resolving(&h3270,1); | |
520 | 520 | if (resolve_host_and_port(proxy_host, proxy_portname, |
521 | 521 | &proxy_port, &haddr.sa, &ha_len, errmsg, |
522 | 522 | sizeof(errmsg)) < 0) { |
523 | 523 | popup_an_error(errmsg); |
524 | - status_resolving(0); | |
524 | + status_resolving(&h3270,0); | |
525 | 525 | return -1; |
526 | - status_resolving(0); | |
526 | + status_resolving(&h3270,0); | |
527 | 527 | } |
528 | 528 | } else { |
529 | 529 | #if defined(LOCAL_PROCESS) /*[*/ |
... | ... | @@ -534,14 +534,14 @@ int net_connect(const char *host, char *portname, Boolean ls, Boolean *resolving |
534 | 534 | #if defined(LOCAL_PROCESS) /*[*/ |
535 | 535 | local_process = False; |
536 | 536 | #endif /*]*/ |
537 | - status_resolving(1); | |
537 | + status_resolving(&h3270,1); | |
538 | 538 | if (resolve_host_and_port(host, portname, |
539 | 539 | &h3270.current_port, &haddr.sa, &ha_len, |
540 | 540 | errmsg, sizeof(errmsg)) < 0) { |
541 | 541 | popup_an_error(errmsg); |
542 | - status_resolving(0); | |
542 | + status_resolving(&h3270,0); | |
543 | 543 | return -1; |
544 | - status_resolving(0); | |
544 | + status_resolving(&h3270,0); | |
545 | 545 | } |
546 | 546 | #if defined(LOCAL_PROCESS) /*[*/ |
547 | 547 | } |
... | ... | @@ -637,7 +637,7 @@ int net_connect(const char *host, char *portname, Boolean ls, Boolean *resolving |
637 | 637 | #endif /*]*/ |
638 | 638 | |
639 | 639 | /* connect */ |
640 | - status_connecting(1); | |
640 | + status_connecting(&h3270,1); | |
641 | 641 | if (connect(h3270.sock, &haddr.sa, ha_len) == -1) { |
642 | 642 | if (socket_errno() == SE_EWOULDBLOCK |
643 | 643 | #if defined(SE_EINPROGRESS) /*[*/ | ... | ... |
latest/src/lib/trace_ds.c
... | ... | @@ -419,7 +419,7 @@ create_tracefile_header(const char *mode) |
419 | 419 | wtrace("Trace %s %s", mode, ctime(&clk)); |
420 | 420 | wtrace(" Version: %s\n", build); |
421 | 421 | save_yourself(); |
422 | - wtrace(" Command: %s\n", command_string); | |
422 | +// wtrace(" Command: %s\n", command_string); | |
423 | 423 | wtrace(" Model %s", h3270.model_name); |
424 | 424 | wtrace(", %s display", appres.mono ? "monochrome" : "color"); |
425 | 425 | if (appres.extended) | ... | ... |
latest/src/plugins/rexx/init.c
latest/src/plugins/rexx/std_start.c
... | ... | @@ -136,7 +136,7 @@ RexxReturnCode REXXENTRY rx3270LoadFuncs(PSZ Name, LONG Argc, RXSTRING Argv[], P |
136 | 136 | RexxRegisterFunctionExe((char *) rexx_exported_calls[f].name,rexx_exported_calls[f].call); |
137 | 137 | |
138 | 138 | // Init 3270 library |
139 | - hSession = new_3270_session(); | |
139 | + hSession = new_3270_session(""); | |
140 | 140 | |
141 | 141 | return RetValue(Retstr,0); |
142 | 142 | } | ... | ... |