Commit cec20ff712bc18d95ce4c8e080d4efade082e4e7

Authored by perry.werneck@gmail.com
1 parent e162af43

Remodelando poll de sockets

Showing 4 changed files with 13 additions and 5 deletions   Show diff stats
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 77
78 78
79 //static void net_connected(H3270 *hSession) 79 //static void net_connected(H3270 *hSession)
80 -static void net_connected(H3270 *hSession, LIB3270_IO_FLAG flag, void *dunno) 80 +static void net_connected(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *dunno)
81 { 81 {
82 int err; 82 int err;
83 socklen_t len = sizeof(err); 83 socklen_t len = sizeof(err);
@@ -281,6 +281,14 @@ static void internal_remove_poll(void *id) @@ -281,6 +281,14 @@ static void internal_remove_poll(void *id)
281 inputs_changed = True; 281 inputs_changed = True;
282 } 282 }
283 283
  284 +LIB3270_EXPORT void lib3270_remove_poll(void *id) {
  285 + remove_poll(id);
  286 +}
  287 +
  288 +LIB3270_EXPORT void * lib3270_add_poll_fd(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*call)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata ) {
  289 + return add_poll(session,fd,flag,call,userdata);
  290 +}
  291 +
284 /* Event dispatcher. */ 292 /* Event dispatcher. */
285 static int internal_event_dispatcher(H3270 *hSession, int block) 293 static int internal_event_dispatcher(H3270 *hSession, int block)
286 { 294 {
@@ -988,7 +988,7 @@ LIB3270_EXPORT void lib3270_data_recv(H3270 *hSession, size_t nr, const unsigned @@ -988,7 +988,7 @@ LIB3270_EXPORT void lib3270_data_recv(H3270 *hSession, size_t nr, const unsigned
988 * @param hSession Session handle 988 * @param hSession Session handle
989 * 989 *
990 */ 990 */
991 -void net_input(H3270 *hSession, LIB3270_IO_FLAG flag, void *dunno) 991 +void net_input(H3270 *hSession, int fd, LIB3270_IO_FLAG flag, void *dunno)
992 { 992 {
993 // register unsigned char * cp; 993 // register unsigned char * cp;
994 int nr; 994 int nr;
@@ -1950,7 +1950,7 @@ process_eor(H3270 *hSession) @@ -1950,7 +1950,7 @@ process_eor(H3270 *hSession)
1950 * net_exception 1950 * net_exception
1951 * Called when there is an exceptional condition on the socket. 1951 * Called when there is an exceptional condition on the socket.
1952 */ 1952 */
1953 -void net_exception(H3270 *session, LIB3270_IO_FLAG flag, void *dunno) 1953 +void net_exception(H3270 *session, int fd, LIB3270_IO_FLAG flag, void *dunno)
1954 { 1954 {
1955 CHECK_SESSION_HANDLE(session); 1955 CHECK_SESSION_HANDLE(session);
1956 1956
@@ -34,8 +34,8 @@ LIB3270_INTERNAL void net_add_eor(unsigned char *buf, int len); @@ -34,8 +34,8 @@ LIB3270_INTERNAL void net_add_eor(unsigned char *buf, int len);
34 LIB3270_INTERNAL void net_break(H3270 *hSession); 34 LIB3270_INTERNAL void net_break(H3270 *hSession);
35 LIB3270_INTERNAL int net_connect(H3270 *session, const char *, char *, Boolean, Boolean *, Boolean *); 35 LIB3270_INTERNAL int net_connect(H3270 *session, const char *, char *, Boolean, Boolean *, Boolean *);
36 LIB3270_INTERNAL void net_disconnect(H3270 *session); 36 LIB3270_INTERNAL void net_disconnect(H3270 *session);
37 -LIB3270_INTERNAL void net_exception(H3270 *session, LIB3270_IO_FLAG flag, void *dunno);  
38 -LIB3270_INTERNAL void net_input(H3270 *session, LIB3270_IO_FLAG flag, void *dunno); 37 +LIB3270_INTERNAL void net_exception(H3270 *session, int fd, LIB3270_IO_FLAG flag, void *dunno);
  38 +LIB3270_INTERNAL void net_input(H3270 *session, int fd, LIB3270_IO_FLAG flag, void *dunno);
39 LIB3270_INTERNAL void net_interrupt(H3270 *hSession); 39 LIB3270_INTERNAL void net_interrupt(H3270 *hSession);
40 LIB3270_INTERNAL void net_output(H3270 *hSession); 40 LIB3270_INTERNAL void net_output(H3270 *hSession);
41 LIB3270_INTERNAL void net_sendc(H3270 *hSession, char c); 41 LIB3270_INTERNAL void net_sendc(H3270 *hSession, char c);