Nirgal | 11 Feb 18:45
Favicon

namespace: reserved C++ keyword

On Thursday 09 February 2012 09:37:09 Dobrov Grigoriy wrote:
> (...) 
> The problem is that I am trying to include mdbtools.h header in my C++
> project and compiler fails in line 495:
> extern void mdb_print_schema(MdbHandle *mdb, FILE *outfile, char *tabname,
> char *namespace, guint32 export_options);
> 
> The fail happens because  'namespace'  is a  keyword in C++ so the C++
> compiler doesn't expect it to occur in the middle of function declaration.
> I understand that C-programmers aren't obliged to think about C++ keywords
> so it seems to me that it's more reasonable to patch the header in debian
> package, of course, if you are not against the idea to help c++ developers

I renamed namespace into dbnamespace.
See https://github.com/brianb/mdbtools/commit/7634e329c740825c97652175bcad16a1a58688ae

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
Nirgal | 2 Feb 20:29
Favicon

-Wall fixing

Sorry for the spam, one more:

https://github.com/brianb/mdbtools/commit/b7200c9b576cf8c22beae63927c6fedc2e6816c0
contains some trivial fixes for -Wall compilation

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Nirgal | 2 Feb 19:19
Favicon

man: removed <> from synopsis lines

I think <> should not be present in sysnopsis lines in man pages since txt2man properly underline them.
I removed them.
https://github.com/brianb/mdbtools/commit/9ee13359402483d570446bef904f0a7f888d6d44

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Nirgal | 2 Feb 09:33
Favicon

Commited doc changes

I just commited some small changes in documentation:
- See also sections
- mdb-header exit code

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Nirgal | 30 Jan 12:13
Favicon

-N documentation in man pages

I just added schema prefixing option in man documentation of mdb-schema and mdb-export:

https://github.com/brianb/mdbtools/commit/ad87174f10d96ca1ab27cb61feb70b6d2db9b143

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
George L. Emigh | 26 Jan 23:58

double changed to float from older version of mdbtools

I apologize if this is not the correct place to ask about this.

I am converting my data to MySQL.

I was using mdbtools-0.6_pre2 but had some issues that 0.7~rc1 seemed to 
resolve, I was able to build it fine, but one of the problems I have come 
across is stopping me.

in the 0.6 version I have a database that mdb-schema reports the Quantity 
field as:
Quantity Double

where 0.7 reports it as
Quantity  Float

In 0.6 the value reported by mdb-export is correct, in this example 15.
in 0.7 the value is reported as 1.5000000000000000e+01

Is this a bug, or should I just be using 0.6 and working around it's 
limitations.

Thank you for your time.

--

-- 
George L. Emigh - AB4BD

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
(Continue reading)

Dale Scott | 16 Jan 15:45
Picon
Favicon
Gravatar

autogen error compiling current version

Hi, I tried compiling the current github head and get the following error in autogen (Linux Mint 11, autoconf 2.5):



dale <at> dale-ThinkPad-T61 ~/Projects/mdbtools $ ./autogen.sh
**Warning**: I am going to run `configure' with no arguments.
If you wish to pass any to it, please specify them on the
`./autogen.sh' command line.

