From 3923aabb1f328eed7ba97505818edf07b9c1b620 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 10 Sep 2019 14:22:43 -0300 Subject: [PATCH] Debbuging SF. --- src/core/sf.c | 37 +++++++++++++++++-------------------- src/include/screen.h | 2 +- src/testprogram/testprogram.c | 7 ++++--- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/core/sf.c b/src/core/sf.c index d962d70..15c17ec 100644 --- a/src/core/sf.c +++ b/src/core/sf.c @@ -37,17 +37,16 @@ */ #include +#include + #include #if !defined(_WIN32) /*[*/ -#include + #include #endif /*]*/ + #include "3270ds.h" -// #include "appres.h" #include "screen.h" -// #include "ctlr.h" -#include "resources.h" - -// #include "charsetc.h" +//#include "resources.h" #include "ctlrc.h" #if defined(X3270_FT) @@ -58,28 +57,20 @@ #include "screenc.h" #include "seec.h" #include "sf.h" -// #include "tablesc.h" #include "telnetc.h" #include "trace_dsc.h" #include "utilc.h" -// #include "api.h" - -// Externals -// extern unsigned char reply_mode; -// extern int crm_nattr; -// extern unsigned char crm_attr[]; - /* Screen globals. */ -static int cw = 7; -int * char_width = &cw; +static const int cw = 7; +static const int * char_width = &cw; -static int ch = 7; -int * char_height = &ch; +static const int ch = 7; +static const int * char_height = &ch; /* Globals */ -static Boolean sfont = False; -static Boolean * standard_font = &sfont; +static const Boolean sfont = False; +static const Boolean * standard_font = &sfont; /* Statics */ @@ -751,6 +742,11 @@ static void do_query_reply(H3270 *hSession, unsigned char code) obptr_len = hSession->output.buf + obptr0; len = (hSession->output.ptr - hSession->output.buf) - obptr0; SET16(obptr_len, len); + +#ifdef DEBUG + lib3270_trace_data(hSession,see_qcode(replies[i].code),hSession->output.buf + obptr0, len); +#endif // DEBUG + } else { /* Back over the header. */ hSession->output.ptr -= 4; @@ -818,6 +814,7 @@ static void do_qr_usable_area(H3270 *hSession) *hSession->output.ptr++ = *char_width; /* AW */ *hSession->output.ptr++ = *char_height; /* AH */ SET16(hSession->output.ptr, hSession->max.cols * hSession->max.cols); /* buffer, questionable */ + } static void do_qr_color(H3270 *hSession) diff --git a/src/include/screen.h b/src/include/screen.h index f2a0c86..c79e5f4 100644 --- a/src/include/screen.h +++ b/src/include/screen.h @@ -15,7 +15,7 @@ /* Non-display version of screen.h */ // #define SELECTED(baddr) False -LIB3270_INTERNAL int *char_width, *char_height; +// LIB3270_INTERNAL int *char_width, *char_height; LIB3270_INTERNAL void screen_update(H3270 *session, int bstart, int bend); LIB3270_INTERNAL void status_connecting(H3270 *session); diff --git a/src/testprogram/testprogram.c b/src/testprogram/testprogram.c index 5c83bd9..24e9869 100644 --- a/src/testprogram/testprogram.c +++ b/src/testprogram/testprogram.c @@ -92,12 +92,13 @@ int main(int argc, char *argv[]) lib3270_wait_for_ready(h,10); printf("Waiting ends %u\n\n",(unsigned int) time(NULL)); - lib3270_autoptr(char) text = lib3270_get_string_at_address(h,0,-1,0); + lib3270_enter(h); + lib3270_wait(h,5); + + lib3270_autoptr(char) text = lib3270_get_string_at_address(h,0,-1,'\n'); if(text) printf("Screen:\n[%s]\n",text); - lib3270_enter(h); - lib3270_wait_for_ready(h,10); } lib3270_session_free(h); -- libgit2 0.21.2