Commit deb5439ae36294b14f9e02362fa1117ef1890b9a
1 parent
1845b47f
Exists in
master
and in
3 other branches
Separando lib com o widget principal e acesso ao arquivo de configuração para fa…
…cilitar o desenvolvimento de plugins
Showing
3 changed files
with
42 additions
and
1 deletions
Show diff stats
Makefile.in
| @@ -76,9 +76,11 @@ DEPENDS ?= *.h Makefile | @@ -76,9 +76,11 @@ DEPENDS ?= *.h Makefile | ||
| 76 | 76 | ||
| 77 | BINDBG ?= $(BINDIR)/Debug | 77 | BINDBG ?= $(BINDIR)/Debug |
| 78 | BINRLS ?= $(BINDIR)/Release | 78 | BINRLS ?= $(BINDIR)/Release |
| 79 | +LIBDBG ?= $(BINDIR)/Debug/lib | ||
| 79 | 80 | ||
| 80 | OBJDBG = $(OBJDIR)/Debug | 81 | OBJDBG = $(OBJDIR)/Debug |
| 81 | OBJRLS = $(OBJDIR)/Release | 82 | OBJRLS = $(OBJDIR)/Release |
| 83 | +LIBRLS = $(OBJDIR)/Release/lib | ||
| 82 | 84 | ||
| 83 | #---[ Rules ]------------------------------------------------------------------ | 85 | #---[ Rules ]------------------------------------------------------------------ |
| 84 | 86 |
html.c
| @@ -191,6 +191,10 @@ | @@ -191,6 +191,10 @@ | ||
| 191 | 191 | ||
| 192 | info->block = info->text+strlen(info->text); | 192 | info->block = info->text+strlen(info->text); |
| 193 | 193 | ||
| 194 | +#ifdef DEBUG | ||
| 195 | + append_string(info,"\n"); | ||
| 196 | +#endif // DEBUG | ||
| 197 | + | ||
| 194 | append_string(info,"<input type=\""); | 198 | append_string(info,"<input type=\""); |
| 195 | append_string(info,mode == HTML_MODE_INPUT_TEXT ? "text" : "password" ); | 199 | append_string(info,mode == HTML_MODE_INPUT_TEXT ? "text" : "password" ); |
| 196 | append_string(info,"\" name=\""); | 200 | append_string(info,"\" name=\""); |
| @@ -231,6 +235,11 @@ | @@ -231,6 +235,11 @@ | ||
| 231 | 235 | ||
| 232 | append_string(info,"></input>"); | 236 | append_string(info,"></input>"); |
| 233 | 237 | ||
| 238 | +#ifdef DEBUG | ||
| 239 | + append_string(info,"\n"); | ||
| 240 | +#endif // DEBUG | ||
| 241 | + | ||
| 242 | + | ||
| 234 | info->mode = HTML_MODE_TEXT; | 243 | info->mode = HTML_MODE_TEXT; |
| 235 | info->maxlength = 0; | 244 | info->maxlength = 0; |
| 236 | } | 245 | } |
| @@ -261,6 +270,14 @@ | @@ -261,6 +270,14 @@ | ||
| 261 | int len = 0; | 270 | int len = 0; |
| 262 | int col; | 271 | int col; |
| 263 | 272 | ||
| 273 | +#ifdef DEBUG | ||
| 274 | + { | ||
| 275 | + char buffer[4096]; | ||
| 276 | + snprintf(buffer,4095,"\n<!-- R%02d/%02d --->\t",row,session->rows); | ||
| 277 | + append_string(&info,buffer); | ||
| 278 | + } | ||
| 279 | +#endif // DEBUG | ||
| 280 | + | ||
| 264 | for(col = 0; col < session->cols;col++) | 281 | for(col = 0; col < session->cols;col++) |
| 265 | { | 282 | { |
| 266 | if( session->text[baddr+col].chr != ' ' || (session->text[baddr+col].attr & LIB3270_ATTR_CG)) | 283 | if( session->text[baddr+col].chr != ' ' || (session->text[baddr+col].attr & LIB3270_ATTR_CG)) |
| @@ -407,7 +424,9 @@ | @@ -407,7 +424,9 @@ | ||
| 407 | else if(cr) | 424 | else if(cr) |
| 408 | { | 425 | { |
| 409 | append_element(&info,HTML_ELEMENT_LINE_BREAK); | 426 | append_element(&info,HTML_ELEMENT_LINE_BREAK); |
| 427 | + | ||
| 410 | } | 428 | } |
| 429 | + | ||
| 411 | } | 430 | } |
| 412 | 431 | ||
| 413 | if(info.mode != HTML_MODE_TEXT) | 432 | if(info.mode != HTML_MODE_TEXT) |
iocalls.c
| @@ -687,12 +687,32 @@ LIB3270_EXPORT void lib3270_main_iterate(H3270 *session, int block) | @@ -687,12 +687,32 @@ LIB3270_EXPORT void lib3270_main_iterate(H3270 *session, int block) | ||
| 687 | event_dispatcher(block); | 687 | event_dispatcher(block); |
| 688 | } | 688 | } |
| 689 | 689 | ||
| 690 | -LIB3270_EXPORT int lib3270_wait(seconds) | 690 | +LIB3270_EXPORT int lib3270_wait(H3270 *hSession, int seconds) |
| 691 | { | 691 | { |
| 692 | wait(seconds); | 692 | wait(seconds); |
| 693 | return 0; | 693 | return 0; |
| 694 | } | 694 | } |
| 695 | 695 | ||
| 696 | +LIB3270_EXPORT int lib3270_wait_for_ready(H3270 *hSession, int seconds) | ||
| 697 | +{ | ||
| 698 | + time_t end = time(0)+seconds; | ||
| 699 | + | ||
| 700 | + while(time(0) < end) | ||
| 701 | + { | ||
| 702 | + event_dispatcher(1); | ||
| 703 | + | ||
| 704 | + if(hSession->oia_status == LIB3270_STATUS_BLANK) | ||
| 705 | + return 0; | ||
| 706 | + | ||
| 707 | + if(!lib3270_connected(hSession)) | ||
| 708 | + return ENOTCONN; | ||
| 709 | + | ||
| 710 | + } | ||
| 711 | + | ||
| 712 | + return ETIMEDOUT; | ||
| 713 | +} | ||
| 714 | + | ||
| 715 | + | ||
| 696 | LIB3270_EXPORT void lib3270_ring_bell(H3270 *session) | 716 | LIB3270_EXPORT void lib3270_ring_bell(H3270 *session) |
| 697 | { | 717 | { |
| 698 | CHECK_SESSION_HANDLE(session); | 718 | CHECK_SESSION_HANDLE(session); |