processing .
Running aclocal  ...
configure.in:117: warning: macro `AM_PATH_GLIB_2_0' not found in library
Running libtoolize...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
Running autoheader...
Running automake --gnu  ...
Running autoconf ...
Running ./configure ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
<snip> 
checking for iconv... yes

checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking Are we using flex ... no - SQL engine disable
./configure: line 11131: syntax error near unexpected token `2.0.0'
./configure: line 11131: `AM_PATH_GLIB_2_0(2.0.0)'

I get the same error on FreeBSD 9.0, except the error message also notes there is an unexpected ")"

This didn't happen with the github head as of May 2010, but that was also on FreeBSD 8.2. I'm going to try re-compiling the old version again just to check what happens, but can anyone offer suggestions, or point out anything stupid I'm doing or not doing?

Thanks,
Dale

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
mdbtools-dev mailing list
mdbtools-dev <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mdbtools-dev
Nirgal | 16 Jan 03:21
Favicon

2 more patches

Attached are two very old patches that were hanging in Debian distro...

* treeviewmodel slightly improves the typing, so that less casts are necessary.

* filelocals reduce the scope of some local functions declaring them static.

These are small changes that I guess can go in. What do you think of these?
Description: Aestetic type changes
 In gmdb2/sql.c there are some incorrect uses of treeviews and models.
 Attached patch fixes or improves variable type definitions and adds and
 removes some typecasts as needed.
Author: Filip Van Raemdonck <mechanix <at> debian.org>
Forwarded: http://sourceforge.net/tracker/?func=detail&aid=1081706&group_id=2294&atid=302294
Reviewed-by: Jean-Michel Vourgère <jmv_deb <at> nirgal.com>
Last-Update: 2012-01-11

Index: mdbtools/src/gmdb2/sql.c
===================================================================
--- mdbtools.orig/src/gmdb2/sql.c
+++ mdbtools/src/gmdb2/sql.c
@@ -55,6 +55,8 @@
 	}
 }

+gchar* gmdb_export_get_filepath (GladeXML*);	/* from table_export.c */
+
 /* callbacks */
 static void
 gmdb_sql_write_rslt_cb(GtkWidget *w, GladeXML *xml)
@@ -74,7 +76,7 @@
 	GtkWidget *treeview;
 	GtkTreeViewColumn *col;
 	GList *glist;
-	GtkTreeStore *store;
+	GtkTreeModel *store;
 	GtkTreeIter iter;
 	GValue value = { 0, };
 	
@@ -118,17 +120,16 @@
 		g_list_free(glist);
 	}

-	store = (GtkTreeStore *) gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
-	gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter);
+	store = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
+	gtk_tree_model_get_iter_first(store, &iter);
 	rows=0;
 	g_value_init (&value, G_TYPE_STRING);
 	do {
 		rows++;
-		n_columns = gtk_tree_model_get_n_columns(GTK_TREE_MODEL(store));
+		n_columns = gtk_tree_model_get_n_columns(store);
 		for (i=0; i < n_columns; i++) {
 			if (i>0) fputs(delimiter, outfile);
-			gtk_tree_model_get_value(GTK_TREE_MODEL(store), 
-					&iter, i, &value);
+			gtk_tree_model_get_value(store, &iter, i, &value);
 			str = (gchar *) g_value_get_string(&value);
 			gmdb_print_quote(outfile, need_quote, quotechar, delimiter, str);
 			fputs(str, outfile);
@@ -136,7 +137,7 @@
 			g_value_unset(&value);
 		}
 		fputs(lineterm, outfile);
-	} while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
+	} while (gtk_tree_model_iter_next(store, &iter));

 	fclose(outfile);
 	gtk_widget_destroy(filesel);
@@ -353,7 +354,8 @@
 	MdbSQLColumn *sqlcol;
 	GtkTextBuffer *txtbuffer;
 	GtkTextIter start, end;
-	GtkWidget *textview, *combo, *treeview, *store;
+	GtkWidget *textview, *combo, *treeview;
+	GtkTreeModel *store;
 	/*GtkWidget *window;*/
 	GList *history;
 	GType *gtypes;
@@ -402,17 +404,17 @@
 	for (i=0;i<sql->num_columns;i++) 
 		gtypes[i]=G_TYPE_STRING;

-	store = (GtkWidget *) gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
+	store = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
 	if (store) {
 		while ((column = gtk_tree_view_get_column(GTK_TREE_VIEW(treeview), 0))) {
 			gtk_tree_view_remove_column(GTK_TREE_VIEW(treeview), column);
 		}
-		gtk_widget_destroy(store);
+		g_object_unref(store);
 	}
-	store = (GtkWidget *) gtk_list_store_newv(sql->num_columns, gtypes);
+	store = (GtkTreeModel*)gtk_list_store_newv(sql->num_columns, gtypes);
 	g_free(gtypes);

-	gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(store));
+	gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), store);
 	
 	GtkCellRenderer *renderer;
 	renderer = gtk_cell_renderer_text_new(); 
Description: Reduce function scopes
 This patch removes a few function declarations from the catch-all gmdb.h as
 they are defined and used only in a single file, and turns them in to static
 (file local) functions instead.
Author: Filip Van Raemdonck <mechanix <at> debian.org>
Forwarded: http://sourceforge.net/tracker/?func=detail&aid=1081716&group_id=2294&atid=302294
Reviewed-by: Jean-Michel Vourgère <jmv_deb <at> nirgal.com>
Last-Update: 2012-01-11

Index: mdbtools/src/gmdb2/gmdb.h
===================================================================
--- mdbtools.orig/src/gmdb2/gmdb.h
+++ mdbtools/src/gmdb2/gmdb.h
@@ -57,10 +57,8 @@
 void gmdb_debug_close_all(void);

 /* sql.c */
-void gmdb_sql_save_as_cb(GtkWidget *w, GladeXML *xml);
 void gmdb_sql_new_cb(GtkWidget *w, gpointer data);
 void gmdb_sql_close_all(void);
-void gmdb_sql_save_query(GladeXML *xml, gchar *file_path);

 unsigned long gmdb_prefs_get_maxrows(void);

Index: mdbtools/src/gmdb2/sql.c
===================================================================
--- mdbtools.orig/src/gmdb2/sql.c
+++ mdbtools/src/gmdb2/sql.c
@@ -39,8 +39,10 @@
 extern MdbHandle *mdb;
 extern MdbSQL *sql;

-static void gmdb_sql_tree_populate(MdbHandle *mdb, GladeXML *xml);
-static void gmdb_sql_load_query(GladeXML *xml, gchar *file_path);
+static void gmdb_sql_tree_populate (MdbHandle*, GladeXML*);
+static void gmdb_sql_load_query (GladeXML*, gchar*);
+static void gmdb_sql_save_query (GladeXML*, gchar*);
+static void gmdb_sql_save_as_cb (GtkWidget*, GladeXML*);

 void
 gmdb_sql_close_all()
@@ -190,7 +192,7 @@
 	}
 	gmdb_sql_save_query(xml, str);
 }
-void
+static void
 gmdb_sql_save_as_cb(GtkWidget *w, GladeXML *xml)
 {
 	GtkWindow *parent_window = (GtkWindow *) glade_xml_get_widget (xml, "gmdb");
@@ -458,8 +460,7 @@
 }

 void
-gmdb_sql_new_cb(GtkWidget *w, gpointer data)
-{
+gmdb_sql_new_cb (GtkWidget *w, gpointer data) {
 	GtkTargetEntry src;
 	GtkWidget *mi, *but, *combo;
 	GladeXML *sqlwin_xml;
@@ -619,9 +620,9 @@
 	textview = glade_xml_get_widget(xml, "sql_textview");
 	g_object_set_data(G_OBJECT(textview), "file_name", file_name);
 }
-void
-gmdb_sql_save_query(GladeXML *xml, gchar *file_path)
-{
+
+static void
+gmdb_sql_save_query (GladeXML *xml, gchar *file_path) {
 	FILE *out;
 	GtkWidget *textview;
         GtkTextBuffer *txtbuffer;
@@ -697,8 +698,7 @@
 #else

 void
-gmdb_sql_new_cb(GtkWidget *w, gpointer data)
-{
+gmdb_sql_new_cb (GtkWidget *w, gpointer data) {
 	GtkWidget* dlg = gtk_message_dialog_new (gtk_widget_get_toplevel (w),
 	    GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
 	    _("SQL support was not built.\nRun configure with the --enable-sql option."));
------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
mdbtools-dev mailing list
mdbtools-dev <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mdbtools-dev
Nirgal | 16 Jan 02:51
Favicon

More changes in doc/Makefile.am

Attached is a patch I'd like to commit:
- Fix the html/install removal for "make clean"
- Fix test of "userguide" when making links
- Make must fail when openjade fails. Testing doc/book1.htm is not enough, for example when you have
partial docbook installation.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f48bda5..85a1df5 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -9,7 +9,7 @@ dist_man_MANS	= mdb-tables.1 mdb-ver.1 mdb-export.1 mdb-schema.1 mdb-sql.1 \
 if ENABLE_DOCBOOK
   dist_man_MANS += install.tgz
 endif
-DISTCLEANFILES = ${dist_man_MANS}
+CLEANFILES = ${dist_man_MANS} install install.tgz
 EXTRA_DIST	= mdb-tables.txt mdb-ver.txt mdb-export.txt mdb-schema.txt mdb-sql.txt \
 	mdb-array.txt mdb-header.txt mdb-hexdump.txt mdb-parsecsv.txt mdb-prop.txt gmdb2.txt \
 	faq.html install.sgml
@@ -20,18 +20,14 @@ EXTRA_DIST	= mdb-tables.txt mdb-ver.txt mdb-export.txt mdb-schema.txt mdb-sql.tx
 # Converting DocBook to HTML (several small files)
 # http://www.freebsd.org/tutorials/docproj-primer/x3132.html#AEN3140
 install.tgz: $(srcdir)/install.sgml
-	rm -rf html && \
-	mkdir html && \
+	rm -rf html
+	mkdir html
 	cd html && \
-	openjade -d ${DOCBOOK_DSL} -t sgml ../$(srcdir)/install.sgml; \
-	test -f book1.htm && \
-	ln -s book1.htm index.html && \
-	cd .. && \
-	if ! [ -L userguide ]; then \
-	        ln -s html install; \
-	fi ; \
+	    openjade -d ${DOCBOOK_DSL} -t sgml ../install.sgml
+	[ -f html/book1.htm ]
+	ln -s book1.htm html/index.html
+	[ -L install ] || ln -s html install
 	tar zcf install.tgz install/*

 clean-local:
 	-rm -rf html
-	-rm -f install
------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
mdbtools-dev mailing list
mdbtools-dev <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mdbtools-dev
Nirgal | 3 Jan 23:00
Favicon

Don't calling exit() from libmdb.so

Hi everyone

Debian packaging analysis is complaining about the fact that libmdb might call exit().

> N:    In the case of an error, the library should instead return an
> N:    appropriate error code to the calling program which can then determine
> N:    how to handle the error, including performing any required clean-up.

Does the attached patch looks ok for you?
Index: mdbtools/src/libmdb/write.c
===================================================================
--- mdbtools.orig/src/libmdb/write.c
+++ mdbtools/src/libmdb/write.c
@@ -554,8 +554,8 @@
 	}
 	mdb_debug(MDB_DEBUG_WRITE, "writing page %d", pgnum);
 	if (!mdb_write_pg(mdb, pgnum)) {
-		fprintf(stderr, "write failed! exiting...\n");
-		exit(1);
+		fprintf(stderr, "write failed!\n");
+		return 0;
 	}

 	mdb_update_indexes(table, num_fields, fields, pgnum, rownum);
@@ -685,8 +685,14 @@
 	}
 	/* do it! */
 	mdb_replace_row(table, table->cur_row-1, row_buffer, new_row_size);
-	return 0;
+	return 0; /* FIXME */
 }
+
+/* WARNING the return code is opposite to convention used elsewhere:
+ * returns 0 on success
+ * returns 1 on failure
+ * This might change on next ABI break.
+ */
 int 
 mdb_replace_row(MdbTableDef *table, int row, void *new_row, int new_row_size)
 {
@@ -745,8 +751,8 @@
 	}
 	/* drum roll, please */
 	if (!mdb_write_pg(mdb, table->cur_phys_pg)) {
-		fprintf(stderr, "write failed! exiting...\n");
-		exit(1);
+		fprintf(stderr, "write failed!\n");
+		return 1;
 	}
 	return 0;
 }
------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
mdbtools-dev mailing list
mdbtools-dev <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mdbtools-dev
Nirgal | 15 Oct 18:29
Favicon

[patch] conditionnal documentation: SGML to HTML

doc/Makefile.am advertise that html/ and install.tgz are built if DOCBOOK_DSL is defined.
But this was not working. Attached is a patch to fix that.

I plan to commit it in a week, if there is no feed back.
Description: html file generation from sgml
 Build install.tgz documentation when DOCBOOK_DSL is defined, as advertised by
 the comments.
 Clean up unused html/dist/man targets
 new clean-local target to remove tmp & html files

Author: Jean-Michel Vourgère <jmv_deb <at> nirgal.com>
Last-Update: 2011-10-15

Index: mdbtools/doc/Makefile.am
===================================================================
--- mdbtools.orig/doc/Makefile.am
+++ mdbtools/doc/Makefile.am
@@ -1,36 +1,37 @@
-# Converting DocBook to HTML (several small files)
-# http://www.freebsd.org/tutorials/docproj-primer/x3132.html#AEN3140
 SHELL = /bin/sh
 TXT2MAN = txt2man
 PRODUCT = MDBTools

+# To make the userguide, export DOCBOOK_DSL TO point to docbook.dsl.
+
 dist_man_MANS	= mdb-tables.1 mdb-ver.1 mdb-export.1 mdb-schema.1 mdb-sql.1 \
 	mdb-array.1 mdb-header.1 mdb-hexdump.1 mdb-parsecsv.1 mdb-prop.1 gmdb2.1
+if ENABLE_DOCBOOK
+  dist_man_MANS += install.tgz
+endif
 DISTCLEANFILES = ${dist_man_MANS}
-EXTRA_DIST	= mdb-tables.txt mdb-ver.txt mdb-export.txt mdb-schema.txt mdb-sql.txt faq.html
txt2man install.sgml
-
-html:	install.tgz
-
-dist:	install.tgz man 
-#dist:	man 
-
-# To make the userguide, export DOCBOOK_DSL TO point to docbook.dsl.
-
-install.tgz: $(srcdir)/install.sgml
-	if test -n "${DOCBOOK_DSL}"; then \
-	        rm -rf html && \
-	        mkdir html && \
-	        cd html && pwd && \
-	        openjade -d ${DOCBOOK_DSL} -t sgml ../$(srcdir)/install.sgml; \
-	        test -f book1.htm && \
-	        ln -s book1.htm index.html && cd .. && \
-	        if ! [ -L userguide ]; then \
-	                ln -s html install; \
-	        fi; \
-	        tar zcf install.tgz install/* \
-	; fi
-
-man:	mdb-tables.1 mdb-ver.1 mdb-export.1 mdb-sql.1
+EXTRA_DIST	= mdb-tables.txt mdb-ver.txt mdb-export.txt mdb-schema.txt mdb-sql.txt \
+	mdb-array.txt mdb-header.txt mdb-hexdump.txt mdb-parsecsv.txt mdb-prop.txt gmdb2.txt \
+	faq.html install.sgml

 .txt.1:
 	- $(TXT2MAN) -P $(PRODUCT) -t $(PRODUCT) -r $(VERSION) -s 1 $(srcdir)/$< > $@
+
+# Converting DocBook to HTML (several small files)
+# http://www.freebsd.org/tutorials/docproj-primer/x3132.html#AEN3140
+install.tgz: $(srcdir)/install.sgml
+	rm -rf html && \
+	mkdir html && \
+	cd html && \
+	openjade -d ${DOCBOOK_DSL} -t sgml ../$(srcdir)/install.sgml; \
+	test -f book1.htm && \
+	ln -s book1.htm index.html && \
+	cd .. && \
+	if ! [ -L userguide ]; then \
+	        ln -s html install; \
+	fi ; \
+	tar zcf install.tgz install/*
+
+clean-local:
+	-rm -rf html
+	-rm -f install
Index: mdbtools/configure.in
===================================================================
--- mdbtools.orig/configure.in
+++ mdbtools/configure.in
@@ -181,6 +181,8 @@

 AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)

+AM_CONDITIONAL(ENABLE_DOCBOOK, test -n "$DOCBOOK_DSL")
+
 dnl Checks for library functions.
 VL_LIB_READLINE

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
mdbtools-dev mailing list
mdbtools-dev <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mdbtools-dev

Gmane