From 5c12e21e9935ad031d244d93f310d06292ccb45b Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Sat, 19 Apr 2014 14:38:00 +0000 Subject: [PATCH] Ajuste na API --- src/lib3270/connect.c | 40 +++++++++++++++++++--------------------- src/lib3270/host.c | 28 ---------------------------- 2 files changed, 19 insertions(+), 49 deletions(-) diff --git a/src/lib3270/connect.c b/src/lib3270/connect.c index 31e8466..c3e2801 100644 --- a/src/lib3270/connect.c +++ b/src/lib3270/connect.c @@ -251,7 +251,6 @@ static void net_connected(H3270 *hSession) snprintf(hSession->full_model_name,LIB3270_FULL_MODEL_NAME_LENGTH,"IBM-327%c-%d",hSession->m3279 ? '9' : '8', hSession->model_num); - hSession->ever_3270 = False; memset(&hints, 0, sizeof(struct addrinfo)); @@ -263,7 +262,6 @@ static void net_connected(H3270 *hSession) hints.ai_addr = NULL; hints.ai_next = NULL; - hSession->cstate = LIB3270_RESOLVING; lib3270_st_changed(hSession, LIB3270_STATE_RESOLVING, True); @@ -276,29 +274,29 @@ static void net_connected(H3270 *hSession) snprintf(buffer,4095,_( "Can't connect to %s:%s"), hSession->host.current, hSession->host.srvc); #if defined(WIN32) && defined(HAVE_ICONV) - { - char tmpbuffer[4096]; - const char * msg = gai_strerror(s); - size_t in = strlen(msg); - size_t out = 4096; - char * ptr = tmpbuffer; + { + char tmpbuffer[4096]; + const char * msg = gai_strerror(s); + size_t in = strlen(msg); + size_t out = 4096; + char * ptr = tmpbuffer; - iconv_t hConv = iconv_open(lib3270_win32_local_charset(),"UTF-8"); + iconv_t hConv = iconv_open(lib3270_win32_local_charset(),"UTF-8"); - trace("Antes: [%s]",msg); - if(iconv(hConv,&msg,&in,&ptr,&out) != ((size_t) -1)) - msg = tmpbuffer; - trace("Depois: [%s]",msg); + trace("Antes: [%s]",msg); + if(iconv(hConv,&msg,&in,&ptr,&out) != ((size_t) -1)) + msg = tmpbuffer; + trace("Depois: [%s]",msg); - iconv_close(hConv); + iconv_close(hConv); - lib3270_popup_dialog( hSession, - LIB3270_NOTIFY_ERROR, - _( "Connection error" ), - buffer, - "%s", - msg); - } + lib3270_popup_dialog( hSession, + LIB3270_NOTIFY_ERROR, + _( "Connection error" ), + buffer, + "%s", + msg); + } #else lib3270_popup_dialog( hSession, diff --git a/src/lib3270/host.c b/src/lib3270/host.c index d71fe73..3707c2b 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -362,34 +362,6 @@ LIB3270_EXPORT const char * lib3270_get_host(H3270 *h) return h->host.full; } -/* -LIB3270_EXPORT int lib3270_reconnect(H3270 *hSession,int wait) -{ - int rc; - - CHECK_SESSION_HANDLE(hSession); - - if (CONNECTED || HALF_CONNECTED) - return EBUSY; - - if (!hSession->host.full) - return EINVAL; - - if (hSession->auto_reconnect_inprogress) - return EBUSY; - - rc = lib3270_connect(hSession,wait); - - if(rc) - { - hSession->auto_reconnect_inprogress = 0; - return rc; - } - - return 0; -} -*/ - LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h) { CHECK_SESSION_HANDLE(h); -- libgit2 0.21.2