Commit 3923aabb1f328eed7ba97505818edf07b9c1b620

Authored by Perry Werneck
1 parent 6a4e8342

Debbuging SF.

@@ -37,17 +37,16 @@ @@ -37,17 +37,16 @@
37 */ 37 */
38 38
39 #include <lib3270-internals.h> 39 #include <lib3270-internals.h>
  40 +#include <lib3270/trace.h>
  41 +
40 #include <errno.h> 42 #include <errno.h>
41 #if !defined(_WIN32) /*[*/ 43 #if !defined(_WIN32) /*[*/
42 -#include <netinet/in.h> 44 + #include <netinet/in.h>
43 #endif /*]*/ 45 #endif /*]*/
  46 +
44 #include "3270ds.h" 47 #include "3270ds.h"
45 -// #include "appres.h"  
46 #include "screen.h" 48 #include "screen.h"
47 -// #include "ctlr.h"  
48 -#include "resources.h"  
49 -  
50 -// #include "charsetc.h" 49 +//#include "resources.h"
51 #include "ctlrc.h" 50 #include "ctlrc.h"
52 51
53 #if defined(X3270_FT) 52 #if defined(X3270_FT)
@@ -58,28 +57,20 @@ @@ -58,28 +57,20 @@
58 #include "screenc.h" 57 #include "screenc.h"
59 #include "seec.h" 58 #include "seec.h"
60 #include "sf.h" 59 #include "sf.h"
61 -// #include "tablesc.h"  
62 #include "telnetc.h" 60 #include "telnetc.h"
63 #include "trace_dsc.h" 61 #include "trace_dsc.h"
64 #include "utilc.h" 62 #include "utilc.h"
65 63
66 -// #include "api.h"  
67 -  
68 -// Externals  
69 -// extern unsigned char reply_mode;  
70 -// extern int crm_nattr;  
71 -// extern unsigned char crm_attr[];  
72 -  
73 /* Screen globals. */ 64 /* Screen globals. */
74 -static int cw = 7;  
75 -int * char_width = &cw; 65 +static const int cw = 7;
  66 +static const int * char_width = &cw;
76 67
77 -static int ch = 7;  
78 -int * char_height = &ch; 68 +static const int ch = 7;
  69 +static const int * char_height = &ch;
79 70
80 /* Globals */ 71 /* Globals */
81 -static Boolean sfont = False;  
82 -static Boolean * standard_font = &sfont; 72 +static const Boolean sfont = False;
  73 +static const Boolean * standard_font = &sfont;
83 74
84 75
85 /* Statics */ 76 /* Statics */
@@ -751,6 +742,11 @@ static void do_query_reply(H3270 *hSession, unsigned char code) @@ -751,6 +742,11 @@ static void do_query_reply(H3270 *hSession, unsigned char code)
751 obptr_len = hSession->output.buf + obptr0; 742 obptr_len = hSession->output.buf + obptr0;
752 len = (hSession->output.ptr - hSession->output.buf) - obptr0; 743 len = (hSession->output.ptr - hSession->output.buf) - obptr0;
753 SET16(obptr_len, len); 744 SET16(obptr_len, len);
  745 +
  746 +#ifdef DEBUG
  747 + lib3270_trace_data(hSession,see_qcode(replies[i].code),hSession->output.buf + obptr0, len);
  748 +#endif // DEBUG
  749 +
754 } else { 750 } else {
755 /* Back over the header. */ 751 /* Back over the header. */
756 hSession->output.ptr -= 4; 752 hSession->output.ptr -= 4;
@@ -818,6 +814,7 @@ static void do_qr_usable_area(H3270 *hSession) @@ -818,6 +814,7 @@ static void do_qr_usable_area(H3270 *hSession)
818 *hSession->output.ptr++ = *char_width; /* AW */ 814 *hSession->output.ptr++ = *char_width; /* AW */
819 *hSession->output.ptr++ = *char_height; /* AH */ 815 *hSession->output.ptr++ = *char_height; /* AH */
820 SET16(hSession->output.ptr, hSession->max.cols * hSession->max.cols); /* buffer, questionable */ 816 SET16(hSession->output.ptr, hSession->max.cols * hSession->max.cols); /* buffer, questionable */
  817 +
821 } 818 }
822 819
823 static void do_qr_color(H3270 *hSession) 820 static void do_qr_color(H3270 *hSession)
src/include/screen.h
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 /* Non-display version of screen.h */ 15 /* Non-display version of screen.h */
16 16
17 // #define SELECTED(baddr) False 17 // #define SELECTED(baddr) False
18 -LIB3270_INTERNAL int *char_width, *char_height; 18 +// LIB3270_INTERNAL int *char_width, *char_height;
19 19
20 LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend); 20 LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend);
21 LIB3270_INTERNAL void status_connecting(H3270 *session); 21 LIB3270_INTERNAL void status_connecting(H3270 *session);
src/testprogram/testprogram.c
@@ -92,12 +92,13 @@ int main(int argc, char *argv[]) @@ -92,12 +92,13 @@ int main(int argc, char *argv[])
92 lib3270_wait_for_ready(h,10); 92 lib3270_wait_for_ready(h,10);
93 printf("Waiting ends %u\n\n",(unsigned int) time(NULL)); 93 printf("Waiting ends %u\n\n",(unsigned int) time(NULL));
94 94
95 - lib3270_autoptr(char) text = lib3270_get_string_at_address(h,0,-1,0); 95 + lib3270_enter(h);
  96 + lib3270_wait(h,5);
  97 +
  98 + lib3270_autoptr(char) text = lib3270_get_string_at_address(h,0,-1,'\n');
96 if(text) 99 if(text)
97 printf("Screen:\n[%s]\n",text); 100 printf("Screen:\n[%s]\n",text);
98 101
99 - lib3270_enter(h);  
100 - lib3270_wait_for_ready(h,10);  
101 } 102 }
102 103
103 lib3270_session_free(h); 104 lib3270_session_free(h);