Commit 83bd5a968fb8af87ae046a91d40b20c91976796e
1 parent
9046f9ed
Exists in
master
and in
5 other branches
Atualizando tratamento do loop de mensagems no modo texto
Showing
5 changed files
with
48 additions
and
22 deletions
Show diff stats
src/include/lib3270.h
| ... | ... | @@ -565,6 +565,25 @@ |
| 565 | 565 | */ |
| 566 | 566 | LIB3270_EXPORT int lib3270_call_thread(int(*callback)(H3270 *h, void *), H3270 *h, void *parm); |
| 567 | 567 | |
| 568 | + | |
| 569 | + /** | |
| 570 | + * Run main iteration. | |
| 571 | + * | |
| 572 | + * Run lib3270 internal iterations, check for network inputs, process signals. | |
| 573 | + * | |
| 574 | + * @param wait Wait for signal if not available. | |
| 575 | + * | |
| 576 | + */ | |
| 577 | + LIB3270_EXPORT void lib3270_main_iterate(int wait); | |
| 578 | + | |
| 579 | + /** | |
| 580 | + * Wait for "N" seconds keeping main loop active. | |
| 581 | + * | |
| 582 | + * @param seconds Number of seconds to wait. | |
| 583 | + * | |
| 584 | + */ | |
| 585 | + LIB3270_EXPORT int lib3270_wait(int seconds); | |
| 586 | + | |
| 568 | 587 | /** |
| 569 | 588 | * Get the session's widget. |
| 570 | 589 | * | ... | ... |
src/lib3270/XtGlue.c
| ... | ... | @@ -970,13 +970,13 @@ LIB3270_EXPORT int lib3270_call_thread(int(*callback)(H3270 *h, void *), H3270 * |
| 970 | 970 | return rc; |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | -void RunPendingEvents(int wait) | |
| 973 | +LIB3270_EXPORT void lib3270_main_iterate(int wait) | |
| 974 | 974 | { |
| 975 | 975 | if(callbacks->RunPendingEvents) |
| 976 | 976 | callbacks->RunPendingEvents(wait); |
| 977 | 977 | } |
| 978 | 978 | |
| 979 | -int Wait(int seconds) | |
| 979 | +LIB3270_EXPORT int lib3270_wait(seconds) | |
| 980 | 980 | { |
| 981 | 981 | time_t end; |
| 982 | 982 | |
| ... | ... | @@ -988,7 +988,7 @@ int Wait(int seconds) |
| 988 | 988 | |
| 989 | 989 | while(time(0) < end) |
| 990 | 990 | { |
| 991 | - RunPendingEvents(1); | |
| 991 | + lib3270_main_iterate(1); | |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | return 0; | ... | ... |
src/lib3270/api.h
| ... | ... | @@ -431,11 +431,11 @@ |
| 431 | 431 | #define Toggled(ix) lib3270_get_toggle(NULL,ix) |
| 432 | 432 | #define CallAndWait(c,h,p) lib3270_call_thread(c,h,p) |
| 433 | 433 | |
| 434 | - LOCAL_EXTERN void RunPendingEvents(int wait); | |
| 435 | - LOCAL_EXTERN int Wait(int seconds); | |
| 434 | +// #define RunPendingEvents(x) lib3270_main_iterate(x) | |
| 435 | +// #define Wait(s) lib3270_wait(x) | |
| 436 | 436 | |
| 437 | - LOCAL_EXTERN int ctlr_get_cols(void) __attribute__ ((deprecated)); | |
| 438 | - LOCAL_EXTERN int ctlr_get_rows(void) __attribute__ ((deprecated)); | |
| 437 | +// LOCAL_EXTERN int ctlr_get_cols(void) __attribute__ ((deprecated)); | |
| 438 | +// LOCAL_EXTERN int ctlr_get_rows(void) __attribute__ ((deprecated)); | |
| 439 | 439 | |
| 440 | 440 | /* Screen calls */ |
| 441 | 441 | LOCAL_EXTERN void screen_resume(H3270 *session); | ... | ... |
src/lib3270/host.c
| ... | ... | @@ -618,7 +618,7 @@ int lib3270_connect(H3270 *h, const char *n, int wait) |
| 618 | 618 | |
| 619 | 619 | CHECK_SESSION_HANDLE(h); |
| 620 | 620 | |
| 621 | - RunPendingEvents(0); | |
| 621 | + lib3270_main_iterate(0); | |
| 622 | 622 | |
| 623 | 623 | if(h->auto_reconnect_inprogress) |
| 624 | 624 | return EAGAIN; |
| ... | ... | @@ -634,7 +634,7 @@ int lib3270_connect(H3270 *h, const char *n, int wait) |
| 634 | 634 | { |
| 635 | 635 | while(!IN_ANSI && !IN_3270) |
| 636 | 636 | { |
| 637 | - RunPendingEvents(1); | |
| 637 | + lib3270_main_iterate(1); | |
| 638 | 638 | |
| 639 | 639 | if(!PCONNECTED) |
| 640 | 640 | { | ... | ... |
src/lib3270/lib3270.cbp
| ... | ... | @@ -7,20 +7,22 @@ |
| 7 | 7 | <Option compiler="gcc" /> |
| 8 | 8 | <Build> |
| 9 | 9 | <Target title="Debug"> |
| 10 | - <Option output=".bin\Debug\lib3270" prefix_auto="1" extension_auto="1" /> | |
| 11 | - <Option object_output=".obj\Debug\" /> | |
| 12 | - <Option type="3" /> | |
| 10 | + <Option output=".bin/Debug/lib3270" prefix_auto="1" extension_auto="1" /> | |
| 11 | + <Option object_output=".obj/Debug/" /> | |
| 12 | + <Option type="1" /> | |
| 13 | 13 | <Option compiler="gcc" /> |
| 14 | - <Option createDefFile="1" /> | |
| 15 | - <Option createStaticLib="1" /> | |
| 14 | + <Option use_console_runner="0" /> | |
| 16 | 15 | <Compiler> |
| 17 | 16 | <Add option="-g" /> |
| 18 | 17 | <Add option="-DDEBUG=1" /> |
| 19 | 18 | </Compiler> |
| 19 | + <Linker> | |
| 20 | + <Add library="pthread" /> | |
| 21 | + </Linker> | |
| 20 | 22 | </Target> |
| 21 | 23 | <Target title="Release"> |
| 22 | - <Option output=".bin\Release\lib3270" prefix_auto="1" extension_auto="1" /> | |
| 23 | - <Option object_output=".obj\Release\" /> | |
| 24 | + <Option output=".bin/Release/lib3270" prefix_auto="1" extension_auto="1" /> | |
| 25 | + <Option object_output=".obj/Release/" /> | |
| 24 | 26 | <Option type="3" /> |
| 25 | 27 | <Option compiler="gcc" /> |
| 26 | 28 | <Option createDefFile="1" /> |
| ... | ... | @@ -33,8 +35,8 @@ |
| 33 | 35 | </Linker> |
| 34 | 36 | </Target> |
| 35 | 37 | <Target title="testprogram"> |
| 36 | - <Option output=".bin\Debug\lib3270" prefix_auto="1" extension_auto="1" /> | |
| 37 | - <Option object_output=".obj\testprogram\" /> | |
| 38 | + <Option output=".bin/Debug/lib3270" prefix_auto="1" extension_auto="1" /> | |
| 39 | + <Option object_output=".obj/testprogram/" /> | |
| 38 | 40 | <Option type="1" /> |
| 39 | 41 | <Option compiler="gcc" /> |
| 40 | 42 | <Option use_console_runner="0" /> |
| ... | ... | @@ -51,10 +53,11 @@ |
| 51 | 53 | <Add option="-Wmissing-declarations" /> |
| 52 | 54 | <Add option="-Wall" /> |
| 53 | 55 | <Add option="-DLIB3270=1" /> |
| 54 | - <Add directory="..\include" /> | |
| 55 | - <Add directory="..\include\lib3270" /> | |
| 56 | + <Add directory="../include" /> | |
| 57 | + <Add directory="../include/lib3270" /> | |
| 56 | 58 | </Compiler> |
| 57 | - <Unit filename="..\include\lib3270\config.h.in" /> | |
| 59 | + <Unit filename="../include/lib3270/config.h.in" /> | |
| 60 | + <Unit filename="3270ds.h" /> | |
| 58 | 61 | <Unit filename="Makefile.in" /> |
| 59 | 62 | <Unit filename="X11keysym.h" /> |
| 60 | 63 | <Unit filename="XtGlue.c"> |
| ... | ... | @@ -68,6 +71,7 @@ |
| 68 | 71 | <Option compilerVar="CC" /> |
| 69 | 72 | </Unit> |
| 70 | 73 | <Unit filename="ansic.h" /> |
| 74 | + <Unit filename="api.h" /> | |
| 71 | 75 | <Unit filename="apl.c"> |
| 72 | 76 | <Option compilerVar="CC" /> |
| 73 | 77 | </Unit> |
| ... | ... | @@ -165,6 +169,9 @@ |
| 165 | 169 | <Option compilerVar="CC" /> |
| 166 | 170 | </Unit> |
| 167 | 171 | <Unit filename="seec.h" /> |
| 172 | + <Unit filename="selection.c"> | |
| 173 | + <Option compilerVar="CC" /> | |
| 174 | + </Unit> | |
| 168 | 175 | <Unit filename="sf.c"> |
| 169 | 176 | <Option compilerVar="CC" /> |
| 170 | 177 | </Unit> |
| ... | ... | @@ -181,9 +188,9 @@ |
| 181 | 188 | <Unit filename="telnetc.h" /> |
| 182 | 189 | <Unit filename="testprogram.c"> |
| 183 | 190 | <Option compilerVar="CC" /> |
| 184 | - <Option target="testprogram" /> | |
| 185 | 191 | </Unit> |
| 186 | 192 | <Unit filename="tn3270e.h" /> |
| 193 | + <Unit filename="toggle.h" /> | |
| 187 | 194 | <Unit filename="toggles.c"> |
| 188 | 195 | <Option compilerVar="CC" /> |
| 189 | 196 | </Unit> | ... | ... |