Commit 982769004f6a89586e3d60e6e7d41097c7d3ead6

Authored by perry.werneck@gmail.com
1 parent 19acc077

Atualizando GUI

Showing 1 changed file with 11 additions and 40 deletions   Show diff stats
iocalls.c
... ... @@ -79,7 +79,7 @@ static void internal_ring_bell(H3270 *);
79 79 static void (*remove_poll)(void *id)
80 80 = internal_remove_poll;
81 81  
82   - static int (*wait)(H3270 *hSession, int seconds)
  82 + static int (*wait)(H3270 *hSession, int seconds)
83 83 = internal_wait;
84 84  
85 85 static int (*event_dispatcher)(H3270 *hSession,int wait)
... ... @@ -633,31 +633,6 @@ void RemoveTimeOut(void * timer)
633 633 return remove_timeout(timer);
634 634 }
635 635  
636   -/*
637   -void * AddInput(int source, H3270 *session, void (*fn)(H3270 *session))
638   -{
639   - CHECK_SESSION_HANDLE(session);
640   - return add_input(source,session,fn);
641   -}
642   -
643   -void * AddOutput(int source, H3270 *session, void (*fn)(H3270 *session))
644   -{
645   - CHECK_SESSION_HANDLE(session);
646   - return add_output(source,session,fn);
647   -}
648   -
649   -void * AddExcept(int source, H3270 *session, void (*fn)(H3270 *session))
650   -{
651   - CHECK_SESSION_HANDLE(session);
652   - return add_except(source,session,fn);
653   -}
654   -
655   -void RemoveSource(void * id)
656   -{
657   - remove_source(id);
658   -}
659   -*/
660   -
661 636 void x_except_on(H3270 *h)
662 637 {
663 638 if(h->excepting)
... ... @@ -709,7 +684,14 @@ LIB3270_EXPORT void lib3270_register_time_handlers(void * (*add)(unsigned long i
709 684  
710 685 }
711 686  
712   -/*
  687 +LIB3270_EXPORT void lib3270_register_fd_handlers(void * (*add)(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*proc)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata), void (*rm)(void *id)) {
  688 + if(add)
  689 + add_poll = add;
  690 +
  691 + if(rm)
  692 + remove_poll = rm;
  693 +}
  694 +
713 695 LIB3270_EXPORT int lib3270_register_handlers(const struct lib3270_callbacks *cbk)
714 696 {
715 697 if(!cbk)
... ... @@ -719,18 +701,7 @@ LIB3270_EXPORT int lib3270_register_handlers(const struct lib3270_callbacks *cbk
719 701 return EINVAL;
720 702  
721 703 lib3270_register_time_handlers(cbk->AddTimeOut,cbk->RemoveTimeOut);
722   -
723   - if(cbk->AddInput)
724   - add_input = cbk->AddInput;
725   -
726   - if(cbk->AddOutput)
727   - add_output = cbk->AddOutput;
728   -
729   - if(cbk->RemoveSource)
730   - remove_source = cbk->RemoveSource;
731   -
732   - if(cbk->AddExcept)
733   - add_except = cbk->AddExcept;
  704 + lib3270_register_fd_handlers(cbk->add_poll,cbk->remove_poll);
734 705  
735 706 if(cbk->Wait)
736 707 wait = cbk->Wait;
... ... @@ -744,7 +715,7 @@ LIB3270_EXPORT int lib3270_register_handlers(const struct lib3270_callbacks *cbk
744 715 return 0;
745 716  
746 717 }
747   -*/
  718 +
748 719  
749 720 LIB3270_EXPORT void lib3270_iterate(int block) {
750 721 event_dispatcher(NULL,block);
... ...