Commit 3923aabb1f328eed7ba97505818edf07b9c1b620

Authored by Perry Werneck
1 parent 6a4e8342

Debbuging SF.

src/core/sf.c
... ... @@ -37,17 +37,16 @@
37 37 */
38 38  
39 39 #include <lib3270-internals.h>
  40 +#include <lib3270/trace.h>
  41 +
40 42 #include <errno.h>
41 43 #if !defined(_WIN32) /*[*/
42   -#include <netinet/in.h>
  44 + #include <netinet/in.h>
43 45 #endif /*]*/
  46 +
44 47 #include "3270ds.h"
45   -// #include "appres.h"
46 48 #include "screen.h"
47   -// #include "ctlr.h"
48   -#include "resources.h"
49   -
50   -// #include "charsetc.h"
  49 +//#include "resources.h"
51 50 #include "ctlrc.h"
52 51  
53 52 #if defined(X3270_FT)
... ... @@ -58,28 +57,20 @@
58 57 #include "screenc.h"
59 58 #include "seec.h"
60 59 #include "sf.h"
61   -// #include "tablesc.h"
62 60 #include "telnetc.h"
63 61 #include "trace_dsc.h"
64 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 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 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 76 /* Statics */
... ... @@ -751,6 +742,11 @@ static void do_query_reply(H3270 *hSession, unsigned char code)
751 742 obptr_len = hSession->output.buf + obptr0;
752 743 len = (hSession->output.ptr - hSession->output.buf) - obptr0;
753 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 750 } else {
755 751 /* Back over the header. */
756 752 hSession->output.ptr -= 4;
... ... @@ -818,6 +814,7 @@ static void do_qr_usable_area(H3270 *hSession)
818 814 *hSession->output.ptr++ = *char_width; /* AW */
819 815 *hSession->output.ptr++ = *char_height; /* AH */
820 816 SET16(hSession->output.ptr, hSession->max.cols * hSession->max.cols); /* buffer, questionable */
  817 +
821 818 }
822 819  
823 820 static void do_qr_color(H3270 *hSession)
... ...
src/include/screen.h
... ... @@ -15,7 +15,7 @@
15 15 /* Non-display version of screen.h */
16 16  
17 17 // #define SELECTED(baddr) False
18   -LIB3270_INTERNAL int *char_width, *char_height;
  18 +// LIB3270_INTERNAL int *char_width, *char_height;
19 19  
20 20 LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend);
21 21 LIB3270_INTERNAL void status_connecting(H3270 *session);
... ...
src/testprogram/testprogram.c
... ... @@ -92,12 +92,13 @@ int main(int argc, char *argv[])
92 92 lib3270_wait_for_ready(h,10);
93 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 99 if(text)
97 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 104 lib3270_session_free(h);
... ...