mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Win32 build: remove obsolete patches
The code used to apply the patches if present still remains to cater for possible future patches. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22713 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
EXTRA_DIST = \
|
||||
README \
|
||||
aqbanking-4.2.4-r2132-patch.diff \
|
||||
defaults.sh \
|
||||
dist.sh \
|
||||
exetype.pl \
|
||||
functions.sh \
|
||||
getperl.vbs \
|
||||
gnc-path-check \
|
||||
goffice-0.7.2-patch.diff \
|
||||
gwenhywfar-3.6.0-patch.diff \
|
||||
install.sh \
|
||||
install-fq-mods.cmd \
|
||||
libmysql.def \
|
||||
libofx-0.8.3-patch.diff \
|
||||
opensp-1.5.2-patch.diff \
|
||||
pi.sh \
|
||||
ChineseSimp-12-5.1.11.isl \
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
--- aqbanking-3.8.3/configure.ac~ Fri May 29 14:57:00 2009
|
||||
+++ aqbanking-3.8.3/configure.ac Sat Jun 13 15:45:49 2009
|
||||
@@ -476,7 +476,7 @@
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
-AC_LIBTOOL_RC
|
||||
+AC_CHECK_TOOL([RC], [windres], [no])
|
||||
AC_PROG_LIBTOOL
|
||||
AC_CHECK_PROG(USE_DOT,dot,YES,NO)
|
||||
AC_CHECK_PROG(SED,sed,sed)
|
||||
@@ -1,28 +0,0 @@
|
||||
From ba9cf4b5f7ad999381d9cfa8bf4048ec4afb4b96 Mon Sep 17 00:00:00 2001
|
||||
From: christian <christian@5c42a225-8b10-0410-9873-89b7810ad06e>
|
||||
Date: Tue, 22 Sep 2009 19:31:39 +0000
|
||||
Subject: [PATCH] Add linking of libofxparser.la into ofx plugin again.
|
||||
|
||||
Was probably accidentally removed in r1753.
|
||||
|
||||
git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@1758 5c42a225-8b10-0410-9873-89b7810ad06e
|
||||
---
|
||||
src/plugins/imexporters/ofx/Makefile.am | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/imexporters/ofx/Makefile.am b/src/plugins/imexporters/ofx/Makefile.am
|
||||
index ca89db1..5ea7496 100644
|
||||
--- a/src/plugins/imexporters/ofx/Makefile.am
|
||||
+++ b/src/plugins/imexporters/ofx/Makefile.am
|
||||
@@ -18,7 +18,7 @@ imexporterplugin_LTLIBRARIES=ofx.la
|
||||
imexporterplugin_DATA=ofx.xml
|
||||
|
||||
ofx_la_SOURCES=ofx.c
|
||||
-ofx_la_LIBADD=$(aqbanking_internal_libs) $(gwenhywfar_libs)
|
||||
+ofx_la_LIBADD = parser/libofxparser.la $(aqbanking_internal_libs) $(gwenhywfar_libs)
|
||||
ofx_la_LDFLAGS = -no-undefined @STRIPALL@ -module -avoid-version
|
||||
|
||||
|
||||
--
|
||||
1.6.1.rc3.51.g5832d
|
||||
|
||||
@@ -294,7 +294,7 @@ set_default LIBGSF_DIR $GLOBAL_DIR\\libgsf
|
||||
GOFFICE_VERSION="0.8.13"
|
||||
set_default GOFFICE_URL "$GNOME_MIRROR/sources/goffice/0.8/goffice-${GOFFICE_VERSION}.tar.bz2"
|
||||
set_default GOFFICE_DIR $GLOBAL_DIR\\goffice
|
||||
#set_default GOFFICE_PATCH `pwd`/goffice-0.7.2-patch.diff
|
||||
#set_default GOFFICE_PATCH `pwd`/goffice-x.x.x-patch.diff
|
||||
|
||||
set_default GLADE_URL "$GNOME_MIRROR/sources/glade3/3.0/glade3-3.1.2.tar.bz2"
|
||||
set_default GLADE_DIR $GLOBAL_DIR\\glade
|
||||
@@ -348,7 +348,7 @@ set_default OPENSP_PATCH `pwd`/opensp-1.5.2-patch.diff
|
||||
LIBOFX_VERSION="0.9.4"
|
||||
set_default LIBOFX_URL "$SF_MIRROR/libofx/libofx-${LIBOFX_VERSION}.tar.gz"
|
||||
set_default LIBOFX_DIR $GLOBAL_DIR\\libofx
|
||||
#set_default LIBOFX_PATCH `pwd`/libofx-0.8.3-patch.diff
|
||||
#set_default LIBOFX_PATCH `pwd`/libofx-x.x.x-patch.diff
|
||||
|
||||
## online banking: gwenhywfar+aqbanking
|
||||
set_default AQBANKING5 yes
|
||||
@@ -362,7 +362,7 @@ if [ "$AQBANKING5" = "yes" ]; then
|
||||
else
|
||||
GWENHYWFAR_VERSION="3.11.3"
|
||||
set_default GWENHYWFAR_URL "http://www2.aquamaniac.de/sites/download/download.php?package=01&release=31&file=01&dummy=gwenhywfar-${GWENHYWFAR_VERSION}.tar.gz"
|
||||
#set_default GWENHYWFAR_PATCH `pwd`/gwenhywfar-3.11.1-patch.diff
|
||||
#set_default GWENHYWFAR_PATCH `pwd`/gwenhywfar-x.x.x-patch.diff
|
||||
fi
|
||||
set_default GWENHYWFAR_DIR $GLOBAL_DIR\\gwenhywfar
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
--- goffice-0.7.2-old/goffice/Makefile.am Fri Dec 28 22:55:15 2007
|
||||
+++ goffice-0.7.2/goffice/Makefile.am Sat Jan 10 21:50:04 2009
|
||||
@@ -27,7 +27,6 @@
|
||||
if WITH_NATIVE_WIN32
|
||||
# libtool thinks there are undefined refs in libhtmlhelp, by pass libtool
|
||||
libgoffice_@GOFFICE_API_VER@_la_LDFLAGS += -Wl,-lhtmlhelp
|
||||
-libgoffice_@GOFFICE_API_VER@_la_LIBADD += -lurlmon
|
||||
endif
|
||||
endif
|
||||
|
||||
--- goffice-0.7.2-old/goffice/utils/go-file.c Tue Oct 14 10:52:48 2008
|
||||
+++ goffice-0.7.2/goffice/utils/go-file.c Sat Jan 10 20:33:58 2009
|
||||
@@ -31,11 +31,11 @@
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gsf/gsf-input-gio.h>
|
||||
#include <gsf/gsf-output-gio.h>
|
||||
-#ifdef GOFFICE_WITH_GNOME
|
||||
+#ifdef G_OS_WIN32
|
||||
+#include <windows.h>
|
||||
+/*#include <io.h>*/
|
||||
+#elif defined GOFFICE_WITH_GNOME
|
||||
#include <libgnome/gnome-url.h>
|
||||
-#elif defined G_OS_WIN32
|
||||
-#include <urlmon.h>
|
||||
-#include <io.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
@@ -1065,6 +1065,7 @@
|
||||
go_get_mime_type (gchar const *uri)
|
||||
{
|
||||
#if defined(G_OS_WIN32)
|
||||
+#if defined(FindMimeFromData)
|
||||
/* Do we really need that? */
|
||||
LPWSTR wuri, mime_type;
|
||||
|
||||
@@ -1079,6 +1080,7 @@
|
||||
}
|
||||
|
||||
g_free (wuri);
|
||||
+#endif
|
||||
|
||||
/* We try to determine mime using FindMimeFromData().
|
||||
* However, we are not sure whether the functions will know about
|
||||
@@ -1117,6 +1119,7 @@
|
||||
go_get_mime_type_for_data (gconstpointer data, int data_size)
|
||||
{
|
||||
#if defined(G_OS_WIN32)
|
||||
+#if defined(FindMimeFromData)
|
||||
/* Do we really need that? */
|
||||
LPWSTR mime_type;
|
||||
|
||||
@@ -1126,6 +1129,7 @@
|
||||
{
|
||||
return g_utf16_to_utf8 (mime_type, -1, NULL, NULL, NULL);
|
||||
}
|
||||
+#endif
|
||||
|
||||
/* We try to determine mime using FindMimeFromData().
|
||||
* However, we are not sure whether the functions will know about
|
||||
--- goffice-0.7.2-old/goffice/gtk/goffice-gtk.c Sun Sep 14 11:15:14 2008
|
||||
+++ goffice-0.7.2/goffice/gtk/goffice-gtk.c Sat Jan 10 20:59:39 2009
|
||||
@@ -779,11 +779,11 @@
|
||||
char const *link;
|
||||
} CBHelpPaths;
|
||||
|
||||
-#ifdef GOFFICE_WITH_GNOME
|
||||
-#include <libgnome/gnome-help.h>
|
||||
-#elif defined(G_OS_WIN32)
|
||||
+#ifdef G_OS_WIN32
|
||||
#include <windows.h>
|
||||
#include <htmlhelp.h>
|
||||
+#elif defined(GOFFICE_WITH_GNOME)
|
||||
+#include <libgnome/gnome-help.h>
|
||||
#endif
|
||||
static void
|
||||
go_help_display (CBHelpPaths const *paths)
|
||||
@@ -837,7 +837,7 @@
|
||||
gchar *path = g_build_filename (paths->data_dir, "doc", "C", chmfile, NULL);
|
||||
|
||||
g_free (chmfile);
|
||||
- if (!HtmlHelp (GetDesktopWindow (), path, HH_HELP_CONTEXT, id))
|
||||
+ if (!HtmlHelpW (GetDesktopWindow (), path, HH_HELP_CONTEXT, id))
|
||||
go_gtk_notice_dialog (NULL, GTK_MESSAGE_ERROR, "Failed to spawn HtmlHelp");
|
||||
g_free (path);
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
From a31de9bb25ddb34cc5d53736d11b58e67a0e65f8 Mon Sep 17 00:00:00 2001
|
||||
From: christian <christian@70169cfe-8b10-0410-8925-dcb4b91034d8>
|
||||
Date: Tue, 22 Sep 2009 18:31:55 +0000
|
||||
Subject: [PATCH] Win32: Add configure check for RC executable.
|
||||
|
||||
git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@1597 70169cfe-8b10-0410-8925-dcb4b91034d8
|
||||
---
|
||||
configure.ac | 3 +++
|
||||
1 files changed, 3 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 38fb73f..7b00908 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -187,6 +187,9 @@ AC_PROG_INSTALL
|
||||
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_LIBTOOL_RC
|
||||
+# Newer libtool doesn't have AC_LIBTOOL_RC anymore. Need to check for
|
||||
+# $(RC) by ourselves.
|
||||
+AC_CHECK_TOOL([RC], [windres], [no])
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_AWK
|
||||
AC_CHECK_PROG(USE_DOT,dot,YES,NO)
|
||||
--
|
||||
1.6.1.rc3.51.g5832d
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
From 1919a8e3c51e8c71f2c92a944cd07dc4e99a1265 Mon Sep 17 00:00:00 2001
|
||||
From: christian <christian@70169cfe-8b10-0410-8925-dcb4b91034d8>
|
||||
Date: Thu, 24 Sep 2009 20:04:08 +0000
|
||||
Subject: [PATCH] Fix GWEN_Url_fromString for windows paths which include a drive letter.
|
||||
|
||||
Also, gracefully return NULL instead of abort on unknown port number.
|
||||
Also, improve error message output. Also, confirm this to work
|
||||
without breaking anything by adding several more unittests for
|
||||
this function.
|
||||
|
||||
git-svn-id: https://devel.aqbanking.de/svn/gwenhywfar/trunk@1601 70169cfe-8b10-0410-8925-dcb4b91034d8
|
||||
---
|
||||
checks/check_urlfns.c | 105 +++++++++++++++++++++++++++++++++++++++++++++---
|
||||
src/parser/urlfns.c | 33 ++++++++++++---
|
||||
2 files changed, 124 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/parser/urlfns.c b/src/parser/urlfns.c
|
||||
index 363cdff..9a5e1d1 100644
|
||||
--- a/src/parser/urlfns.c
|
||||
+++ b/src/parser/urlfns.c
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "url_p.h"
|
||||
#include "urlfns.h"
|
||||
#include <gwenhywfar/debug.h>
|
||||
+#include <ctype.h> // for isalpha()
|
||||
|
||||
|
||||
GWEN_URL *GWEN_Url_fromString(const char *str) {
|
||||
@@ -25,6 +26,7 @@ GWEN_URL *GWEN_Url_fromString(const char *str) {
|
||||
GWEN_DB_NODE *dbVars;
|
||||
const char *s;
|
||||
const char *p;
|
||||
+ int starts_with_drive_letter = 0;
|
||||
|
||||
url=GWEN_Url_new();
|
||||
dbVars=GWEN_DB_Group_new("vars");
|
||||
@@ -33,8 +35,17 @@ GWEN_URL *GWEN_Url_fromString(const char *str) {
|
||||
dbVars=0;
|
||||
|
||||
s=str;
|
||||
+
|
||||
+ /* Check for a drive letter, which occurs on windows, but this will
|
||||
+ always be one single alpha character followed by a colon followed
|
||||
+ by a directory separator. */
|
||||
+ if (s && isalpha(s[0]) && s[1] == ':'
|
||||
+ && (s[2] == '/' || s[2] == '\\')) {
|
||||
+ starts_with_drive_letter = 1;
|
||||
+ }
|
||||
+
|
||||
/* read protocol (if any) */
|
||||
- p=strchr(s, ':');
|
||||
+ p = starts_with_drive_letter ? s : strchr(s, ':');
|
||||
if (p) {
|
||||
if (p[1]=='/' && p[2]=='/') {
|
||||
char *buf;
|
||||
@@ -51,7 +62,7 @@ GWEN_URL *GWEN_Url_fromString(const char *str) {
|
||||
}
|
||||
|
||||
if (!*s) {
|
||||
- DBG_ERROR(GWEN_LOGDOMAIN, "No server given");
|
||||
+ DBG_ERROR(GWEN_LOGDOMAIN, "No server or path given in url \"%s\"", str);
|
||||
GWEN_Url_free(url);
|
||||
return 0;
|
||||
}
|
||||
@@ -83,14 +94,21 @@ GWEN_URL *GWEN_Url_fromString(const char *str) {
|
||||
s=p+1;
|
||||
}
|
||||
|
||||
+ /* Do we now have a drive letter? (After the protocol?) */
|
||||
+ if (!starts_with_drive_letter
|
||||
+ && s && isalpha(s[0]) && s[1] == ':'
|
||||
+ && (s[2] == '/' || s[2] == '\\')) {
|
||||
+ starts_with_drive_letter = 1;
|
||||
+ }
|
||||
+
|
||||
/* read server */
|
||||
if (!*s) {
|
||||
- DBG_ERROR(GWEN_LOGDOMAIN, "No server given");
|
||||
+ DBG_ERROR(GWEN_LOGDOMAIN, "No server given in url \"%s\"", str);
|
||||
GWEN_Url_free(url);
|
||||
return 0;
|
||||
}
|
||||
p=s;
|
||||
- while(*p && *p!=':' && *p!='/' && *p!='?')
|
||||
+ while(!starts_with_drive_letter && *p && *p!=':' && *p!='/' && *p!='?')
|
||||
p++;
|
||||
if (p!=s) {
|
||||
char *buf;
|
||||
@@ -120,9 +138,10 @@ GWEN_URL *GWEN_Url_fromString(const char *str) {
|
||||
memmove(buf, s, p-s+1);
|
||||
buf[p-s]=0;
|
||||
if (sscanf(buf, "%d", &port)!=1) {
|
||||
- DBG_ERROR(GWEN_LOGDOMAIN, "Bad port (%s)", buf);
|
||||
+ DBG_ERROR(GWEN_LOGDOMAIN, "Bad port (%s) in url \"%s\"", buf, str);
|
||||
free(buf);
|
||||
- abort();
|
||||
+ GWEN_Url_free(url);
|
||||
+ return 0;
|
||||
}
|
||||
url->port=port;
|
||||
free(buf);
|
||||
@@ -139,7 +158,7 @@ GWEN_URL *GWEN_Url_fromString(const char *str) {
|
||||
}
|
||||
|
||||
/* get path */
|
||||
- if (*s=='/') {
|
||||
+ if (starts_with_drive_letter || *s=='/') {
|
||||
p=s;
|
||||
while(*p && *p!='?')
|
||||
p++;
|
||||
diff --git a/plugins/configmgr/dir/cfgdir.c b/plugins/configmgr/dir/cfgdir.c
|
||||
index 7b89933..e44ac9a 100644
|
||||
--- a/plugins/configmgr/dir/cfgdir.c
|
||||
+++ b/plugins/configmgr/dir/cfgdir.c
|
||||
@@ -102,8 +102,13 @@ GWEN_CONFIGMGR *GWEN_ConfigMgrDir_new(const char *url) {
|
||||
GWEN_Buffer_AppendString(nbuf, s);
|
||||
s=GWEN_Url_GetPath(gurl);
|
||||
if (s) {
|
||||
- if (*s!='/' && *s!='\\')
|
||||
+ /* Does this begin with a slash? If not, we add one, but only if
|
||||
+ this isn't a drive letter (for windows!) */
|
||||
+ if (*s!='/' && *s!='\\'
|
||||
+ && !(isalpha(s[0]) && s[1] == ':'
|
||||
+ && (s[2] == '/' || s[2] == '\\'))) {
|
||||
GWEN_Buffer_AppendString(nbuf, GWEN_DIR_SEPARATOR_S);
|
||||
+ }
|
||||
GWEN_Buffer_AppendString(nbuf, s);
|
||||
}
|
||||
xcfg->folder=strdup(GWEN_Buffer_GetStart(nbuf));
|
||||
--
|
||||
1.6.1.rc3.51.g5832d
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
--- gwenhywfar-3.6.0-old/src/cryptmsg/cryptmgrkeys.c Sun Dec 7 16:56:04 2008
|
||||
+++ gwenhywfar-3.6.0/src/cryptmsg/cryptmgrkeys.c Tue Jan 13 01:05:44 2009
|
||||
@@ -74,6 +74,7 @@
|
||||
|
||||
|
||||
|
||||
+GWENHYWFAR_CB
|
||||
void GWEN_CryptMgrKeys_FreeData(void *bp, void *p) {
|
||||
GWEN_CRYPTMGR_KEYS *xcm;
|
||||
|
||||
@@ -104,6 +105,7 @@
|
||||
|
||||
|
||||
|
||||
+GWENHYWFAR_CB
|
||||
int GWEN_CryptMgrKeys_SignData(GWEN_CRYPTMGR *cm,
|
||||
const uint8_t *pData, uint32_t lData,
|
||||
GWEN_BUFFER *dbuf) {
|
||||
@@ -176,6 +178,7 @@
|
||||
|
||||
|
||||
|
||||
+GWENHYWFAR_CB
|
||||
int GWEN_CryptMgrKeys_VerifyData(GWEN_CRYPTMGR *cm,
|
||||
const uint8_t *pData, uint32_t lData,
|
||||
const uint8_t *pSignature, uint32_t lSignature) {
|
||||
@@ -271,6 +274,7 @@
|
||||
|
||||
|
||||
|
||||
+GWENHYWFAR_CB
|
||||
int GWEN_CryptMgrKeys_EncryptKey(GWEN_CRYPTMGR *cm,
|
||||
const uint8_t *pData, uint32_t lData,
|
||||
GWEN_BUFFER *dbuf) {
|
||||
@@ -322,6 +326,7 @@
|
||||
|
||||
|
||||
|
||||
+GWENHYWFAR_CB
|
||||
int GWEN_CryptMgrKeys_DecryptKey(GWEN_CRYPTMGR *cm,
|
||||
const uint8_t *pData, uint32_t lData,
|
||||
GWEN_BUFFER *dbuf) {
|
||||
--- gwenhywfar-3.6.0-old/src/cryptmsg/cryptmgr_be.h Tue Dec 2 17:06:50 2008
|
||||
+++ gwenhywfar-3.6.0/src/cryptmsg/cryptmgr_be.h Tue Jan 13 01:17:30 2009
|
||||
@@ -22,19 +22,19 @@
|
||||
GWEN_INHERIT_FUNCTION_LIB_DEFS(GWEN_CRYPTMGR, GWENHYWFAR_API)
|
||||
|
||||
|
||||
-typedef int (*GWEN_CRYPTMGR_SIGNDATA_FN)(GWEN_CRYPTMGR *cm,
|
||||
- const uint8_t *pData, uint32_t lData,
|
||||
- GWEN_BUFFER *dbuf);
|
||||
-typedef int (*GWEN_CRYPTMGR_ENCRYPTKEY_FN)(GWEN_CRYPTMGR *cm,
|
||||
- const uint8_t *pData, uint32_t lData,
|
||||
- GWEN_BUFFER *dbuf);
|
||||
+typedef GWENHYWFAR_CB int (*GWEN_CRYPTMGR_SIGNDATA_FN)(GWEN_CRYPTMGR *cm,
|
||||
+ const uint8_t *pData, uint32_t lData,
|
||||
+ GWEN_BUFFER *dbuf);
|
||||
+typedef GWENHYWFAR_CB int (*GWEN_CRYPTMGR_ENCRYPTKEY_FN)(GWEN_CRYPTMGR *cm,
|
||||
+ const uint8_t *pData, uint32_t lData,
|
||||
+ GWEN_BUFFER *dbuf);
|
||||
|
||||
-typedef int (*GWEN_CRYPTMGR_VERIFYDATA_FN)(GWEN_CRYPTMGR *cm,
|
||||
- const uint8_t *pData, uint32_t lData,
|
||||
- const uint8_t *pSignature, uint32_t lSignature);
|
||||
-typedef int (*GWEN_CRYPTMGR_DECRYPTKEY_FN)(GWEN_CRYPTMGR *cm,
|
||||
- const uint8_t *pData, uint32_t lData,
|
||||
- GWEN_BUFFER *dbuf);
|
||||
+typedef GWENHYWFAR_CB int (*GWEN_CRYPTMGR_VERIFYDATA_FN)(GWEN_CRYPTMGR *cm,
|
||||
+ const uint8_t *pData, uint32_t lData,
|
||||
+ const uint8_t *pSignature, uint32_t lSignature);
|
||||
+typedef GWENHYWFAR_CB int (*GWEN_CRYPTMGR_DECRYPTKEY_FN)(GWEN_CRYPTMGR *cm,
|
||||
+ const uint8_t *pData, uint32_t lData,
|
||||
+ GWEN_BUFFER *dbuf);
|
||||
|
||||
|
||||
|
||||
@@ -1,225 +0,0 @@
|
||||
diff -ur libofx-0.8.3/lib/ofx_preproc.cpp win32-libofx-0.8.3/lib/ofx_preproc.cpp
|
||||
--- libofx-0.8.3/lib/ofx_preproc.cpp Tue Jan 9 02:38:33 2007
|
||||
+++ win32-libofx-0.8.3/lib/ofx_preproc.cpp Thu Feb 8 13:53:59 2007
|
||||
@@ -20,8 +20,14 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <stdlib.h>
|
||||
+#include <io.h> // for mktemp() on win32/mingw
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
+#ifdef OS_WIN32
|
||||
+#include <windows.h> // for GetModuleFileName()
|
||||
+#undef ERROR
|
||||
+#undef DELETE
|
||||
+#endif
|
||||
#include "ParserEventGeneratorKit.h"
|
||||
#include "libofx.h"
|
||||
#include "messages.hh"
|
||||
@@ -51,6 +57,57 @@
|
||||
"~/"};
|
||||
const unsigned int READ_BUFFER_SIZE = 1024;
|
||||
|
||||
+#ifdef OS_WIN32
|
||||
+# define DIR_SEPARATOR_S "\\"
|
||||
+#else
|
||||
+# define DIR_SEPARATOR_S "/"
|
||||
+#endif
|
||||
+// The filenames can get quite long on windows.
|
||||
+#define TMPFILEBUFSIZE 120
|
||||
+
|
||||
+std::string get_tmp_dir()
|
||||
+{
|
||||
+ // Tries to mimic the behaviour of
|
||||
+ // http://developer.gnome.org/doc/API/2.0/glib/glib-Miscellaneous-Utility-Functions.html#g-get-tmp-dir
|
||||
+#ifdef OS_WIN32
|
||||
+ char *var;
|
||||
+ var = getenv("TMPDIR");
|
||||
+ if (var) return var;
|
||||
+ var = getenv("TMP");
|
||||
+ if (var) return var;
|
||||
+ var = getenv("TEMP");
|
||||
+ if (var) return var;
|
||||
+ return "C:\\";
|
||||
+#else
|
||||
+ return "/tmp";
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+#ifdef OS_WIN32
|
||||
+std::string get_dtd_installation_directory()
|
||||
+{
|
||||
+ // Partial implementation of
|
||||
+ // http://developer.gnome.org/doc/API/2.0/glib/glib-Windows-Compatibility-Functions.html#g-win32-get-package-installation-directory
|
||||
+ char ch_fn[MAX_PATH], *p;
|
||||
+ std::string str_fn;
|
||||
+
|
||||
+ if (!GetModuleFileName(NULL, ch_fn, MAX_PATH)) return "";
|
||||
+
|
||||
+ if ((p = strrchr(ch_fn, '\\')) != NULL)
|
||||
+ *p = '\0';
|
||||
+
|
||||
+ p = strrchr(ch_fn, '\\');
|
||||
+ if (p && (_stricmp(p+1, "bin") == 0 ||
|
||||
+ _stricmp(p+1, "lib") == 0))
|
||||
+ *p = '\0';
|
||||
+
|
||||
+ str_fn = ch_fn;
|
||||
+ str_fn += "\\share\\libofx\\dtd\\";
|
||||
+
|
||||
+ return str_fn;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/** @brief File pre-processing of OFX AND for OFC files
|
||||
*
|
||||
* Takes care of comment striping, dtd locating, etc.
|
||||
@@ -66,7 +123,7 @@
|
||||
char buffer[READ_BUFFER_SIZE];
|
||||
string s_buffer;
|
||||
char *filenames[3];
|
||||
- char tmp_filename[50];
|
||||
+ char tmp_filename[TMPFILEBUFSIZE];
|
||||
|
||||
libofx_context=(LibofxContext*)ctx;
|
||||
|
||||
@@ -75,8 +132,10 @@
|
||||
message_out(DEBUG, string("ofx_proc_file():Opening file: ")+ p_filename);
|
||||
|
||||
input_file.open(p_filename);
|
||||
- strncpy(tmp_filename,"/tmp/libofxtmpXXXXXX",50);
|
||||
- mkstemp(tmp_filename);
|
||||
+ std::string tmpdir = get_tmp_dir();
|
||||
+ std::string tmpfiletemplate = tmpdir + DIR_SEPARATOR_S "libofxtmpXXXXXX";
|
||||
+ strncpy(tmp_filename,tmpfiletemplate.c_str(),TMPFILEBUFSIZE);
|
||||
+ mktemp(tmp_filename);
|
||||
tmp_file.open(tmp_filename);
|
||||
|
||||
message_out(DEBUG,"ofx_proc_file(): Creating temp file: "+string(tmp_filename));
|
||||
@@ -203,7 +262,7 @@
|
||||
ofstream tmp_file;
|
||||
string s_buffer;
|
||||
char *filenames[3];
|
||||
- char tmp_filename[50];
|
||||
+ char tmp_filename[TMPFILEBUFSIZE];
|
||||
int pos;
|
||||
LibofxContext *libofx_context;
|
||||
|
||||
@@ -216,8 +275,10 @@
|
||||
}
|
||||
s_buffer=string(s, size);
|
||||
|
||||
- strncpy(tmp_filename,"/tmp/libofxtmpXXXXXX",50);
|
||||
- mkstemp(tmp_filename);
|
||||
+ std::string tmpdir = get_tmp_dir();
|
||||
+ std::string tmpfiletemplate = tmpdir + DIR_SEPARATOR_S "libofxtmpXXXXXX";
|
||||
+ strncpy(tmp_filename,tmpfiletemplate.c_str(),TMPFILEBUFSIZE);
|
||||
+ mktemp(tmp_filename);
|
||||
tmp_file.open(tmp_filename);
|
||||
|
||||
message_out(DEBUG,"ofx_proc_file(): Creating temp file: "+string(tmp_filename));
|
||||
@@ -439,8 +500,16 @@
|
||||
string dtd_path_filename;
|
||||
bool dtd_found=false;
|
||||
|
||||
- for(i=0;i<DTD_SEARCH_PATH_NUM&&dtd_found==false;i++){
|
||||
- dtd_path_filename=DTD_SEARCH_PATH[i];
|
||||
+ for(i=-1;i<DTD_SEARCH_PATH_NUM&&dtd_found==false;i++){
|
||||
+ if (i==-1) {
|
||||
+#ifdef OS_WIN32
|
||||
+ dtd_path_filename=get_dtd_installation_directory();
|
||||
+#else
|
||||
+ continue;
|
||||
+#endif
|
||||
+ } else {
|
||||
+ dtd_path_filename=DTD_SEARCH_PATH[i];
|
||||
+ }
|
||||
dtd_path_filename.append(dtd_filename);
|
||||
dtd_file.clear();
|
||||
dtd_file.open(dtd_path_filename.c_str());
|
||||
--- libofx-0.8.3/lib/ofx_utilities.cpp-org 2010-05-22 12:57:31 +0000
|
||||
+++ libofx-0.8.3/lib/ofx_utilities.cpp 2010-05-22 13:31:13 +0000
|
||||
@@ -19,7 +19,8 @@
|
||||
#include <iostream>
|
||||
#include "ParserEventGeneratorKit.h"
|
||||
#include "SGMLApplication.h"
|
||||
-#include <time.h>
|
||||
+#include <ctime>
|
||||
+#include <cstdlib>
|
||||
#include <string>
|
||||
#include <locale.h>
|
||||
#include "messages.hh"
|
||||
--- libofx-0.8.3/lib/ofx_container_transaction.cpp-org 2010-05-22 14:08:02 +0000
|
||||
+++ libofx-0.8.3/lib/ofx_container_transaction.cpp 2010-05-22 14:07:09 +0000
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
+#include <cstdlib>
|
||||
#include <string>
|
||||
#include "messages.hh"
|
||||
#include "libofx.h"
|
||||
--- libofx-0.8.3/lib/ofx_request_accountinfo.cpp-org 2010-05-22 14:17:26 +0000
|
||||
+++ libofx-0.8.3/lib/ofx_request_accountinfo.cpp 2010-05-22 14:17:55 +0000
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
+#include <cstdlib>
|
||||
#include <string>
|
||||
#include "libofx.h"
|
||||
#include "ofx_request_accountinfo.hh"
|
||||
--- libofx-0.8.3/lib/ofx_request.cpp-org 2010-05-22 14:19:52 +0000
|
||||
+++ libofx-0.8.3/lib/ofx_request.cpp 2010-05-22 14:20:12 +0000
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
+#include <cstring>
|
||||
#include <string>
|
||||
#include "messages.hh"
|
||||
#include "libofx.h"
|
||||
--- libofx-0.8.3/lib/ofx_request_statement.cpp-org 2010-05-22 14:21:19 +0000
|
||||
+++ libofx-0.8.3/lib/ofx_request_statement.cpp 2010-05-22 14:21:34 +0000
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
+#include <cstdlib>
|
||||
#include <string>
|
||||
#include "libofx.h"
|
||||
#include "ofx_utilities.hh"
|
||||
--- libofx-0.8.3/ofxdump/ofxdump.cpp-org 2010-05-22 14:54:40 +0000
|
||||
+++ libofx-0.8.3/ofxdump/ofxdump.cpp 2010-05-22 14:55:20 +0000
|
||||
@@ -29,6 +29,8 @@
|
||||
***************************************************************************/
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
+#include <cstdlib>
|
||||
+#include <cstring>
|
||||
#include <string>
|
||||
#include "libofx.h"
|
||||
#include <stdio.h> /* for printf() */
|
||||
--- libofx-0.8.3/ofxconnect/ofxconnect.cpp-org 2010-05-22 14:57:35 +0000
|
||||
+++ libofx-0.8.3/ofxconnect/ofxconnect.cpp 2010-05-22 14:58:24 +0000
|
||||
@@ -30,6 +30,7 @@
|
||||
***************************************************************************/
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
+#include <cstring>
|
||||
#include <string>
|
||||
#include "libofx.h"
|
||||
#include <config.h> /* Include config constants, e.g., VERSION TF */
|
||||
--- libofx-0.8.3/ofxconnect/ofxpartner.cpp-org 2010-05-22 14:59:39 +0000
|
||||
+++ libofx-0.8.3/ofxconnect/ofxpartner.cpp 2010-05-22 15:00:46 +0000
|
||||
@@ -33,8 +33,10 @@
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <iostream>
|
||||
+#include <cstring>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
+#include <algorithm>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
@@ -1,184 +0,0 @@
|
||||
Index: ChangeLog
|
||||
===================================================================
|
||||
RCS file: /cvsroot/libofx/libofx/ChangeLog,v
|
||||
retrieving revision 1.96
|
||||
diff -u -r1.96 ChangeLog
|
||||
--- ChangeLog 15 May 2009 14:11:41 -0000 1.96
|
||||
+++ ChangeLog 22 Sep 2009 20:28:40 -0000
|
||||
@@ -1,3 +1,8 @@
|
||||
+2009-09-22 Christian Stimming <stimming@tuhh.de>
|
||||
+
|
||||
+ * lib/ofx_preproc.cpp: Win32: Add gnucash patch that looks up the
|
||||
+ dtd installation directory from the current executable's location.
|
||||
+
|
||||
2009-05-09 Benoit Grégoire <benoitg@coeus.ca>
|
||||
* Various C++ include fixes for building with recent compilers. Patch by Bill Nottingham <notting@redhat.com>
|
||||
|
||||
Index: lib/ofx_preproc.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/libofx/libofx/lib/ofx_preproc.cpp,v
|
||||
retrieving revision 1.24
|
||||
diff -u -r1.24 ofx_preproc.cpp
|
||||
--- lib/ofx_preproc.cpp 6 Dec 2008 22:28:39 -0000 1.24
|
||||
+++ lib/ofx_preproc.cpp 22 Sep 2009 20:28:41 -0000
|
||||
@@ -36,6 +36,9 @@
|
||||
|
||||
#ifdef OS_WIN32
|
||||
# include "win32.hh"
|
||||
+# include <windows.h> // for GetModuleFileName()
|
||||
+# undef ERROR
|
||||
+# undef DELETE
|
||||
#endif
|
||||
|
||||
#define LIBOFX_DEFAULT_INPUT_ENCODING "CP1252"
|
||||
@@ -505,6 +508,31 @@
|
||||
}
|
||||
|
||||
|
||||
+#ifdef OS_WIN32
|
||||
+static std::string get_dtd_installation_directory()
|
||||
+{
|
||||
+ // Partial implementation of
|
||||
+ // http://developer.gnome.org/doc/API/2.0/glib/glib-Windows-Compatibility-Functions.html#g-win32-get-package-installation-directory
|
||||
+ char ch_fn[MAX_PATH], *p;
|
||||
+ std::string str_fn;
|
||||
+
|
||||
+ if (!GetModuleFileName(NULL, ch_fn, MAX_PATH)) return "";
|
||||
+
|
||||
+ if ((p = strrchr(ch_fn, '\\')) != NULL)
|
||||
+ *p = '\0';
|
||||
+
|
||||
+ p = strrchr(ch_fn, '\\');
|
||||
+ if (p && (_stricmp(p+1, "bin") == 0 ||
|
||||
+ _stricmp(p+1, "lib") == 0))
|
||||
+ *p = '\0';
|
||||
+
|
||||
+ str_fn = ch_fn;
|
||||
+ str_fn += "\\share\\libofx\\dtd\\";
|
||||
+
|
||||
+ return str_fn;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
|
||||
/**
|
||||
This function will try to find a DTD matching the requested_version and return the full path of the DTD found (or an empty string if unsuccessfull)
|
||||
@@ -513,45 +541,45 @@
|
||||
*/
|
||||
string find_dtd(LibofxContextPtr ctx, string dtd_filename)
|
||||
{
|
||||
- int i;
|
||||
- ifstream dtd_file;
|
||||
string dtd_path_filename;
|
||||
- bool dtd_found=false;
|
||||
|
||||
- dtd_path_filename=((LibofxContext*)ctx)->dtdDir();
|
||||
+ dtd_path_filename = reinterpret_cast<const LibofxContext*>(ctx)->dtdDir();
|
||||
if (!dtd_path_filename.empty()) {
|
||||
dtd_path_filename.append(dtd_filename);
|
||||
- dtd_file.clear();
|
||||
- dtd_file.open(dtd_path_filename.c_str());
|
||||
+ ifstream dtd_file(dtd_path_filename.c_str());
|
||||
if(dtd_file){
|
||||
message_out(STATUS,"find_dtd():DTD found: "+dtd_path_filename);
|
||||
- dtd_file.close();
|
||||
- dtd_found=true;
|
||||
+ return dtd_path_filename;
|
||||
}
|
||||
}
|
||||
|
||||
- if (!dtd_found) {
|
||||
- for(i=0;i<DTD_SEARCH_PATH_NUM&&dtd_found==false;i++){
|
||||
+#ifdef OS_WIN32
|
||||
+ dtd_path_filename = get_dtd_installation_directory();
|
||||
+ if (!dtd_path_filename.empty()) {
|
||||
+ dtd_path_filename.append(dtd_filename);
|
||||
+ ifstream dtd_file(dtd_path_filename.c_str());
|
||||
+ if(dtd_file){
|
||||
+ message_out(STATUS,"find_dtd():DTD found: "+dtd_path_filename);
|
||||
+ return dtd_path_filename;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ for(int i=0;i<DTD_SEARCH_PATH_NUM;i++){
|
||||
dtd_path_filename=DTD_SEARCH_PATH[i];
|
||||
dtd_path_filename.append(dtd_filename);
|
||||
- dtd_file.clear();
|
||||
- dtd_file.open(dtd_path_filename.c_str());
|
||||
+ ifstream dtd_file(dtd_path_filename.c_str());
|
||||
if(!dtd_file){
|
||||
message_out(DEBUG,"find_dtd():Unable to open the file "+dtd_path_filename);
|
||||
}
|
||||
else{
|
||||
message_out(STATUS,"find_dtd():DTD found: "+dtd_path_filename);
|
||||
- dtd_file.close();
|
||||
- dtd_found=true;
|
||||
+ return dtd_path_filename;
|
||||
}
|
||||
- }
|
||||
}
|
||||
|
||||
- if(dtd_found==false){
|
||||
- message_out(ERROR,"find_dtd():Unable to find the DTD named " + dtd_filename);
|
||||
- dtd_path_filename="";
|
||||
- }
|
||||
- return dtd_path_filename;
|
||||
+ message_out(ERROR,"find_dtd():Unable to find the DTD named " + dtd_filename);
|
||||
+ return "";
|
||||
}
|
||||
|
||||
|
||||
Index: lib/ofx_utilities.cpp
|
||||
===================================================================
|
||||
RCS file: /cvsroot/libofx/libofx/lib/ofx_utilities.cpp,v
|
||||
retrieving revision 1.12
|
||||
diff -u -r1.12 ofx_utilities.cpp
|
||||
--- lib/ofx_utilities.cpp 15 May 2009 14:11:41 -0000 1.12
|
||||
+++ lib/ofx_utilities.cpp 22 Sep 2009 20:28:41 -0000
|
||||
@@ -217,25 +217,29 @@
|
||||
}
|
||||
|
||||
|
||||
-int mkTempFileName(const char *tmpl, char *buffer, unsigned int size) {
|
||||
- const char *tmp_dir;
|
||||
+std::string get_tmp_dir()
|
||||
+{
|
||||
+ // Tries to mimic the behaviour of
|
||||
+ // http://developer.gnome.org/doc/API/2.0/glib/glib-Miscellaneous-Utility-Functions.html#g-get-tmp-dir
|
||||
+ char *var;
|
||||
+ var = getenv("TMPDIR");
|
||||
+ if (var) return var;
|
||||
+ var = getenv("TMP");
|
||||
+ if (var) return var;
|
||||
+ var = getenv("TEMP");
|
||||
+ if (var) return var;
|
||||
+#ifdef OS_WIN32
|
||||
+ return "C:\\";
|
||||
+#else
|
||||
+ return "/tmp";
|
||||
+#endif
|
||||
+}
|
||||
|
||||
- tmp_dir = getenv ("TMPDIR");
|
||||
- if (!tmp_dir)
|
||||
- tmp_dir = getenv ("TMP");
|
||||
- if (!tmp_dir)
|
||||
- tmp_dir = getenv ("TEMP");
|
||||
+int mkTempFileName(const char *tmpl, char *buffer, unsigned int size) {
|
||||
|
||||
- if (!tmp_dir)
|
||||
- {
|
||||
-#ifdef OS_WIN32
|
||||
- tmp_dir = "C:\\";
|
||||
-#else
|
||||
- tmp_dir = "/tmp";
|
||||
-#endif /* !OS_WIN32 */
|
||||
- }
|
||||
+ std::string tmp_dir = get_tmp_dir();
|
||||
|
||||
- strncpy(buffer, tmp_dir, size);
|
||||
+ strncpy(buffer, tmp_dir.c_str(), size);
|
||||
assert((strlen(buffer)+strlen(tmpl)+2)<size);
|
||||
strcat(buffer, DIRSEP);
|
||||
strcat(buffer, tmpl);
|
||||
Reference in New Issue
Block a user