Skip to content

Commit

Permalink
Merge from mainstream
Browse files Browse the repository at this point in the history
  • Loading branch information
xfred81 committed Oct 16, 2019
2 parents 9a01865 + a4026ce commit 45afdb3
Show file tree
Hide file tree
Showing 11 changed files with 1,775 additions and 1,232 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: cpp

dist: bionic

sudo: required

before_install:
- sudo apt-get update
- sudo apt-get install -y libosp-dev gengetopt

script:
- ./autogen.sh
- ./configure
- make
- sudo make install

44 changes: 27 additions & 17 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
2019-09-30, LibOFX 0.9.13:
- Fix segfault on uninitialized iconv
- Make file format less stringent
- Minor fixes in the build system

2019-02-11, LibOFX 0.9.14:
- Fix proprietary tags striping eating the content of the previous tag if
proprietary tag is in the middle of the line
- Don't output invalid line numbers on the console before SGML processing starts

2017-09-17, LibOFX 0.9.13:

- Fix potential heap overflow
- Fix crash on some malformed ofx files
- Fix crash in ofxconnect on missing command line arguments
- Fix for daylight savings time handling
- Esier compile on macos: obey LIBTOOLIZE env variable, and fallback to glibtoolize
- Fix compile on win32 (mingw-w64)
- Performance an reliability fixes in header parsing
- Strip CATEGORY tag added by Chase bank
- Fix crash on some malformed ofx files
- Fix crash in ofxconnect on missing command line arguments
- Fix for daylight savings time handling
- Easier compile on macos: obey LIBTOOLIZE env variable, and fallback to glibtoolize
- Fix compile on win32 (mingw-w64)
- Performance an reliability fixes in header parsing
- Strip CATEGORY tag added by Chase bank

2017-09-17, LibOFX 0.9.12:

- Fix a buffer overflow on unexpected tag names.
- Fix a buffer overflow on unexpected tag names.

2016-08-14, LibOFX 0.9.11:

- Add support for client uid, from KDE bug 366326
- Add support for client uid, from KDE bug 366326

2014-09-12, LibOFX 0.9.10:

Expand Down Expand Up @@ -68,7 +78,7 @@

LibOFX 0.9.5:
Benoit Grégoire <[email protected]>
- Workaround OFX files specifying invalid encoding values
- Workaround OFX files specifying invalid encoding values
(specifically: UNICODE and CP1252). This should fix most encoding
problems reported.
- Look for DTD in source directory (simplifies developpement)
Expand All @@ -80,28 +90,28 @@ LibOFX 0.9.5:
Ryan Donlan <[email protected]>
- Improve build system and autoconf 2.68 compatibility
- Improve generated man pages
- Use GCC's -fvisibility=hidden to hide internal symbols from external
- Use GCC's -fvisibility=hidden to hide internal symbols from external
users.

LibOFX 0.9.4:
- Patch to fix segfault on some malformed date formats. Inspired by Zach's patch on launchpad.
- Packages-oriented changes:
- LibOFX will now look for DTDs in env variable OFX_DTD_PATH (if present).
- LibOFX will now look for DTDs in env variable OFX_DTD_PATH (if present).
- Better handling of paths (tolerates trailing path separator, or lack thereof)
- No longer ignore return value of mkstemp()
- Integrate all changes in Ubuntu's package that weren't already upstream
- Move to LibXML++ 2.6, as 1.0 is deprecated
- Add generated man pages with html2man

