Commit e01b0bc190f78e11620ebf239f7d54db4353abcf

Authored by Perry Werneck
1 parent e6700e82

Atualizando empacotamento windows.

configure.ac
... ... @@ -346,7 +346,17 @@ AC_CHECK_FUNC(strtok_r, AC_DEFINE(HAVE_STRTOK_R) )
346 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 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 360 fi
351 361  
352 362 if test "$app_cv_inet_ntop" == "yes"; then
... ...
locale/pt_BR.po
... ... @@ -5,7 +5,7 @@ msgid ""
5 5 msgstr ""
6 6 "Project-Id-Version: pw3270 5.0\n"
7 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 9 "PO-Revision-Date: 2017-02-15 17:08-0200\n"
10 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 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 437 msgid "Can't get file size"
438 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 441 #, c-format
442 442 msgid "Can't load %s"
443 443 msgstr "Não foi possível carregar %s"
... ... @@ -477,7 +477,7 @@ msgstr &quot;Incapaz de processar elemento sem nome&quot;
477 477 msgid "Can't recognize \"%s\" as a valid host type"
478 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 481 #, c-format
482 482 msgid "Can't save %s"
483 483 msgstr "Não foi possível salvar arquivo %s"
... ... @@ -1196,7 +1196,7 @@ msgstr &quot;Estado inválido na OIA&quot;
1196 1196 msgid "OIA status ok"
1197 1197 msgstr "Estado normal na OIA"
1198 1198  
1199   -#: load.c:253 save.c:91
  1199 +#: load.c:271 save.c:118
1200 1200 msgid "Operation has failed"
1201 1201 msgstr "Operação falhou"
1202 1202  
... ...
locale/pw3270.pot
... ... @@ -9,7 +9,7 @@ msgstr &quot;&quot;
9 9 "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n"
10 10 "Project-Id-Version: PACKAGE VERSION\n"
11 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 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14 14 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
15 15 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -20,7 +20,7 @@ msgstr &quot;&quot;
20 20 "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n"
21 21 "Project-Id-Version: PACKAGE VERSION\n"
22 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 24 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
25 25 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
26 26 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -442,7 +442,7 @@ msgstr &quot;&quot;
442 442 msgid "Can't get file size"
443 443 msgstr ""
444 444  
445   -#: parsefile.c:328 load.c:251
  445 +#: parsefile.c:328 load.c:269
446 446 #, c-format
447 447 msgid "Can't load %s"
448 448 msgstr ""
... ... @@ -482,7 +482,7 @@ msgstr &quot;&quot;
482 482 msgid "Can't recognize \"%s\" as a valid host type"
483 483 msgstr ""
484 484  
485   -#: trace.c:208 save.c:89
  485 +#: trace.c:208 save.c:116
486 486 #, c-format
487 487 msgid "Can't save %s"
488 488 msgstr ""
... ... @@ -1164,7 +1164,7 @@ msgstr &quot;&quot;
1164 1164 msgid "OIA status ok"
1165 1165 msgstr ""
1166 1166  
1167   -#: load.c:253 save.c:91
  1167 +#: load.c:271 save.c:118
1168 1168 msgid "Operation has failed"
1169 1169 msgstr ""
1170 1170  
... ...
src/include/pw3270/ipcpackets.h
... ... @@ -79,6 +79,8 @@
79 79 HLLAPI_PACKET_GET_LENGTH,
80 80 HLLAPI_PACKET_GET_HOST,
81 81  
  82 + HLLAPI_PACKET_CONNECT_URL,
  83 +
82 84 HLLAPI_PACKET_INVALID
83 85  
84 86 } HLLAPI_PACKET;
... ...
src/lib3270/w3miscc.h
... ... @@ -22,6 +22,7 @@
22 22 LIB3270_INTERNAL const char *inet_ntop(int af, const void *src, char *dst,socklen_t cnt);
23 23 #endif // HAVE_INET_NTOP
24 24  
  25 +
25 26 #if defined(_WIN32)
26 27 LIB3270_INTERNAL const char *win32_strerror(int e);
27 28 #endif // WIN32
... ...
src/libpw3270cpp/Makefile.in
... ... @@ -60,7 +60,7 @@ INSTALL_DATA=@INSTALL_DATA@
60 60 INSTALL_PROGRAM=@INSTALL_PROGRAM@
61 61  
62 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 65 #---[ Rules ]----------------------------------------------------------------------------
66 66  
... ...
src/libpw3270cpp/classlib.cbp
... ... @@ -33,6 +33,7 @@
33 33 <Compiler>
34 34 <Add option="-Wall" />
35 35 </Compiler>
  36 + <Unit filename="../include/pw3270/ipcpackets.h" />
36 37 <Unit filename="../include/pw3270cpp.h" />
37 38 <Unit filename="Makefile.in" />
38 39 <Unit filename="exception.cc" />
... ...
src/libpw3270cpp/remote.cc
... ... @@ -856,15 +856,41 @@
856 856  
857 857 virtual int connect(const char *url, time_t wait)
858 858 {
  859 + int rc = EINVAL;
  860 +
859 861 debug("%s(%s,%u)",__FUNCTION__,url,(unsigned int) wait);
860 862  
  863 + if(!url) {
  864 + url = "";
  865 + }
  866 +
861 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 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 895 debug("connect(%s) rc=%d (%s)",url,rc,strerror(rc));
870 896  
... ... @@ -879,9 +905,6 @@
879 905 }
880 906 }
881 907  
882   -#else
883   - rc = EINVAL;
884   -
885 908 #endif
886 909 debug("connect(%s) rc=%d (%s)",url,rc,strerror(rc));
887 910  
... ...
src/libpw3270cpp/service.cc
... ... @@ -28,6 +28,8 @@
28 28  
29 29 #include <config.h>
30 30  
  31 + #ifdef HAVE_DBUS
  32 +
31 33 #include <iostream>
32 34 #include <stdio.h>
33 35 #include <dbus/dbus.h>
... ... @@ -46,7 +48,6 @@
46 48  
47 49 /*--[ Implement ]--------------------------------------------------------------------------------------------------*/
48 50  
49   - #ifdef HAVE_DBUS
50 51 namespace PW3270_NAMESPACE
51 52 {
52 53 DBusConnection * conn;
... ...
src/plugins/hllapi/pluginmain.c
... ... @@ -34,7 +34,9 @@
34 34 #include "server.h"
35 35  
36 36 #ifdef _WIN32
37   - #include <windows.h>
  37 + #include <windows.h>
  38 +#else
  39 + #error HLLAPI is designed for windows.
38 40 #endif // _WIN32
39 41  
40 42 #include <pw3270/plugin.h>
... ... @@ -211,16 +213,21 @@
211 213  
212 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 222 case HLLAPI_PACKET_CONNECT:
220 223 send_result(source,lib3270_connect( lib3270_get_default_session_handle(),
221 224 ((struct hllapi_packet_connect *) source->buffer)->wait));
222 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 231 case HLLAPI_PACKET_SET_HOST:
225 232 send_result(source,lib3270_set_url( lib3270_get_default_session_handle(),
226 233 ((struct hllapi_packet_text *) source->buffer)->text) != NULL);
... ...