Commit e01b0bc190f78e11620ebf239f7d54db4353abcf

Authored by Perry Werneck
1 parent e6700e82

Atualizando empacotamento windows.

@@ -346,7 +346,17 @@ AC_CHECK_FUNC(strtok_r, AC_DEFINE(HAVE_STRTOK_R) ) @@ -346,7 +346,17 @@ AC_CHECK_FUNC(strtok_r, AC_DEFINE(HAVE_STRTOK_R) )
346 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" ]) 346 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" ])
347 347
348 if test "$app_cv_inet_ntop" == "auto"; then 348 if test "$app_cv_inet_ntop" == "auto"; then
349 - AC_CHECK_FUNC(inet_ntop, app_cv_inet_ntop="yes" ) 349 +
  350 + case "$host" in
  351 + *-mingw32)
  352 + app_cv_inet_ntop="yes"
  353 + ;;
  354 +
  355 + *)
  356 + AC_CHECK_FUNC(inet_ntop, app_cv_inet_ntop="yes" )
  357 +
  358 + esac
  359 +
350 fi 360 fi
351 361
352 if test "$app_cv_inet_ntop" == "yes"; then 362 if test "$app_cv_inet_ntop" == "yes"; then
locale/pt_BR.po
@@ -5,7 +5,7 @@ msgid "" @@ -5,7 +5,7 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2017-02-02 16:38-0200\n" 8 +"POT-Creation-Date: 2017-02-16 13:21-0200\n"
9 "PO-Revision-Date: 2017-02-15 17:08-0200\n" 9 "PO-Revision-Date: 2017-02-15 17:08-0200\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Português <perry.werneck@gmail.com>\n" 11 "Language-Team: Português <perry.werneck@gmail.com>\n"
@@ -437,7 +437,7 @@ msgstr &quot;Não consigo determinar o valor da variável de ambiente \&quot;%s\&quot; &quot; @@ -437,7 +437,7 @@ msgstr &quot;Não consigo determinar o valor da variável de ambiente \&quot;%s\&quot; &quot;
437 msgid "Can't get file size" 437 msgid "Can't get file size"
438 msgstr "Não foi possível obter o tamanho do arquivo" 438 msgstr "Não foi possível obter o tamanho do arquivo"
439 439
440 -#: parsefile.c:328 load.c:251 440 +#: parsefile.c:328 load.c:269
441 #, c-format 441 #, c-format
442 msgid "Can't load %s" 442 msgid "Can't load %s"
443 msgstr "Não foi possível carregar %s" 443 msgstr "Não foi possível carregar %s"
@@ -477,7 +477,7 @@ msgstr &quot;Incapaz de processar elemento sem nome&quot; @@ -477,7 +477,7 @@ msgstr &quot;Incapaz de processar elemento sem nome&quot;
477 msgid "Can't recognize \"%s\" as a valid host type" 477 msgid "Can't recognize \"%s\" as a valid host type"
478 msgstr "Não reconheço \"%s\" como um tipo de host válido" 478 msgstr "Não reconheço \"%s\" como um tipo de host válido"
479 479
480 -#: trace.c:208 save.c:89 480 +#: trace.c:208 save.c:116
481 #, c-format 481 #, c-format
482 msgid "Can't save %s" 482 msgid "Can't save %s"
483 msgstr "Não foi possível salvar arquivo %s" 483 msgstr "Não foi possível salvar arquivo %s"
@@ -1196,7 +1196,7 @@ msgstr &quot;Estado inválido na OIA&quot; @@ -1196,7 +1196,7 @@ msgstr &quot;Estado inválido na OIA&quot;
1196 msgid "OIA status ok" 1196 msgid "OIA status ok"
1197 msgstr "Estado normal na OIA" 1197 msgstr "Estado normal na OIA"
1198 1198
1199 -#: load.c:253 save.c:91 1199 +#: load.c:271 save.c:118
1200 msgid "Operation has failed" 1200 msgid "Operation has failed"
1201 msgstr "Operação falhou" 1201 msgstr "Operação falhou"
1202 1202
locale/pw3270.pot
@@ -9,7 +9,7 @@ msgstr &quot;&quot; @@ -9,7 +9,7 @@ msgstr &quot;&quot;
9 "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n" 9 "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n"
10 "Project-Id-Version: PACKAGE VERSION\n" 10 "Project-Id-Version: PACKAGE VERSION\n"
11 "Report-Msgid-Bugs-To: \n" 11 "Report-Msgid-Bugs-To: \n"
12 -"POT-Creation-Date: 2017-02-02 17:07-0200\n" 12 +"POT-Creation-Date: 2017-02-16 13:31-0200\n"
13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15 "Language-Team: LANGUAGE <LL@li.org>\n" 15 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -20,7 +20,7 @@ msgstr &quot;&quot; @@ -20,7 +20,7 @@ msgstr &quot;&quot;
20 "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n" 20 "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n"
21 "Project-Id-Version: PACKAGE VERSION\n" 21 "Project-Id-Version: PACKAGE VERSION\n"
22 "Report-Msgid-Bugs-To: \n" 22 "Report-Msgid-Bugs-To: \n"
23 -"POT-Creation-Date: 2017-02-02 17:07-0200\n" 23 +"POT-Creation-Date: 2017-02-16 13:31-0200\n"
24 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 24 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
25 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 25 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
26 "Language-Team: LANGUAGE <LL@li.org>\n" 26 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -442,7 +442,7 @@ msgstr &quot;&quot; @@ -442,7 +442,7 @@ msgstr &quot;&quot;
442 msgid "Can't get file size" 442 msgid "Can't get file size"
443 msgstr "" 443 msgstr ""
444 444
445 -#: parsefile.c:328 load.c:251 445 +#: parsefile.c:328 load.c:269
446 #, c-format 446 #, c-format
447 msgid "Can't load %s" 447 msgid "Can't load %s"
448 msgstr "" 448 msgstr ""
@@ -482,7 +482,7 @@ msgstr &quot;&quot; @@ -482,7 +482,7 @@ msgstr &quot;&quot;
482 msgid "Can't recognize \"%s\" as a valid host type" 482 msgid "Can't recognize \"%s\" as a valid host type"
483 msgstr "" 483 msgstr ""
484 484
485 -#: trace.c:208 save.c:89 485 +#: trace.c:208 save.c:116
486 #, c-format 486 #, c-format
487 msgid "Can't save %s" 487 msgid "Can't save %s"
488 msgstr "" 488 msgstr ""
@@ -1164,7 +1164,7 @@ msgstr &quot;&quot; @@ -1164,7 +1164,7 @@ msgstr &quot;&quot;
1164 msgid "OIA status ok" 1164 msgid "OIA status ok"
1165 msgstr "" 1165 msgstr ""
1166 1166
1167 -#: load.c:253 save.c:91 1167 +#: load.c:271 save.c:118
1168 msgid "Operation has failed" 1168 msgid "Operation has failed"
1169 msgstr "" 1169 msgstr ""
1170 1170
src/include/pw3270/ipcpackets.h
@@ -79,6 +79,8 @@ @@ -79,6 +79,8 @@
79 HLLAPI_PACKET_GET_LENGTH, 79 HLLAPI_PACKET_GET_LENGTH,
80 HLLAPI_PACKET_GET_HOST, 80 HLLAPI_PACKET_GET_HOST,
81 81
  82 + HLLAPI_PACKET_CONNECT_URL,
  83 +