LibOFX 0.9.3:
- Fix segfault on some files containing missing closing tags (bug #2969817)

LibOFX 0.9.2:
- Win32: Add gnucash patch that looks up the dtd installation directory from the current executable's location.
- Apply patch by Geert Janssens to fix a crash on invalid date format
- Apply patch by Geert Janssens to fix a crash on invalid date format
- Apply patch by ajseward with some additional fixes to allow wraping the library in python.
- Apply patch by Thomas Baumgart which fixes bug #5 (Transaction posting date off by one)
- Apply patch by Bill Nottingham <[email protected]> with various C++ include fixes for building with recent compilers.
- Apply patch by Bill Nottingham <[email protected]> with various C++ include fixes for building with recent compilers.

LibOFX 0.9.1:
- Add more sanity checks on string length.
Expand Down Expand Up @@ -151,7 +161,7 @@ LibOFX 0.7.0:

LibOFX 0.6.6:
-Important code cleanup in the parsing code. The parser should be much more independent of OpenSP default settings. Should get rid of "end tag for "MEMO" omitted, but OMITTAG NO was specified" type messages and many other parser failures.
-The very old OpenSP 1.3.1 will probably no longuer work.
-The very old OpenSP 1.3.1 will probably no longuer work.
-Fix an infinite loop in some circumstances while the library was searching for a parent statement for a transaction. Would mostly manifest on complex investments transactions. Thanks to stephen.a.prior A T ntlworld.ie for the catch.
-Implement displaying file line numbers in the error output. Note that data won't be valid if the message occurs before the file is opened.

Expand Down Expand Up @@ -196,7 +206,7 @@ LibOFX 0.3:
-Major update to ofx2qif. It will now generate the !Account QIF construct, which should improbe compatibility with other accounting software.
-gcc3.2 caused problems with ld, now use gcc to link. Should solve the "undefined symbol:__dso_handle" runtime problem with Mandrake cooker.
-There is now a workaround in the code to make it work with the OpenSP version (1.3.4) distributed with OpenJADE. However, this is not guaranteed to work, and it might cause errors in your financial data, and might not be present in future versions. Use at your own risk, you've been warned.
-LibOFX can now be installed in "unorthodox" directories, such as ~/experimental, and still find it's dtd. You must modify the prefix in common.m (recommended) or put it in the command line of BOTH make and make install.
-LibOFX can now be installed in "unorthodox" directories, such as ~/experimental, and still find it's dtd. You must modify the prefix in common.m (recommended) or put it in the command line of BOTH make and make install.
-LibOFX is now officially in beta. Since one application now uses it (GnuCash), from now on, the library soname will be bumped if binary compatibility is broken.
LibOFX 0.24:
-Fix include files for gcc2
Expand Down
58 changes: 28 additions & 30 deletions README
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
Copyright (c) 2002-2010 Benoit Grégoire

This is the LibOFX library. It is a API designed to allow applications to very easily support OFX command responses, usually provided by financial institutions. See http://www.ofx.net/ for details and specification. This project was first started as my end of degree project, with the objective to add OFX support to GnuCash https://www.gnucash.org/ If you can read French, the original project presentation is included in the doc directory. I finally decided to make it into a generic library, so all OpenSource financial software can benefit.
This is the LibOFX library. It is a API designed to allow applications to very easily support OFX command responses, usually provided by financial institutions. See http://www.ofx.net/ for details and specification. This project was first started as my end of degree project, with the objective to add OFX support to [GnuCash](https://www.gnucash.org/) If you can read French, the original project presentation is included in the doc directory. I finally decided to make it into a generic library, so all OpenSource financial software can benefit.

LibOFX is based on the excellent OpenSP library written by James Clark, and now part of the OpenJADE http://openjade.sourceforge.net/ project. OpenSP by itself is not widely distributed. OpenJADE 1.3.1 includes a version on OpenSP that will link, however, it has some major problems with LibOFX and isn't recommended. Since LibOFX uses the generic interface to OpenSP, it should be compatible with all recent versions of OpenSP (It has been developed with OpenSP-1.5pre5). LibOFX is written in C++, but provides a C style interface usable transparently from both C and C++ using a single include file.
LibOFX is based on the excellent OpenSP library written by James Clark, and now part of the [OpenJADE](http://openjade.sourceforge.net/) project. OpenSP by itself is not widely distributed. OpenJADE 1.3.1 includes a version on OpenSP that will link, however, it has some major problems with LibOFX and isn't recommended. Since LibOFX uses the generic interface to OpenSP, it should be compatible with all recent versions of OpenSP (It has been developed with OpenSP-1.5pre5). LibOFX is written in C++, but provides a C style interface usable transparently from both C and C++ using a single include file.

In addition to the library, three utilities are included with libofx

ofxdump:
ofxdump prints to stdout, in human readable form, everything the library understands about a particular ofx response file, and sends errors to stderr. It is as C++ code example and demo of the library (it uses every functions and every structures of LibOFX)
usage: ofxdump path_to_ofx_file/ofx_filename
**ofxdump**:\
ofxdump prints to stdout, in human-readable form, everything the library understands about a particular OFX response file, and sends errors to stderr. It is a C++ code example and demo of the library (it uses every functions and every structures of LibOFX)\
usage: `ofxdump` _path_to_ofx_file_`/`_ofx_filename_

ofx2qif:
ofx2qif is a OFX "file" to QIF (Quicken Interchange Format) converter. It was written as a C code example, and as a way for LibOFX to immediately provide something usefull, as an incentive for people to try out the library. It is not recommended that financial software use the output of this utility for OFX support. The QIF file format is very primitive, and much information is lost. The utility curently supports every tansaction tags of the qif format except the address lines, and supports many of the tags of !Account. It should generate QIF files that will import sucesfully in just about every software with QIF support.
I do not plan on working on this utility much further, but I would be more than happy to accept contributions.
usage: ofx2qif path_to_ofx_file/ofx_filename > output_filename.qif
**ofx2qif**:\
ofx2qif is a OFX "file" to QIF (Quicken Interchange Format) converter. It was written as a C code example, and as a way for LibOFX to immediately provide something usefull, as an incentive for people to try out the library. It is not recommended that financial software use the output of this utility for OFX support. The QIF file format is very primitive, and much information is lost. The utility curently supports every transaction tags of the qif format except the address lines, and supports many of the tags of `!Account`. It should generate QIF files that will import sucessfully in just about every software with QIF support.
I do not plan on working on this utility much further, but I would be more than happy to accept contributions.\
usage: `ofx2qif` _path_to_ofx_file_`/`_ofx_filename_ `>` _output_filename_`.qif`

ofxconnect:
sample app to demonstrate & test new direct connect API's (try "make check" in the ofxconnect folder). Read README.privateserver first.
**ofxconnect**:\
sample app to demonstrate & test new direct connect API'\s (try "make check" in the ofxconnect folder). Read [ofxdump/README.privateserver](ofxdump/README.privateserver) first.

LibOFX strives to achieve the following design goals:

-Simplicity: OFX is a VERY complex spec. However, few if any software needs all this complexity. The library tries to hide this complexity by "flattening" the data structures, doing timezone conversions, currency conversion, etc.
-Data directly usable from C, without conversion: A date is a C time_t, money is a float, strings are char[], etc.
-C style interface: Although LibOFX is written in C++, it provides an interface usable transparently from both C and C++, using a single header file.
* Simplicity: OFX is a VERY complex spec. However, few if any software needs all this complexity. The library tries to hide this complexity by "flattening" the data structures, doing timezone conversions, currency conversion, etc.
* Data directly usable from C, without conversion: A date is a C `time_t`, money is a float, strings are `char[]`, etc.
* C style interface: Although LibOFX is written in C++, it provides an interface usable transparently from both C and C++, using a single header file.

LibOFX was implemented directly from the full OFX 1.6 spec, and currently supports:

* Banking transactions and statements.
* Credit card and statements.
* Investment transactions.
* OFX 2.0
* Banking transactions and statements.
* Credit card and statements.
* Investment transactions.
* OFX 2.0

Future projects for libofx include:

* Header parsing
* DTD autodetection
* Currency conversion
* QIF import
* QIF export (integrated inside the library)
* OFX export
* Header parsing
* DTD autodetection
* Currency conversion
* QIF import
* QIF export (integrated inside the library)
* OFX export

Full documentation of the API and library internals generated using doxygen is available. For a quick start, you should learn all you need to know to get started by reading the libofx.h file in the INC directory, and ofxdump.cpp in the ofxdump directory.

Call for help:
-Please note that despite a very detailled spec, OFX is by nature very hard to test. I only have access to the specifications examples, and
my own bank (Desjardins). But I need people to run as many ofx files from different banks as they can thru libofx, and report the result.
-This is my first attempt at writing an API. I need comments from financial software writers about inc/libofx.h What do YOU need?
* Please note that despite a very detailed spec, OFX is by nature very hard to test. I only have access to the specifications examples, and
my own bank (Desjardins). But I need people to run as many OFX files from different banks as they can thru libofx, and report the result.
* This is my first attempt at writing an API. I need comments from financial software writers about inc/libofx.h What do YOU need?

Benoit Grégoire
Benoit Grégoire\
[email protected]

57 changes: 28 additions & 29 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ AC_CONFIG_MACRO_DIR(m4)
AC_PROG_CC
AC_PROG_CXX

m4_include([libcurl.m4])

LIBOFX_MAJOR_VERSION=0
LIBOFX_MINOR_VERSION=9
LIBOFX_MICRO_VERSION=13
LIBOFX_MICRO_VERSION=15
# this number is just incremented for every major change in CVS, also across
# releases to emulate the Revision variable of SVN (which isn't available
# with CVS)
Expand All @@ -35,7 +33,7 @@ case "$LIBOFX_TAG_VERSION" in
;;
*)
LIBOFX_VERSION_RELEASE_STRING="$LIBOFX_MAJOR_VERSION.$LIBOFX_MINOR_VERSION.$LIBOFX_MICRO_VERSION"

# add TAG
LIBOFX_VERSION_RELEASE_STRING="${LIBOFX_VERSION_RELEASE_STRING}${GWENHYWFAR_VERSION_TAG}"
;;
Expand Down Expand Up @@ -104,18 +102,18 @@ AC_C_BIGENDIAN
AC_PROG_MAKE_SET
AC_HEADER_STDC

AC_ARG_WITH(opensp-includes,
[ --with-opensp-includes=PATH specify where to look for OpenSP includes
AC_ARG_WITH(opensp-includes,
[ --with-opensp-includes=PATH specify where to look for OpenSP includes
- default is /usr/include/OpenSP)],
OPENSPINCLUDES="$with_opensp_includes",
OPENSPINCLUDES="" )

AC_ARG_WITH(opensp-libs,
[ --with-opensp-libs=PATH specify where to look for libosp
AC_ARG_WITH(opensp-libs,
[ --with-opensp-libs=PATH specify where to look for libosp
- default is /usr/lib],
OPENSPLIBPATH="$with_opensp_libs",
OPENSPLIBPATH="/usr/lib")

echo $OPENSPLIBPATH
for d in /usr/include/OpenSP /usr/local/include/OpenSP /usr/include/sp/generic /usr/local/include/sp/generic; do
if test "x$OPENSPINCLUDES" = x; then
Expand Down Expand Up @@ -163,11 +161,11 @@ AC_MSG_RESULT(no)
])
#endif

AC_ARG_WITH(no-opensp-multibyte,
AC_ARG_WITH(no-opensp-multibyte,
[ --with-no-opensp-multibyte Force libofx to compile with the assumption that OpenSP was NOT compiled with SP_MULTI_BYTE defined],
,
AC_DEFINE(SP_MULTI_BYTE, 1, [SP_MULTI_BYTE value from when OpenSP was compiled]) )

##if test x"$SP_MULTI_BYTE" == x ;then
##CHECK_SP_MULTI_BYTE
##fi
Expand All @@ -176,10 +174,10 @@ ac_save_CPPFLAGS="$CPPFLAGS"
if test "x$OPENSPINCLUDES" != x ; then
CPPFLAGS="-I$OPENSPINCLUDES $CPPFLAGS"
fi
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS([ParserEventGeneratorKit.h SGMLApplication.h EventGenerator.h],
[] ,
[ AC_MSG_ERROR([OpenSP includes not found]) ],
AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS([ParserEventGeneratorKit.h SGMLApplication.h EventGenerator.h],
[] ,
[ AC_MSG_ERROR([OpenSP includes not found]) ],
[] )

OPENSPLIBS="-L$OPENSPLIBPATH/lib -L$OPENSPLIBPATH/bin -losp -lintl"
Expand All @@ -189,7 +187,7 @@ LIBS="$OPENSPLIBS $LIBS"
AC_MSG_CHECKING([for libosp])
##dnl This is code from the opensp documentation, I modified it a little
##dnl It is really just a link test rather than a run test, it does nothing
AC_LANG_CPLUSPLUS
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
#include "ParserEventGeneratorKit.h"
using namespace std;
Expand All @@ -212,22 +210,22 @@ AC_LANG_CPLUSPLUS
[AC_MSG_RESULT([no])
AC_MSG_ERROR([unable to link a test program, is OpenSP installed?])],
[AC_MSG_RESULT([unknown, assumed OK])])

CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
LIBS="$ac_save_LIBS"



# check for doxygen, mostly stolen from http://log4cpp.sourceforge.net/
# ----------------------------------------------------------------------------
AC_DEFUN([BB_ENABLE_DOXYGEN],
[
AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (auto)])
AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)])
AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes])
AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_docs=no])
AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)])
AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes])
AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [ enable_latex_docs=no])
if test "x$enable_doxygen" = xno; then
enable_doc=no
else
else
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
if test x$DOXYGEN = x; then
if test "x$enable_doxygen" = xyes; then
Expand Down Expand Up @@ -300,7 +298,7 @@ if test x$gengetopt = xyes ; then
else
AC_MSG_ERROR([*** Gengetopt is not found, and generated files (cmdline.c) are missing (probably because you checked out from git). You need to install gengetopt ***])
fi

