From 9e393acbbdf43ba6d77d01b2e2a193fe8035d726 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 19 Apr 2016 14:39:31 -0300 Subject: [PATCH] Melhorando sistema de callbacks. --- ctlr.c | 21 --------------------- session.c | 12 ++++++++++++ telnet.c | 5 +++-- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/ctlr.c b/ctlr.c index a07d6c5..73801db 100644 --- a/ctlr.c +++ b/ctlr.c @@ -2696,27 +2696,6 @@ void ctlr_scroll(H3270 *hSession) #endif /*]*/ /* - * Note that a particular region of the screen has changed. - */ - -// void changed(H3270 *session, int bstart, int bend) -// { - /* - if(session->first_changed < 0) - { - session->first_changed = bstart; - session->last_changed = bend; - return; - } - if(bstart < session->first_changed) - session->first_changed = bstart; - - if(bend > session->last_changed) - session->last_changed = bend; - */ -// } - -/* * Swap the regular and alternate screen buffers */ void ctlr_altbuffer(H3270 *session, int alt) diff --git a/session.c b/session.c index 664e0ec..5334aa7 100644 --- a/session.c +++ b/session.c @@ -331,3 +331,15 @@ LIB3270_EXPORT void * lib3270_get_user_data(H3270 *h) CHECK_SESSION_HANDLE(h); return h->user_data; } + +struct lib3270_session_callbacks * lib3270_get_session_callbacks(H3270 *session, unsigned short sz) +{ + CHECK_SESSION_HANDLE(session); + + if(sz != sizeof(struct lib3270_session_callbacks)) + return NULL; + + return &session->cbk; +} + + diff --git a/telnet.c b/telnet.c index 1e1844f..e30edea 100644 --- a/telnet.c +++ b/telnet.c @@ -1866,10 +1866,11 @@ static void process_bind(H3270 *hSession, unsigned char *buf, int buflen) } #endif /*]*/ -static int -process_eor(H3270 *hSession) +static int process_eor(H3270 *hSession) { + trace("%s: syncing=%s",__FUNCTION__,hSession->syncing ? "Yes" : "No"); + if (hSession->syncing || !(hSession->ibptr - hSession->ibuf)) return(0); -- libgit2 0.21.2