82 HLLAPI_PACKET_INVALID 84 HLLAPI_PACKET_INVALID
83 85
84 } HLLAPI_PACKET; 86 } HLLAPI_PACKET;
src/lib3270/w3miscc.h
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
22 LIB3270_INTERNAL const char *inet_ntop(int af, const void *src, char *dst,socklen_t cnt); 22 LIB3270_INTERNAL const char *inet_ntop(int af, const void *src, char *dst,socklen_t cnt);
23 #endif // HAVE_INET_NTOP 23 #endif // HAVE_INET_NTOP
24 24
  25 +
25 #if defined(_WIN32) 26 #if defined(_WIN32)
26 LIB3270_INTERNAL const char *win32_strerror(int e); 27 LIB3270_INTERNAL const char *win32_strerror(int e);
27 #endif // WIN32 28 #endif // WIN32
src/libpw3270cpp/Makefile.in
@@ -60,7 +60,7 @@ INSTALL_DATA=@INSTALL_DATA@ @@ -60,7 +60,7 @@ INSTALL_DATA=@INSTALL_DATA@
60 INSTALL_PROGRAM=@INSTALL_PROGRAM@ 60 INSTALL_PROGRAM=@INSTALL_PROGRAM@
61 61
62 CFLAGS=@CFLAGS@ @LIB3270_CFLAGS@ @DBUS_CFLAGS@ -Wno-deprecated-declarations @GTK_CFLAGS@ -I$(BASEDIR)/src/include/pw3270 62 CFLAGS=@CFLAGS@ @LIB3270_CFLAGS@ @DBUS_CFLAGS@ -Wno-deprecated-declarations @GTK_CFLAGS@ -I$(BASEDIR)/src/include/pw3270
63 -LIBS=@LIBS@ @DBUS_LIBS@ 63 +LIBS=@LIBS@ @DBUS_LIBS@ @LIBICONV@
64 64
65 #---[ Rules ]---------------------------------------------------------------------------- 65 #---[ Rules ]----------------------------------------------------------------------------
66 66
src/libpw3270cpp/classlib.cbp
@@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
33 <Compiler> 33 <Compiler>
34 <Add option="-Wall" /> 34 <Add option="-Wall" />
35 </Compiler> 35 </Compiler>
  36 + <Unit filename="../include/pw3270/ipcpackets.h" />
