diff --git a/configure.ac b/configure.ac index 83a822a..40f695d 100644 --- a/configure.ac +++ b/configure.ac @@ -346,7 +346,17 @@ AC_CHECK_FUNC(strtok_r, AC_DEFINE(HAVE_STRTOK_R) ) AC_ARG_WITH([inet-ntop], [AS_HELP_STRING([--with-inet-ntop], [Assume that inet_nto() is available])], [ app_cv_inet_ntop="$withval" ],[ app_cv_inet_ntop="auto" ]) if test "$app_cv_inet_ntop" == "auto"; then - AC_CHECK_FUNC(inet_ntop, app_cv_inet_ntop="yes" ) + + case "$host" in + *-mingw32) + app_cv_inet_ntop="yes" + ;; + + *) + AC_CHECK_FUNC(inet_ntop, app_cv_inet_ntop="yes" ) + + esac + fi if test "$app_cv_inet_ntop" == "yes"; then diff --git a/locale/pt_BR.po b/locale/pt_BR.po index cdcd015..d6d981d 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-02 16:38-0200\n" +"POT-Creation-Date: 2017-02-16 13:21-0200\n" "PO-Revision-Date: 2017-02-15 17:08-0200\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português \n" @@ -437,7 +437,7 @@ msgstr "Não consigo determinar o valor da variável de ambiente \"%s\" " msgid "Can't get file size" msgstr "Não foi possível obter o tamanho do arquivo" -#: parsefile.c:328 load.c:251 +#: parsefile.c:328 load.c:269 #, c-format msgid "Can't load %s" msgstr "Não foi possível carregar %s" @@ -477,7 +477,7 @@ msgstr "Incapaz de processar elemento sem nome" msgid "Can't recognize \"%s\" as a valid host type" msgstr "Não reconheço \"%s\" como um tipo de host válido" -#: trace.c:208 save.c:89 +#: trace.c:208 save.c:116 #, c-format msgid "Can't save %s" msgstr "Não foi possível salvar arquivo %s" @@ -1196,7 +1196,7 @@ msgstr "Estado inválido na OIA" msgid "OIA status ok" msgstr "Estado normal na OIA" -#: load.c:253 save.c:91 +#: load.c:271 save.c:118 msgid "Operation has failed" msgstr "Operação falhou" diff --git a/locale/pw3270.pot b/locale/pw3270.pot index ed6e7e7..5dd4d61 100644 --- a/locale/pw3270.pot +++ b/locale/pw3270.pot @@ -9,7 +9,7 @@ msgstr "" "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-02 17:07-0200\n" +"POT-Creation-Date: 2017-02-16 13:31-0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,7 +20,7 @@ msgstr "" "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-02 17:07-0200\n" +"POT-Creation-Date: 2017-02-16 13:31-0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -442,7 +442,7 @@ msgstr "" msgid "Can't get file size" msgstr "" -#: parsefile.c:328 load.c:251 +#: parsefile.c:328 load.c:269 #, c-format msgid "Can't load %s" msgstr "" @@ -482,7 +482,7 @@ msgstr "" msgid "Can't recognize \"%s\" as a valid host type" msgstr "" -#: trace.c:208 save.c:89 +#: trace.c:208 save.c:116 #, c-format msgid "Can't save %s" msgstr "" @@ -1164,7 +1164,7 @@ msgstr "" msgid "OIA status ok" msgstr "" -#: load.c:253 save.c:91 +#: load.c:271 save.c:118 msgid "Operation has failed" msgstr "" diff --git a/src/include/pw3270/ipcpackets.h b/src/include/pw3270/ipcpackets.h index 911e0f2..83ab6ea 100644 --- a/src/include/pw3270/ipcpackets.h +++ b/src/include/pw3270/ipcpackets.h @@ -79,6 +79,8 @@ HLLAPI_PACKET_GET_LENGTH, HLLAPI_PACKET_GET_HOST, + HLLAPI_PACKET_CONNECT_URL, + HLLAPI_PACKET_INVALID } HLLAPI_PACKET; diff --git a/src/lib3270/w3miscc.h b/src/lib3270/w3miscc.h index ad5970b..bcbac95 100644 --- a/src/lib3270/w3miscc.h +++ b/src/lib3270/w3miscc.h @@ -22,6 +22,7 @@ LIB3270_INTERNAL const char *inet_ntop(int af, const void *src, char *dst,socklen_t cnt); #endif // HAVE_INET_NTOP + #if defined(_WIN32) LIB3270_INTERNAL const char *win32_strerror(int e); #endif // WIN32 diff --git a/src/libpw3270cpp/Makefile.in b/src/libpw3270cpp/Makefile.in index 8321de4..87acadd 100644 --- a/src/libpw3270cpp/Makefile.in +++ b/src/libpw3270cpp/Makefile.in @@ -60,7 +60,7 @@ INSTALL_DATA=@INSTALL_DATA@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ CFLAGS=@CFLAGS@ @LIB3270_CFLAGS@ @DBUS_CFLAGS@ -Wno-deprecated-declarations @GTK_CFLAGS@ -I$(BASEDIR)/src/include/pw3270 -LIBS=@LIBS@ @DBUS_LIBS@ +LIBS=@LIBS@ @DBUS_LIBS@ @LIBICONV@ #---[ Rules ]---------------------------------------------------------------------------- diff --git a/src/libpw3270cpp/classlib.cbp b/src/libpw3270cpp/classlib.cbp index 7e15197..7419dc1 100644 --- a/src/libpw3270cpp/classlib.cbp +++ b/src/libpw3270cpp/classlib.cbp @@ -33,6 +33,7 @@ + diff --git a/src/libpw3270cpp/remote.cc b/src/libpw3270cpp/remote.cc index c58d0f9..6705427 100644 --- a/src/libpw3270cpp/remote.cc +++ b/src/libpw3270cpp/remote.cc @@ -856,15 +856,41 @@ virtual int connect(const char *url, time_t wait) { + int rc = EINVAL; + debug("%s(%s,%u)",__FUNCTION__,url,(unsigned int) wait); + if(!url) { + url = ""; + } + #if defined(WIN32) - #error Reimplementar + size_t cbSize = sizeof(struct hllapi_packet_query) + strlen(url) + 1; + struct hllapi_packet_query * pkt = (struct hllapi_packet_query *) malloc(cbSize); + + memset(pkt,0,cbSize); + + pkt->packet_id = HLLAPI_PACKET_CONNECT_URL; + + strcpy(((char *) (pkt+1)), url); + + rc = query_intval((void *) pkt, cbSize, true); + + if(!rc && wait) { + time_t end = time(0) + wait; + while(!is_connected()) { + if(time(0) > end) { + debug("%s: Timeout",__FUNCTION__); + return ETIMEDOUT; + } + Sleep(500); + } + } #elif defined(HAVE_DBUS) - int rc = query_intval("connect", DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID); + rc = query_intval("connect", DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID); debug("connect(%s) rc=%d (%s)",url,rc,strerror(rc)); @@ -879,9 +905,6 @@ } } -#else - rc = EINVAL; - #endif debug("connect(%s) rc=%d (%s)",url,rc,strerror(rc)); diff --git a/src/libpw3270cpp/service.cc b/src/libpw3270cpp/service.cc index 92a922f..0b00e97 100644 --- a/src/libpw3270cpp/service.cc +++ b/src/libpw3270cpp/service.cc @@ -28,6 +28,8 @@ #include + #ifdef HAVE_DBUS + #include #include #include @@ -46,7 +48,6 @@ /*--[ Implement ]--------------------------------------------------------------------------------------------------*/ - #ifdef HAVE_DBUS namespace PW3270_NAMESPACE { DBusConnection * conn; diff --git a/src/plugins/hllapi/pluginmain.c b/src/plugins/hllapi/pluginmain.c index 0136d45..61c8419 100644 --- a/src/plugins/hllapi/pluginmain.c +++ b/src/plugins/hllapi/pluginmain.c @@ -34,7 +34,9 @@ #include "server.h" #ifdef _WIN32 - #include + #include +#else + #error HLLAPI is designed for windows. #endif // _WIN32 #include @@ -211,16 +213,21 @@ static void process_input(pipe_source *source, DWORD cbRead) { + const struct hllapi_packet_query * query = ((struct hllapi_packet_query *) source->buffer); - trace("%s id=%d",__FUNCTION__,((struct hllapi_packet_query *) source->buffer)->packet_id); + trace("%s id=%d",__FUNCTION__,query->packet_id); - switch(((struct hllapi_packet_query *) source->buffer)->packet_id) + switch(query->packet_id) { case HLLAPI_PACKET_CONNECT: send_result(source,lib3270_connect( lib3270_get_default_session_handle(), ((struct hllapi_packet_connect *) source->buffer)->wait)); break; + case HLLAPI_PACKET_CONNECT_URL: + send_result(source,lib3270_connect_url(lib3270_get_default_session_handle(),(const char *) (query+1),0)); + break; + case HLLAPI_PACKET_SET_HOST: send_result(source,lib3270_set_url( lib3270_get_default_session_handle(), ((struct hllapi_packet_text *) source->buffer)->text) != NULL); -- libgit2 0.21.2