From fbe035677780d90d1fce8b0468eb605b4c2c68a1 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Wed, 9 Apr 2014 19:27:25 +0000 Subject: [PATCH] Ajustes diversos feitos quando o servidor svn estava fora --- configure.ac | 40 +++++++++++++++++++--------------------- po/pt_BR.po | 2 +- src/classlib/remote.cc | 12 +++--------- src/include/lib3270/config.h.in | 1 + src/lib3270/host.c | 6 +++++- src/plugins/hllapi/calls.cc | 28 ++++++++-------------------- 6 files changed, 37 insertions(+), 52 deletions(-) diff --git a/configure.ac b/configure.ac index 6baa293..bc0609d 100644 --- a/configure.ac +++ b/configure.ac @@ -331,6 +331,7 @@ AC_CHECK_HEADER(malloc.h, AC_DEFINE(HAVE_MALLOC_H,,[do we have malloc.h?])) AC_CHECK_FUNCS(getaddrinfo, AC_DEFINE(HAVE_GETADDRINFO) ) AC_CHECK_FUNC(vasprintf, AC_DEFINE(HAVE_VASPRINTF) ) +AC_CHECK_FUNC(strtok_r, AC_DEFINE(HAVE_STRTOK_R) ) PKG_CHECK_EXISTS @@ -402,18 +403,15 @@ if test -z "${REXX_HOME}"; then PKG_CHECK_MODULES( [REXX], [ooRexx], app_cv_rexx=yes, AC_MSG_NOTICE([No ooRexx on pkg-config.]) ) - if test "$app_cv_rexx" != "yes"; then - - if test "$REXXCONFIG" != "no"; then - app_cv_rexx=yes - REXX_CFLAGS=`$REXXCONFIG --cflags` - REXX_LIBS=`$REXXCONFIG --libs` - REXX_HOME=`$REXXCONFIG --prefix`/share/ooRexx - AC_MSG_NOTICE([Got settings from oorexx-config.]) - else - AC_MSG_NOTICE([ooRexx SDK is NOT available.]) - app_cv_rexx="no" - fi + if test "$REXXCONFIG" != "no"; then + app_cv_rexx=yes + REXX_CFLAGS=`$REXXCONFIG --cflags` + REXX_LIBS=`$REXXCONFIG --libs` + REXX_HOME=`$REXXCONFIG --prefix`/share/ooRexx + AC_MSG_NOTICE([Got settings from oorexx-config.]) + else + AC_MSG_NOTICE([ooRexx SDK is NOT available.]) + app_cv_rexx="no" fi else @@ -486,16 +484,16 @@ fi # Setup c++ compiler flags if test -d "$prefix/include/libreoffice"; then OO_CXXFLAGS="$OO_CXXFLAGS -I$prefix/include/libreoffice" - AC_MSG_NOTICE([Found libreoffice includes at $prefix/include/libreoffice]) + AC_MSG_NOTICE([Found libreoffice includes at $prefix/include/libreoffice]) elif test -d "/usr/include/libreoffice"; then OO_CXXFLAGS="$OO_CXXFLAGS -I/usr/include/libreoffice" - AC_MSG_NOTICE([Found libreoffice includes at /usr/include/libreoffice]) + AC_MSG_NOTICE([Found libreoffice includes at /usr/include/libreoffice]) elif test -d "$OO_SDK_HOME/include"; then OO_CXXFLAGS="$OO_CXXFLAGS -I$OO_SDK_HOME/include" - AC_MSG_NOTICE([Found libreoffice includes at $OO_SDK_HOME/include]) + AC_MSG_NOTICE([Found libreoffice includes at $OO_SDK_HOME/include]) else app_cv_office="no" - AC_MSG_NOTICE([Can't libreoffice includes]) + AC_MSG_NOTICE([Can't libreoffice includes]) fi OO_CXXFLAGS="-DCPPU_ENV=gcc3 -Wno-strict-aliasing $OO_CXXFLAGS" @@ -503,16 +501,16 @@ OO_CXXFLAGS="-DCPPU_ENV=gcc3 -Wno-strict-aliasing $OO_CXXFLAGS" # Test for IDL files if test -d "$OO_SDK_HOME/idl"; then IDLDIR="$OO_SDK_HOME/idl" - AC_MSG_NOTICE([Found idl at $IDLDIR]) + AC_MSG_NOTICE([Found idl at $IDLDIR]) elif test -d "/usr/share/idl/libreoffice"; then IDLDIR="/usr/share/idl/libreoffice" - AC_MSG_NOTICE([Found idl at $IDLDIR]) + AC_MSG_NOTICE([Found idl at $IDLDIR]) elif test -d "$libdir/libreoffice/sdk/idl"; then IDLDIR="$libdir/libreoffice/sdk/idl" - AC_MSG_NOTICE([Found idl at $IDLDIR]) + AC_MSG_NOTICE([Found idl at $IDLDIR]) else app_cv_office="no" - AC_MSG_NOTICE([Can't find idl path]) + AC_MSG_NOTICE([Can't find idl path]) fi OO_SDK_URE_BIN_DIR=$OO_SDK_URE_HOME/bin @@ -559,7 +557,7 @@ if test "$app_cv_office" == "yes" ; then AC_MSG_NOTICE([libreoffice sdk is present.]) EXTENSIONS="$EXTENSIONS oxt" else - AC_MSG_NOTICE([libreoffice sdk is NOT present.]) + AC_MSG_NOTICE([libreoffice sdk is NOT present or disabled.]) fi AC_SUBST(OFFICE_HOME) diff --git a/po/pt_BR.po b/po/pt_BR.po index b00e850..8c6dc9d 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-01 10:24-0300\n" +"POT-Creation-Date: 2014-04-07 08:52-0300\n" "PO-Revision-Date: 2014-02-17 08:05-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Portugues <>\n" diff --git a/src/classlib/remote.cc b/src/classlib/remote.cc index 9eaa275..22d4d20 100644 --- a/src/classlib/remote.cc +++ b/src/classlib/remote.cc @@ -129,11 +129,11 @@ } - string * query_string(void *query, size_t szQuery, size_t len) + string query_string(void *query, size_t szQuery, size_t len) { struct hllapi_packet_text * response; DWORD cbSize = sizeof(struct hllapi_packet_text)+len; - string * s; + string s; response = (struct hllapi_packet_text *) malloc(cbSize+2); memset(response,0,cbSize+2); @@ -141,13 +141,7 @@ if(TransactNamedPipe(hPipe,(LPVOID) query, szQuery, &response, cbSize, &cbSize,NULL)) { if(response->packet_id) - s = new string(""); - else - s = new string(response->text); - } - else - { - s = new string(""); + s.assign(response->text); } free(response); diff --git a/src/include/lib3270/config.h.in b/src/include/lib3270/config.h.in index 3eb98fb..cad6fab 100644 --- a/src/include/lib3270/config.h.in +++ b/src/include/lib3270/config.h.in @@ -75,5 +75,6 @@ #undef HAVE_MALLOC_H #undef HAVE_OOREXXAPI_H + #undef HAVE_STRTOK_R #endif /* LIB3270_CONFIG_INCLUDED */ diff --git a/src/lib3270/host.c b/src/lib3270/host.c index c868b25..d71fe73 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -283,10 +283,14 @@ LIB3270_EXPORT const char * lib3270_set_url(H3270 *h, const char *n) if(query && *query) { char *str = strdup(query); - char *saveptr = NULL; char *ptr; +#ifdef HAVE_STRTOK_R + char *saveptr = NULL; for(ptr = strtok_r(str,"&",&saveptr);ptr;ptr=strtok_r(NULL,"&",&saveptr)) +#else + for(ptr = strtok(str,"&");ptr;ptr=strtok(NULL,"&")) +#endif { char *var = ptr; char *val = strchr(ptr,'='); diff --git a/src/plugins/hllapi/calls.cc b/src/plugins/hllapi/calls.cc index 258620c..ca32527 100644 --- a/src/plugins/hllapi/calls.cc +++ b/src/plugins/hllapi/calls.cc @@ -174,12 +174,8 @@ try { size_t sz = strlen(buffer); - string * str = session::get_default()->get_string_at(row,col,sz); - if(str) - { - strncpy(buffer,str->c_str(),sz); - delete str; - } + string str = session::get_default()->get_string_at(row,col,sz); + strncpy(buffer,str.c_str(),sz); } catch(std::exception &e) { @@ -275,13 +271,9 @@ if(len < szBuffer && len > 0) szBuffer = len; - string *str = session::get_default()->get_string(offset,szBuffer); - if(str) - { - strncpy(buffer,str->c_str(),szBuffer); - delete str; - rc = HLLAPI_STATUS_SUCCESS; - } + string str = session::get_default()->get_string(offset,szBuffer); + strncpy(buffer,str.c_str(),szBuffer); + rc = HLLAPI_STATUS_SUCCESS; } catch(std::exception &e) { @@ -312,13 +304,9 @@ { try { - string *str = session::get_default()->get_string(offset-1,len); - if(str) - { - char * ret = strdup(str->c_str()); - delete str; - return ret; - } + string str = session::get_default()->get_string(offset-1,len); + char * ret = strdup(str.c_str()); + return ret; } catch(std::exception &e) { -- libgit2 0.21.2