36 <Unit filename="../include/pw3270cpp.h" /> 37 <Unit filename="../include/pw3270cpp.h" />
37 <Unit filename="Makefile.in" /> 38 <Unit filename="Makefile.in" />
38 <Unit filename="exception.cc" /> 39 <Unit filename="exception.cc" />
src/libpw3270cpp/remote.cc
@@ -856,15 +856,41 @@ @@ -856,15 +856,41 @@
856 856
857 virtual int connect(const char *url, time_t wait) 857 virtual int connect(const char *url, time_t wait)
858 { 858 {
  859 + int rc = EINVAL;
  860 +
859 debug("%s(%s,%u)",__FUNCTION__,url,(unsigned int) wait); 861 debug("%s(%s,%u)",__FUNCTION__,url,(unsigned int) wait);
860 862
  863 + if(!url) {
  864 + url = "";
  865 + }
  866 +
861 #if defined(WIN32) 867 #if defined(WIN32)
862 868
863 - #error Reimplementar 869 + size_t cbSize = sizeof(struct hllapi_packet_query) + strlen(url) + 1;
  870 + struct hllapi_packet_query * pkt = (struct hllapi_packet_query *) malloc(cbSize);
  871 +
  872 + memset(pkt,0,cbSize);
  873 +
  874 + pkt->packet_id = HLLAPI_PACKET_CONNECT_URL;
  875 +
  876 + strcpy(((char *) (pkt+1)), url);
  877 +
  878 + rc = query_intval((void *) pkt, cbSize, true);
  879 +
  880 + if(!rc && wait) {
  881 + time_t end = time(0) + wait;
  882 + while(!is_connected()) {
  883 + if(time(0) > end) {
  884 + debug("%s: Timeout",__FUNCTION__);
  885 + return ETIMEDOUT;
  886 + }
  887 + Sleep(500);
  888 + }
  889 + }
864 890
865 #elif defined(HAVE_DBUS) 891 #elif defined(HAVE_DBUS)
866 892
867 - int rc = query_intval("connect", DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID); 893 + rc = query_intval("connect", DBUS_TYPE_STRING, &url, DBUS_TYPE_INVALID);
868 894
869 debug("connect(%s) rc=%d (%s)",url,rc,strerror(rc)); 895 debug("connect(%s) rc=%d (%s)",url,rc,strerror(rc));
870 896
@@ -879,9 +905,6 @@ @@ -879,9 +905,6 @@
879 } 905 }
880 } 906 }
881 907
882 -#else  
883 - rc = EINVAL;  
884 -  
885 #endif 908 #endif
886 debug("connect(%s) rc=%d (%s)",url,rc,strerror(rc)); 909 debug("connect(%s) rc=%d (%s)",url,rc,strerror(rc));
887 910
src/libpw3270cpp/service.cc
@@ -28,6 +28,8 @@ @@ -28,6 +28,8 @@
28 28
29 #include <config.h> 29 #include <config.h>
30 30
  31 + #ifdef HAVE_DBUS
  32 +