gengetopt=no
fi
fi
Expand All @@ -313,10 +311,11 @@ AM_CONDITIONAL(HAVE_HELP2MAN, test "x$HELP2MAN" != "xno")
# check for curl
# ----------------------------------------------------------------------------

LIBCURL_CHECK_CONFIG([yes],[7.9.7], [libcurl_available=yes], [libcurl_available=no])
if test "$libcurl_available" = no; then
AC_MSG_WARN([libcurl is not available. ofxconnect (Direct connect samples) will NOT be built.])
fi
PKG_CHECK_MODULES(LIBCURL, libcurl >= 7.9.7,
[libcurl_available=yes],
[libcurl_available=no
AC_MSG_WARN([libcurl is not available. ofxconnect (Direct connect samples) will NOT be built.])
])

PKG_CHECK_MODULES(LIBXMLPP,libxml++-2.6 >= 2.6,
[
Expand Down Expand Up @@ -399,7 +398,7 @@ LIBOFX_DTD_DIR='${datadir}/libofx/dtd'
AC_SUBST(LIBOFX_DTD_DIR)

AC_CONFIG_FILES([Makefile])
AC_OUTPUT(
AC_OUTPUT(
libofx.spec
libofx.pc
libofx.lsm
Expand Down
Loading

0 comments on commit 45afdb3

Please sign in to comment.