iconv, typo fixes, libtool versioning, added MySQL to gmdb2 export

This commit is contained in:
brianb 2004-06-21 00:31:39 +00:00
parent 642a74c8c3
commit 620db14f4b
12 changed files with 118 additions and 12 deletions

View File

@ -1,7 +1,16 @@
Sun Jun 20 09:37:58 EDT 2004 Brian Bruns <brian@bruns.com.
* configure.in:
* acinclude.m4: use READLINE macro from Ville Laurikari. Remove full macroset to work around broken BSD autoconf.
* configure.in:
* acinclude.m4: use READLINE macro from Ville Laurikari. Remove full macroset to work around broken BSD autoconf. Add macro for iconv detection.
* src/util/mdb-sql.c: add stubs for read_history/write_history if no readline. update to use new readline defines.
* HACKING: reverse order of total column count with current column count.
* README: fix typo
* include: add iconv handle to MdbHandle
* src/libmdb/file.c: add gtkdoc to mdb_find_file()
* src/libmdb/Makefile.am:
* src/sql/Makefile.am: add libtool versioning
* src/gmdb2/gladefiles/gmdb-schema.glade:
* src/gmdb2/schema.c: Add MySQL to export
* src/gmdb2/help/C/gmdb.xml: fix typo
Fri Jun 18 00:08:24 CDT 2004 Jeff Smith <whydoubt@yahoo.com>
* HACKING:

View File

@ -398,9 +398,9 @@ next_pg field.
+-------------------------------------------------------------------------+
| ???? | 1 byte | col_type | Column Type (see table below) |
| ???? | 4 bytes | unknown | matches first unknown definition block |
| ???? | 2 bytes | col_num | Column Number |
| ???? | 2 bytes | offset_V | Offset for variable length columns |
| ???? | 2 bytes | col_num | Column Number (includes deleted columns) |
| ???? | 2 bytes | offset_V | Offset for variable length columns |
| ???? | 2 bytes | col_num | Column Number |
| ???? | 4 bytes | ??? | prec/scale? verify |
| ???? | 1 byte | bitmask | low order bit indicates variable columns |
| ???? | 1 byte | ??? | seems to be 1 when variable len |

2
README
View File

@ -1,7 +1,7 @@
This is mdbtools version 0.6pre1
Welcome to the exciting world of MDB Tools! In short, MDB Tools is a set of
program to help you use Microsoft Access file in various settings. The major
programs to help you use Microsoft Access file in various settings. The major
pieces are:
. libmdb - the core library that allows access to MDB files programatically.

View File

@ -42,3 +42,70 @@ AC_DEFUN([VL_LIB_READLINE], [
fi
])dnl
dnl From Bruno Haible.
AC_DEFUN([AM_ICONV],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
AC_ARG_WITH([libiconv-prefix],
AC_HELP_STRING([--with-libiconv-prefix=DIR], [search for libiconv in DIR/include and DIR/lib]), [
for dir in `echo "$withval" | tr : ' '`; do
if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
done
])
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_func_iconv=yes)
if test "$am_cv_func_iconv" != yes; then
am_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
am_cv_lib_iconv=yes
am_cv_func_iconv=yes)
LIBS="$am_save_LIBS"
fi
])
if test "$am_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(am_cv_proto_iconv, [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([$]{ac_t:-
}[$]am_cv_proto_iconv)
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
LIBICONV=
if test "$am_cv_lib_iconv" = yes; then
LIBICONV="-liconv"
fi
AC_SUBST(LIBICONV)
])

View File

@ -20,6 +20,8 @@ AC_C_CONST
AC_TYPE_SIZE_T
AC_C_BIGENDIAN
AM_ICONV
dnl no optional stuff by default
OPTDIRS=""

View File