31 #include <iostream> 33 #include <iostream>
32 #include <stdio.h> 34 #include <stdio.h>
33 #include <dbus/dbus.h> 35 #include <dbus/dbus.h>
@@ -46,7 +48,6 @@ @@ -46,7 +48,6 @@
46 48
47 /*--[ Implement ]--------------------------------------------------------------------------------------------------*/ 49 /*--[ Implement ]--------------------------------------------------------------------------------------------------*/
48 50
49 - #ifdef HAVE_DBUS  
50 namespace PW3270_NAMESPACE 51 namespace PW3270_NAMESPACE
51 { 52 {
52 DBusConnection * conn; 53 DBusConnection * conn;
src/plugins/hllapi/pluginmain.c
@@ -34,7 +34,9 @@ @@ -34,7 +34,9 @@
34 #include "server.h" 34 #include "server.h"
35 35
36 #ifdef _WIN32 36 #ifdef _WIN32
37 - #include <windows.h> 37 + #include <windows.h>
  38 +#else
  39 + #error HLLAPI is designed for windows.
38 #endif // _WIN32 40 #endif // _WIN32
39 41
40 #include <pw3270/plugin.h> 42 #include <pw3270/plugin.h>
@@ -211,16 +213,21 @@ @@ -211,16 +213,21 @@
211 213
212 static void process_input(pipe_source *source, DWORD cbRead) 214 static void process_input(pipe_source *source, DWORD cbRead)
213 { 215 {
  216 + const struct hllapi_packet_query * query = ((struct hllapi_packet_query *) source->buffer);
214 217
215 - trace("%s id=%d",__FUNCTION__,((struct hllapi_packet_query *) source->buffer)->packet_id); 218 + trace("%s id=%d",__FUNCTION__,query->packet_id);
216 219
217 - switch(((struct hllapi_packet_query *) source->buffer)->packet_id) 220 + switch(query->packet_id)
218 { 221 {
219 case HLLAPI_PACKET_CONNECT: 222 case HLLAPI_PACKET_CONNECT:
220 send_result(source,lib3270_connect( lib3270_get_default_session_handle(), 223 send_result(source,lib3270_connect( lib3270_get_default_session_handle(),
221 ((struct hllapi_packet_connect *) source->buffer)->wait)); 224 ((struct hllapi_packet_connect *) source->buffer)->wait));
222 break; 225 break;
223 226
  227 + case HLLAPI_PACKET_CONNECT_URL:
  228 + send_result(source,lib3270_connect_url(lib3270_get_default_session_handle(),(const char *) (query+1),0));
  229 + break;
  230 +
224 case HLLAPI_PACKET_SET_HOST: 231 case HLLAPI_PACKET_SET_HOST:
225 send_result(source,lib3270_set_url( lib3270_get_default_session_handle(), 232 send_result(source,lib3270_set_url( lib3270_get_default_session_handle(),
226 ((struct hllapi_packet_text *) source->buffer)->text) != NULL); 233 ((struct hllapi_packet_text *) source->buffer)->text) != NULL);