From ea9215dc1672713a3fde97ef5564e395fb07da46 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Fri, 1 Jun 2012 11:56:34 +0000 Subject: [PATCH] Reincluindo função screen-trace --- src/lib3270/ctlr.c | 4 ++-- src/lib3270/kybd.c | 26 +++++++++++++------------- src/lib3270/printc.h | 2 +- src/lib3270/screen.c | 2 +- src/lib3270/trace_ds.c | 680 +++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/lib3270/trace_dsc.h | 2 +- ui/99debug.xml | 2 +- 7 files changed, 44 insertions(+), 674 deletions(-) diff --git a/src/lib3270/ctlr.c b/src/lib3270/ctlr.c index ec9f163..f3251b9 100644 --- a/src/lib3270/ctlr.c +++ b/src/lib3270/ctlr.c @@ -2320,7 +2320,7 @@ ctlr_clear(H3270 *session, Boolean can_snap) if (ctlr_any_data()) { #if defined(X3270_TRACE) /*[*/ if (can_snap && !trace_skipping && lib3270_get_toggle(session,LIB3270_TOGGLE_SCREEN_TRACE)) - trace_screen(); + trace_screen(session); #endif /*]*/ // scroll_save(session->maxROWS, ever_3270 ? False : True); } @@ -2380,7 +2380,7 @@ void ctlr_add(int baddr, unsigned char c, unsigned char cs) { #if defined(X3270_TRACE) /*[*/ if (lib3270_get_toggle(&h3270,LIB3270_TOGGLE_SCREEN_TRACE)) - trace_screen(); + trace_screen(&h3270); #endif /*]*/ trace_primed = False; } diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c index 470bd7b..bcc7c7a 100644 --- a/src/lib3270/kybd.c +++ b/src/lib3270/kybd.c @@ -181,7 +181,7 @@ static const char dxl[] = "0123456789abcdef"; /* * Check if the typeahead queue is available */ -static int enq_chk(void) +static int enq_chk(H3270 *session) { /* If no connection, forget it. */ if (!CONNECTED) @@ -191,23 +191,23 @@ static int enq_chk(void) } /* If operator error, complain and drop it. */ - if (h3270.kybdlock & KL_OERR_MASK) + if (session->kybdlock & KL_OERR_MASK) { - lib3270_ring_bell(NULL); + lib3270_ring_bell(session); trace_event(" dropped (operator error)\n"); return -1; } /* If scroll lock, complain and drop it. */ - if (h3270.kybdlock & KL_SCROLLED) + if (session->kybdlock & KL_SCROLLED) { - lib3270_ring_bell(&h3270); + lib3270_ring_bell(session); trace_event(" dropped (scrolled)\n"); return -1; } /* If typeahead disabled, complain and drop it. */ - if (!h3270.typeahead) + if (!session->typeahead) { trace_event(" dropped (no typeahead)\n"); return -1; @@ -219,11 +219,11 @@ static int enq_chk(void) /* * Put a "Key-aid" on the typeahead queue */ - static void enq_key(unsigned char aid_code) + static void enq_key(H3270 *session, unsigned char aid_code) { struct ta *ta; - if(enq_chk()) + if(enq_chk(session)) return; ta = (struct ta *) lib3270_malloc(sizeof(*ta)); @@ -240,11 +240,11 @@ static int enq_chk(void) else { ta_head = ta; - status_typeahead(&h3270,True); + status_typeahead(session,True); } ta_tail = ta; - trace_event(" Key-aid queued (kybdlock 0x%x)\n", h3270.kybdlock); + trace_event(" Key-aid queued (kybdlock 0x%x)\n", session->kybdlock); } /* @@ -254,7 +254,7 @@ static void enq_ta(H3270 *hSession, void (*fn)(H3270 *, const char *, const char { struct ta *ta; - if(enq_chk()) + if(enq_chk(hSession)) return; CHECK_SESSION_HANDLE(hSession); @@ -566,7 +566,7 @@ LIB3270_FKEY_ACTION( pfkey ) if (hSession->kybdlock & KL_OIA_MINUS) return -1; else if (hSession->kybdlock) - enq_key(pf_xlate[key-1]); + enq_key(hSession,pf_xlate[key-1]); else key_AID(hSession,pf_xlate[key-1]); @@ -583,7 +583,7 @@ LIB3270_FKEY_ACTION( pakey ) if (hSession->kybdlock & KL_OIA_MINUS) return -1; else if (hSession->kybdlock) - enq_key(pa_xlate[key-1]); + enq_key(hSession,pa_xlate[key-1]); else key_AID(hSession,pa_xlate[key-1]); diff --git a/src/lib3270/printc.h b/src/lib3270/printc.h index e7d1acd..4b4a64f 100644 --- a/src/lib3270/printc.h +++ b/src/lib3270/printc.h @@ -17,7 +17,7 @@ * Global declarations for print.c. */ -LIB3270_INTERNAL Boolean fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html); +// LIB3270_INTERNAL Boolean fprint_screen(FILE *f, Boolean even_if_empty, Boolean use_html); LIB3270_INTERNAL void PrintText_action(Widget w, XEvent *event, String *params, Cardinal *num_params); LIB3270_INTERNAL void PrintWindow_action(Widget w, XEvent *event, String *params, diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c index 6b8eb04..c88225b 100644 --- a/src/lib3270/screen.c +++ b/src/lib3270/screen.c @@ -78,7 +78,7 @@ static int logpopup(H3270 *session, void *widget, LIB3270_NOTIFY type, const cha static int (*popup_handler)(H3270 *, void *, LIB3270_NOTIFY, const char *, const char *, const char *, va_list) = logpopup; -enum ts { TS_AUTO, TS_ON, TS_OFF }; +// enum ts { TS_AUTO, TS_ON, TS_OFF }; static void status_connect(H3270 *session, int ignored, void *dunno); static void status_3270_mode(H3270 *session, int ignored, void *dunno); diff --git a/src/lib3270/trace_ds.c b/src/lib3270/trace_ds.c index 397643d..4670840 100644 --- a/src/lib3270/trace_ds.c +++ b/src/lib3270/trace_ds.c @@ -18,7 +18,7 @@ * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA, 02111-1307, USA * - * Este programa está nomeado como trace_ds.c e possui 1089 linhas de código. + * Este programa está nomeado como trace_ds.c e possui - linhas de código. * * Contatos: * @@ -280,544 +280,37 @@ LIB3270_EXPORT void lib3270_trace_event(H3270 *session, const char *fmt, ...) va_end(args); } - - -/* -static void stop_tracing(void) -{ - if (tracef != NULL && tracef != stdout) - (void) fclose(tracef); - tracef = NULL; - if (tracef_pipe != NULL) { - (void) fclose(tracef_pipe); - tracef_pipe = NULL; - } - - lib3270_set_toggle(&h3270,DS_TRACE,0); - lib3270_set_toggle(&h3270,EVENT_TRACE,0); - -} -*/ - -/* Check for a trace file rollover event. -void -trace_rollover_check(void) -{ - if (tracef == NULL || tracef_max == 0) - return; - - // See if we've reached the midpoint. - if (!tracef_midpoint) { - if (tracef_size >= tracef_max / 2) { - tracef_midpoint = ftello(tracef); -#if defined(ROLLOVER_DEBUG) - printf("midpoint is %lld\n", tracef_midpoint); -#endif - tracef_midpoint_header = - create_tracefile_header("rolled over"); - } - return; - } - - // See if we've reached a rollover point. - if (tracef_size >= tracef_max) { - char buf[8*1024]; - int nr; - off_t rpos = tracef_midpoint, wpos = 0; - - if (!tracef_midpoint) - Error("Tracefile rollover logic error"); -#if defined(ROLLOVER_DEBUG) - printf("rolling over at %lld\n", tracef_size); -#endif - // - // Overwrite the file with the midpoint header, and the data - // which follows the midpoint. - // - if (fseeko(tracef, 0, SEEK_SET) < 0) { - popup_an_errno(errno, "trace file fseeko(0) failed"); - stop_tracing(); - return; - } - wtrace("%s", tracef_midpoint_header); - wpos = ftello(tracef); - if (wpos < 0) { - popup_an_errno(errno, "trace file ftello() failed"); - stop_tracing(); - return; - } - if (fseeko(tracef, rpos, SEEK_SET) < 0) { - popup_an_errno(errno, "trace file fseeko(%ld) failed", - (long)rpos); - stop_tracing(); - return; - } -#if defined(ROLLOVER_DEBUG) - printf("rpos = %lld, wpos = %lld\n", rpos, wpos); -#endif - while ((nr = fread(buf, 1, sizeof(buf), tracef)) > 0) { - rpos = ftello(tracef); - if (fseeko(tracef, wpos, SEEK_SET) < 0) { - popup_an_errno(errno, "trace file fseeko(%ld) " - "failed", (long)wpos); - stop_tracing(); - return; - } - if (fwrite(buf, nr, 1, tracef) < 1) - break; - wpos = ftello(tracef); - if (wpos < 0) { - popup_an_errno(errno, "trace file ftello() " - "failed"); - stop_tracing(); - return; - } - if (fseeko(tracef, rpos, SEEK_SET) < 0) { - popup_an_errno(errno, "trace file fseeko(%ld)" - "failed", (long)rpos); - stop_tracing(); - return; - } - } - if (ferror(tracef)) { - popup_an_errno(errno, "trace file rollover copy " - "failed"); - stop_tracing(); - return; - } -#if defined(ROLLOVER_DEBUG) - printf("final wpos = %lld\n", wpos); -#endif - if (ftruncate(fileno(tracef), wpos) < 0) { - popup_an_errno(errno, "trace file ftruncate(%ld) " - "failed", (long)wpos); - stop_tracing(); - return; - } - if (fseeko(tracef, wpos, SEEK_SET) < 0) { - popup_an_errno(errno, "trace file fseeko(%ld) failed", - (long)wpos); - stop_tracing(); - return; - } - tracef_size = wpos; - tracef_midpoint = wpos; - Replace(tracef_midpoint_header, - create_tracefile_header("rolled over")); - } -} -*/ - -/* -#if defined(X3270_DISPLAY) -static Widget trace_shell = (Widget)NULL; -#endif -static int trace_reason; -*/ - -/* Create a trace file header. */ /* -static char * create_tracefile_header(const char *mode) -{ - char *buf; - time_t clk; - - // Create a buffer and redirect output. - buf = lib3270_malloc(MAX_HEADER_SIZE); - tracef_bufptr = buf; - - // Display current status - clk = time((time_t *)0); - wtrace("Trace %s %s", mode, ctime(&clk)); - wtrace(" Version: %s\n", build); - wtrace(" Model %s", h3270.model_name); - wtrace(", %s display", appres.mono ? "monochrome" : "color"); - if (appres.extended) - wtrace(", extended data stream"); - wtrace(", %s emulation", appres.m3279 ? "color" : "monochrome"); - wtrace(", %s charset", lib3270_get_charset(&h3270)); - if (appres.apl_mode) - wtrace(", APL mode"); - wtrace("\n"); - if (CONNECTED) - wtrace(" Connected to %s, port %u\n",h3270.current_host, h3270.current_port); - - // Snap the current TELNET options. - if (net_snap_options()) { - wtrace(" TELNET state:\n"); - trace_netdata('<', obuf, obptr - obuf); - } - - // Dump the screen contents and modes into the trace file. - if (CONNECTED) { - // - // Note that if the screen is not formatted, we do not - // attempt to save what's on it. However, if we're in - // 3270 SSCP-LU or NVT mode, we'll do a dummy, empty - // write to ensure that the display is in the right - // mode. - // - if (h3270.formatted) { - wtrace(" Screen contents:\n"); - obptr = obuf; -#if defined(X3270_TN3270E) - (void) net_add_dummy_tn3270e(); -#endif - ctlr_snap_buffer(); - space3270out(2); - net_add_eor(obuf, obptr - obuf); - obptr += 2; - trace_netdata('<', obuf, obptr - obuf); - - obptr = obuf; -#if defined(X3270_TN3270E) - (void) net_add_dummy_tn3270e(); -#endif - if (ctlr_snap_modes()) { - wtrace(" 3270 modes:\n"); - space3270out(2); - net_add_eor(obuf, obptr - obuf); - obptr += 2; - trace_netdata('<', obuf, obptr - obuf); - } - } -#if defined(X3270_TN3270E) - else if (IN_E) { - obptr = obuf; - if (net_add_dummy_tn3270e()) { - wtrace(" Screen contents:\n"); - space3270out(2); - net_add_eor(obuf, obptr - obuf); - obptr += 2; - trace_netdata('<', obuf, obptr - obuf); - } - } -#endif - } - - wtrace(" Data stream:\n"); - - // Return the buffer. - tracef_bufptr = CN; - return buf; -} -*/ - -/* Calculate the tracefile maximum size. */ /* -static void -get_tracef_max(void) -{ - static Boolean calculated = False; - char *ptr; - Boolean bad = False; - - if (calculated) - return; - - calculated = True; - - if (appres.trace_file_size == CN || - !strcmp(appres.trace_file_size, "0") || - !strncasecmp(appres.trace_file_size, "none", - strlen(appres.trace_file_size))) { - tracef_max = 0; - return; - } - - tracef_max = strtoul(appres.trace_file_size, &ptr, 0); - if (tracef_max == 0 || ptr == appres.trace_file_size || *(ptr + 1)) { - bad = True; - } else switch (*ptr) { - case 'k': - case 'K': - tracef_max *= 1024; - break; - case 'm': - case 'M': - tracef_max *= 1024 * 1024; - break; - case '\0': - break; - default: - bad = True; - break; - } - - if (bad) { - tracef_max = MIN_TRACEFILE_SIZE; -#if defined(X3270_DISPLAY) - popup_an_info("Invalid %s '%s', assuming " - MIN_TRACEFILE_SIZE_NAME, - ResTraceFileSize, - appres.trace_file_size); -#endif - } else if (tracef_max < MIN_TRACEFILE_SIZE) { - tracef_max = MIN_TRACEFILE_SIZE; - } -} -*/ - -/* Parse the name '/dev/fd', so we can simulate it. */ /* -static int -get_devfd(const char *pathname) -{ - unsigned long fd; - char *ptr; - - if (strncmp(pathname, "/dev/fd/", 8)) - return -1; - fd = strtoul(pathname + 8, &ptr, 10); - if (ptr == pathname + 8 || *ptr != '\0' || fd < 0) - return -1; - return fd; -} -*/ - -/* Callback for "OK" button on trace popup */ /* -static void tracefile_callback(Widget w, XtPointer client_data, XtPointer call_data unused) +/** + * Screen trace function, called when the host clears the screen. + * + * @param session Session Handle + */ +void trace_screen(H3270 *session) { - char *tfn = CN; - int devfd = -1; - char *buf; - - tfn = (char *)client_data; - tfn = do_subst(tfn, True, True); - if (strchr(tfn, '\'') || ((int)strlen(tfn) > 0 && tfn[strlen(tfn)-1] == '\\')) - { - popup_an_error("Illegal file name: %s", tfn); - lib3270_free(tfn); - return; - } - - tracef_max = 0; - tracef_midpoint = 0; - Replace(tracef_midpoint_header, CN); + trace_skipping = False; - if (!strcmp(tfn, "stdout")) + if (lib3270_get_toggle(session,LIB3270_TOGGLE_SCREEN_TRACE)) { - tracef = stdout; - } - else - { - // Get the trace file maximum. - get_tracef_max(); - - // If there's a limit, the file can't exist. - if (tracef_max && !access(tfn, R_OK)) - { - popup_an_error("Trace file '%s' already exists",tfn); - lib3270_free(tfn); - return; - } + int row, baddr; - // Open and configure the file. - if ((devfd = get_devfd(tfn)) >= 0) - tracef = fdopen(dup(devfd), "a"); - else - tracef = fopen(tfn, tracef_max? "w+": "a"); - if (tracef == (FILE *)NULL) + for(row=baddr=0;row < session->rows;row++) { - popup_an_errno(errno, tfn); - lib3270_free(tfn); - return; + int col; + wtrace("%02d ",row+1); + + for(col = 0; col < session->cols;col++) + { + if(session->text[baddr].attr & LIB3270_ATTR_CG) + wtrace("%c",'.'); + else if(session->text[baddr].chr) + wtrace("%c",session->text[baddr].chr); + else + wtrace("%c",'.'); + baddr++; + } + wtrace("%s\n",""); } - (void) SETLINEBUF(tracef); -#if !defined(_WIN32) - (void) fcntl(fileno(tracef), F_SETFD, 1); -#endif } - - // Open pw3270's console window - if(!tracewindow_handle) - tracewindow_handle = console_window_new( tfn, NULL ); - - lib3270_free(tfn); - - // We're really tracing, turn the flag on. - appres.toggle[trace_reason].value = True; -// appres.toggle[trace_reason].changed = True; -// menubar_retoggle(&appres.toggle[trace_reason]); - - // Display current status - buf = create_tracefile_header("started"); - wtrace("%s", buf); - lib3270_free(buf); - -} - -#if defined(X3270_DISPLAY) -// Callback for "No File" button on trace popup -static void -no_tracefile_callback(Widget w, XtPointer client_data, - XtPointer call_data unused) -{ - tracefile_callback((Widget)NULL, "", PN); - XtPopdown(trace_shell); -} -#endif -*/ - -/* Open the trace file. -static void -tracefile_on(int reason, LIB3270_TOGGLE_TYPE tt) -{ - char *tracefile_buf = NULL; - char *tracefile; - - if (tracef != (FILE *)NULL) - return; - - trace_reason = reason; - if (appres.secure && tt != TT_INITIAL) { - tracefile_callback((Widget)NULL, "none", PN); - return; - } - if (appres.trace_file) - { - tracefile = appres.trace_file; - } - else - { -#if defined(_WIN32) - tracefile_buf = xs_buffer("%sx3trc.%u.txt", PROGRAM_DATA,getpid()); -#else - - if(appres.trace_dir) - tracefile_buf = xs_buffer("%s/x3trc.%u", appres.trace_dir,getpid()); - else - tracefile_buf = xs_buffer("%s/x3trc.%u", ".",getpid()); - -#endif - tracefile = tracefile_buf; - } - - -#if defined(X3270_DISPLAY) - if (tt == TT_INITIAL || tt == TT_ACTION) -#endif - { - tracefile_callback((Widget)NULL, tracefile, PN); - if (tracefile_buf != NULL) - lib3270_free(tracefile_buf); - return; - } -#if defined(X3270_DISPLAY) - if (trace_shell == NULL) { - trace_shell = create_form_popup("trace", - tracefile_callback, - appres.trace_monitor? no_tracefile_callback: NULL, - FORM_NO_WHITE); - XtVaSetValues(XtNameToWidget(trace_shell, ObjDialog), - XtNvalue, tracefile, - NULL); - } - - // Turn the toggle _off_ until the popup succeeds. - appres.toggle[reason].value = False; - appres.toggle[reason].changed = True; - - popup_popup(trace_shell, XtGrabExclusive); -#endif - - if (tracefile_buf != NULL) - lib3270_free(tracefile_buf); -} - -// Close the trace file. -static void tracefile_off(void) -{ - time_t clk; - - clk = time((time_t *)0); - wtrace("Trace stopped %s", ctime(&clk)); - -#if defined (LIB3270) - - if(tracewindow_handle != NULL) - { - console_window_delete(tracewindow_handle); - tracewindow_handle = NULL; - } - -#elif !defined(_WIN32) - - if (tracewindow_pid != -1) - (void) kill(tracewindow_pid, SIGKILL); - tracewindow_pid = -1; - -#else - - if (tracewindow_handle != NULL) - { - TerminateProcess(tracewindow_handle, 0); - CloseHandle(tracewindow_handle); - tracewindow_handle = NULL; - } - -#endif - - stop_tracing(); -} - - -void toggle_dsTrace(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE tt) -{ - if (lib3270_get_toggle(&h3270,DS_TRACE) && tracef == NULL) - tracefile_on(DS_TRACE, tt); - - // If turning off trace and not still tracing events, close the trace file. - else if (!lib3270_get_toggle(&h3270,DS_TRACE) && !lib3270_get_toggle(&h3270,EVENT_TRACE)) - tracefile_off(); - - if (lib3270_get_toggle(&h3270,DS_TRACE)) - (void) gettimeofday(&ds_ts, (struct timezone *)NULL); -} -*/ - -/* -void toggle_eventTrace(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE tt) -{ - // If turning on event debug, and no trace file, open one. - - if (lib3270_get_toggle(&h3270,EVENT_TRACE) && tracef == NULL) - tracefile_on(EVENT_TRACE, tt); - - // If turning off event debug, and not tracing the data stream, close the trace file. - else if (!lib3270_get_toggle(&h3270,EVENT_TRACE) && !lib3270_get_toggle(&h3270,DS_TRACE)) - tracefile_off(); -} -*/ - -/* Screen trace file support. */ - -/* -#if defined(X3270_DISPLAY) -static Widget screentrace_shell = (Widget)NULL; -#endif -static FILE *screentracef = (FILE *)0; -*/ -/* - * Screen trace function, called when the host clears the screen. - */ -static void do_screentrace(void) -{ - wtrace("\n%s - Not implemented\n",__FUNCTION__); -/* - register int i; - - if (fprint_screen(screentracef, False, False)) { - for (i = 0; i < h3270.cols; i++) - (void) fputc('=', screentracef); - (void) fputc('\n', screentracef); - } -*/ -} - -void trace_screen(void) -{ - trace_skipping = False; - - if (!lib3270_get_toggle(&h3270,LIB3270_TOGGLE_SCREEN_TRACE)) - do_screentrace(); } /* Called from ANSI emulation code to log a single character. */ @@ -846,128 +339,5 @@ void trace_ansi_disc(void) trace_skipping = True; } -/* - * Screen tracing callback. - * Returns True for success, False for failure. - */ /* -static Boolean -screentrace_cb(char *tfn) -{ - tfn = do_subst(tfn, True, True); - screentracef = fopen(tfn, "a"); - if (screentracef == (FILE *)NULL) { - popup_an_errno(errno, tfn); - lib3270_free(tfn); - return False; - } - lib3270_free(tfn); - (void) SETLINEBUF(screentracef); -#if !defined(_WIN32) - (void) fcntl(fileno(screentracef), F_SETFD, 1); -#endif - - // We're really tracing, turn the flag on. - appres.toggle[SCREEN_TRACE].value = True; -// appres.toggle[SCREEN_TRACE].changed = True; -// menubar_retoggle(&appres.toggle[SCREEN_TRACE]); - return True; -} -*/ -/* -#if defined(X3270_DISPLAY) -// Callback for "OK" button on screentrace popup -static void -screentrace_callback(Widget w unused, XtPointer client_data, - XtPointer call_data unused) -{ - if (screentrace_cb(XawDialogGetValueString((Widget)client_data))) - XtPopdown(screentrace_shell); -} - -// Callback for second "OK" button on screentrace popup -static void -onescreen_callback(Widget w, XtPointer client_data, XtPointer call_data unused) -{ - char *tfn; - - if (w) - tfn = XawDialogGetValueString((Widget)client_data); - else - tfn = (char *)client_data; - tfn = do_subst(tfn, True, True); - screentracef = fopen(tfn, "a"); - if (screentracef == (FILE *)NULL) { - popup_an_errno(errno, tfn); - XtFree(tfn); - return; - } - (void) fcntl(fileno(screentracef), F_SETFD, 1); - XtFree(tfn); - - // Save the current image, once. - do_screentrace(); - - // Close the file, we're done. - (void) fclose(screentracef); - screentracef = (FILE *)NULL; - - if (w) - XtPopdown(screentrace_shell); -} -#endif */ - -/* -void toggle_screenTrace(H3270 *session, struct toggle *t unused, LIB3270_TOGGLE_TYPE tt) -{ - wtrace("Screen trace is %s\n",toggled(SCREEN_TRACE),"Enabled" : "Disabled"); - - char *tracefile_buf = NULL; - char *tracefile; - - if (lib3270_get_toggle(&h3270,SCREEN_TRACE)) { - if (appres.screentrace_file) - tracefile = appres.screentrace_file; - else { -#if defined(_WIN32) - tracefile_buf = xs_buffer("%sx3scr.%u.txt",PROGRAM_DATA, getpid()); -#else - if(appres.trace_dir) - tracefile_buf = xs_buffer("%s/x3scr.%u",appres.trace_dir, getpid()); - else - tracefile_buf = xs_buffer("%s/x3scr.%u",".", getpid()); -#endif - tracefile = tracefile_buf; - } - if (tt == TT_INITIAL || tt == TT_ACTION) { - (void) screentrace_cb(NewString(tracefile)); - if (tracefile_buf != NULL) - lib3270_free(tracefile_buf); - return; - } -#if defined(X3270_DISPLAY) - if (screentrace_shell == NULL) { - screentrace_shell = create_form_popup("screentrace", - screentrace_callback, onescreen_callback, - FORM_NO_WHITE); - XtVaSetValues(XtNameToWidget(screentrace_shell, - ObjDialog), - XtNvalue, tracefile, - NULL); - } - appres.toggle[SCREEN_TRACE].value = False; - appres.toggle[SCREEN_TRACE].changed = True; - popup_popup(screentrace_shell, XtGrabExclusive); #endif - } else { - if (ctlr_any_data() && !trace_skipping) - do_screentrace(); - (void) fclose(screentracef); - } - - if (tracefile_buf != NULL) - lib3270_free(tracefile_buf); -} -*/ - -#endif /*]*/ diff --git a/src/lib3270/trace_dsc.h b/src/lib3270/trace_dsc.h index c3bc092..c66e119 100644 --- a/src/lib3270/trace_dsc.h +++ b/src/lib3270/trace_dsc.h @@ -48,7 +48,7 @@ void trace_ds_nb(const char *fmt, ...) printflike(1, 2); void trace_dsn(const char *fmt, ...) printflike(1, 2); void trace_event(const char *fmt, ...) printflike(1, 2); - void trace_screen(void); + void trace_screen(H3270 *session); // void trace_rollover_check(void); #elif defined(__GNUC__) diff --git a/ui/99debug.xml b/ui/99debug.xml index f4ec67f..6fd38b8 100644 --- a/ui/99debug.xml +++ b/ui/99debug.xml @@ -38,7 +38,7 @@ - + -- libgit2 0.21.2