@ -31,6 +31,10 @@
#include <string.h>
#include <glib.h>
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
#define MDB_DEBUG 0
#define MDB_PGSIZE 4096
@ -221,6 +225,9 @@ typedef struct {
char *backend_name;
MdbFormatConstants *fmt;
MdbStatistics *stats;
#ifdef HAVE_ICONV
iconv_t iconv_out;
#endif
} MdbHandle;
typedef struct {

View File

@ -200,7 +200,7 @@
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="text" translatable="yes">Access</property>
<property name="has_frame">True</property>
<property name="invisible_char" translatable="yes">*</property>
<property name="activates_default">False</property>
@ -252,7 +252,7 @@
<property name="selection_mode">GTK_SELECTION_BROWSE</property>
<child>
<widget class="GtkListItem" id="listitem117">
<widget class="GtkListItem" id="listitem141">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Access</property>
@ -260,7 +260,7 @@
</child>
<child>
<widget class="GtkListItem" id="listitem118">
<widget class="GtkListItem" id="listitem142">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Oracle</property>
@ -268,7 +268,7 @@
</child>
<child>
<widget class="GtkListItem" id="listitem119">
<widget class="GtkListItem" id="listitem143">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Sybase</property>
@ -276,7 +276,7 @@
</child>
<child>
<widget class="GtkListItem" id="listitem120">
<widget class="GtkListItem" id="listitem144">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">MS SQL Server</property>
@ -284,12 +284,19 @@
</child>
<child>
<widget class="GtkListItem" id="listitem121">
<widget class="GtkListItem" id="listitem145">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">PostgreSQL</property>
</widget>
</child>
<child>
<widget class="GtkListItem" id="listitem146">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">MySQL</property>
</widget>
</widget>
</child>
</widget>

View File

@ -302,7 +302,7 @@ Click on the <guibutton>Data</guibutton> button from the right hand side of the
</sect2>
<sect2 id="gmdb-table-export">
<title>Data Export</title>
<para>The <guilabel>Export</guilabel> button creates a text file containing the data from a single data.</para>
<para>The <guilabel>Export</guilabel> button creates a text file containing the data from a single table.</para>
<para>To export the table data, perform the following steps</para>
<orderedlist>
<listitem><para>

View File

@ -137,6 +137,7 @@ GtkWidget *schemawin, *combo, *checkbox, *entry;
else if (!strcmp(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry)),"Sybase")) strcpy(backend,"sybase");
else if (!strcmp(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry)),"MS SQL Server")) strcpy(backend,"sybase");
else if (!strcmp(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry)),"PostgreSQL")) strcpy(backend,"postgres");
else if (!strcmp(gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(combo)->entry)),"MySQL")) strcpy(backend,"mysql");
else strcpy(backend,"access");
checkbox = glade_xml_get_widget (schemawin_xml, "rel_checkbox");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox)))

View File

@ -1,4 +1,5 @@
lib_LTLIBRARIES = libmdb.la
libmdb_la_SOURCES= catalog.c mem.c file.c kkd.c table.c data.c dump.c backend.c money.c sargs.c index.c like.c write.c stats.c map.c props.c worktable.c options.c iconv.c
libmdb_la_LDFLAGS = -version-info 1:0:0
AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS)
LIBS = $(GLIB_LIBS) -lm

View File

@ -54,6 +54,17 @@ MdbFormatConstants MdbJet3Constants = {
static size_t _mdb_read_pg(MdbHandle *mdb, unsigned char *pg_buf, unsigned long pg);
/**
* mdb_find_file:
* @filename: path to MDB (database) file
*
* Finds and returns the absolute path to an MDB file. Function will first try
* to fstat file as passed, then search through the $MDBPATH if not found.
*
* Return value: gchar pointer to absolute path. Caller is responsible for
* freeing.
**/
static gchar *mdb_find_file(char *file_name)
{
struct stat status;

View File

@ -1,5 +1,6 @@
lib_LTLIBRARIES = libmdbsql.la
libmdbsql_la_SOURCES= mdbsql.c parser.y lexer.l
libmdbsql_la_LDFLAGS = -version-info 1:0:0
EXTRA_DIST = main.c
DISTCLEANFILES = parser.c parser.h lexer.c
AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS)