Commit 83011b4e8eb5bba3aa6efbd50694a94fb5ce6090

Authored by perry.werneck@gmail.com
1 parent 5b102276

Implementando janela de trace

Showing 3 changed files with 6 additions and 5 deletions   Show diff stats
@@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
33 #include <lib3270.h> 33 #include <lib3270.h>
34 #include <lib3270/filetransfer.h> 34 #include <lib3270/filetransfer.h>
35 #include "globals.h" 35 #include "globals.h"
  36 +#include <lib3270/trace.h>
36 37
37 #include <errno.h> 38 #include <errno.h>
38 39
@@ -39,6 +39,7 @@ struct ta; @@ -39,6 +39,7 @@ struct ta;
39 #define LIB3270_TA struct ta 39 #define LIB3270_TA struct ta
40 40
41 #include "globals.h" 41 #include "globals.h"
  42 +#include <lib3270/trace.h>
42 43
43 #ifndef ANDROID 44 #ifndef ANDROID
44 #include <stdlib.h> 45 #include <stdlib.h>
@@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
38 */ 38 */
39 39
40 #include "globals.h" 40 #include "globals.h"
  41 +#include <lib3270/trace.h>
41 42
42 #if defined(X3270_TRACE) /*[*/ 43 #if defined(X3270_TRACE) /*[*/
43 44
@@ -74,9 +75,11 @@ static void wtrace(H3270 *session, const char *fmt, ...); @@ -74,9 +75,11 @@ static void wtrace(H3270 *session, const char *fmt, ...);
74 static void (*vwtrace)(H3270 *session, const char *fmt, va_list args) = __vwtrace; 75 static void (*vwtrace)(H3270 *session, const char *fmt, va_list args) = __vwtrace;
75 76
76 77
77 -LIB3270_EXPORT void lib3270_set_trace_handler( void (*handler)(H3270 *session, const char *fmt, va_list args) ) 78 +LIB3270_EXPORT LIB3270_TRACE_HANDLER lib3270_set_trace_handler( LIB3270_TRACE_HANDLER handler )
78 { 79 {
  80 + void (*ret)(H3270 *session, const char *fmt, va_list args) = vwtrace;
79 vwtrace = handler ? handler : __vwtrace; 81 vwtrace = handler ? handler : __vwtrace;
  82 + return ret;
80 } 83 }
81 84
82 /* display a (row,col) */ 85 /* display a (row,col) */
@@ -88,10 +91,6 @@ const char * rcba(H3270 *hSession, int baddr) @@ -88,10 +91,6 @@ const char * rcba(H3270 *hSession, int baddr)
88 } 91 }
89 92
90 /* Data Stream trace print, handles line wraps */ 93 /* Data Stream trace print, handles line wraps */
91 -  
92 -// static char *tdsbuf = CN;  
93 -// #define TDS_LEN 75  
94 -  
95 static void trace_ds_s(H3270 *hSession, char *s, Boolean can_break) 94 static void trace_ds_s(H3270 *hSession, char *s, Boolean can_break)
96 { 95 {
97 static int dscnt = 0; 96 static int dscnt = 0;