Add a shim implementing half-assed versions of most of the GLib
functions used by MDB Tools. If GLib is detected at compile-time,
use it, otherwise use the shim.
This work is not complete, as the option-parsing code is not yet
implemented - so most of the command-line tools crash.
If a host project has -Wstrict-prototypes enabled, the mdbtools header
results in warnings. Turn on -Wstrict-prototypes for the whole project
so that these never occur again.
Some Access 2010 files use 0x03 as the version number rather than
0x0103. For this reason I have changed the call to mdb_get_int32 to
mdb_get_byte.
In addition, according to the Library of Congress page:
https://www.loc.gov/preservation/digital/formats/fdd/fdd000463.shtml
Access 2016 uses 0x05 as the version number. I have inferred from the
Wikipedia page that Access 2013 likely uses 0x04.
Adds "-B" (--boolean-words) option to mdb-export, which will reconfigure
mdb/data.c to export TRUE/FALSE for boolean values instead of 1/0. The
option is needed to support BOOLEAN fields on PostgreSQL, which will not
implicitly cast bare 1/0 into a BOOLEAN value. Value literals are the
SQL TRUE/FALSE, and _quoted_ words meaning true/false and _quoted_
'1'/'0'. With this flag the SQL TRUE/FALSE values are output, which should
work with several SQL databases.
PostgreSQL Reference:
http://www.postgresql.org/docs/current/static/datatype-boolean.html
mdbprivate is.... private.
mdbodbc.h has no reason to be public: People who want to use the plugin
should use the public odbc.h headers. And having this private will permit
hdbc cleanup.
__attribute__ does not exist in Visual Studio. Therefore replaced wherever it appeared with a macro:
Redefines MDB_DEPRECATED to support Visual Studio
Define a Constructor MACRO so that __attribute__((constructor/destructor)) behavior is achieved in Visual Studio.
Just using generate_table_schema through mdb_print_schema deletes the purpose of a very good tool. generate_table_schemas is a rewrite of generate_table_schema but sends the data to a char* instead of FILE*. There is NO fmemopen() or similar in Visual Studio, so there is NO way to access memory through a FILE* except for first writing to the disk and then reading from the disk in memory.
I cannot suggest how to handle the case when td == 0 for the dates. The databases I work with often have just 00:00:00 in the DateTime column which is not consistent with the rest of the column either, but I have to deal with it somehow.
Leaving void* where char* is needed as a function parameter returns a compilation error in Visual Studio.
These functions now use the __attribute__((constructor)) & destructor.
Old names were keep for compatibility
Also put __attribute__((deprecated)) in mdbtools.h for all deprecated
functions.
The major new feature in Access 2007 where so called complex columns.
These can be multivalued fields, attachments, or MEMO fields with
version history. All of them are implemented using hidden helper tables,
and the column itself has type MDB_COMPLEX (0x12) which is basically a
long int used as a key.
This commit adds basic support for this complex type to libmdb.
These were the only symbols exported not starting with mdb_
Old names stay available as aliases
Bumped libmdb version to 2.0.1
Added these prototypes to mdbtools.h: Fixes compilation warning
Added mdb_insert_row prototype to mdbtools.h: Fixes compilation warning