From deb5439ae36294b14f9e02362fa1117ef1890b9a Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Fri, 20 Jul 2012 11:39:06 +0000 Subject: [PATCH] Separando lib com o widget principal e acesso ao arquivo de configuração para facilitar o desenvolvimento de plugins --- Makefile.in | 2 ++ html.c | 19 +++++++++++++++++++ iocalls.c | 22 +++++++++++++++++++++- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index cca9594..f7ef9e1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -76,9 +76,11 @@ DEPENDS ?= *.h Makefile BINDBG ?= $(BINDIR)/Debug BINRLS ?= $(BINDIR)/Release +LIBDBG ?= $(BINDIR)/Debug/lib OBJDBG = $(OBJDIR)/Debug OBJRLS = $(OBJDIR)/Release +LIBRLS = $(OBJDIR)/Release/lib #---[ Rules ]------------------------------------------------------------------ diff --git a/html.c b/html.c index 04abd49..8c4b1db 100644 --- a/html.c +++ b/html.c @@ -191,6 +191,10 @@ info->block = info->text+strlen(info->text); +#ifdef DEBUG + append_string(info,"\n"); +#endif // DEBUG + append_string(info,""); +#ifdef DEBUG + append_string(info,"\n"); +#endif // DEBUG + + info->mode = HTML_MODE_TEXT; info->maxlength = 0; } @@ -261,6 +270,14 @@ int len = 0; int col; +#ifdef DEBUG + { + char buffer[4096]; + snprintf(buffer,4095,"\n\t",row,session->rows); + append_string(&info,buffer); + } +#endif // DEBUG + for(col = 0; col < session->cols;col++) { if( session->text[baddr+col].chr != ' ' || (session->text[baddr+col].attr & LIB3270_ATTR_CG)) @@ -407,7 +424,9 @@ else if(cr) { append_element(&info,HTML_ELEMENT_LINE_BREAK); + } + } if(info.mode != HTML_MODE_TEXT) diff --git a/iocalls.c b/iocalls.c index bb94677..a19a91f 100644 --- a/iocalls.c +++ b/iocalls.c @@ -687,12 +687,32 @@ LIB3270_EXPORT void lib3270_main_iterate(H3270 *session, int block) event_dispatcher(block); } -LIB3270_EXPORT int lib3270_wait(seconds) +LIB3270_EXPORT int lib3270_wait(H3270 *hSession, int seconds) { wait(seconds); return 0; } +LIB3270_EXPORT int lib3270_wait_for_ready(H3270 *hSession, int seconds) +{ + time_t end = time(0)+seconds; + + while(time(0) < end) + { + event_dispatcher(1); + + if(hSession->oia_status == LIB3270_STATUS_BLANK) + return 0; + + if(!lib3270_connected(hSession)) + return ENOTCONN; + + } + + return ETIMEDOUT; +} + + LIB3270_EXPORT void lib3270_ring_bell(H3270 *session) { CHECK_SESSION_HANDLE(session); -- libgit2 0.21.2