mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-01-02 12:27:09 +08:00
index work
dmalloc headers mem leak fixes start on i18n
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
bin_PROGRAMS = mdb-export mdb-array mdb-schema mdb-tables mdb-parsecsv mdb-header mdb-sql mdb-ver prtable prcat prdata prkkd prdump prole updrow prindex
|
||||
LIBS = $(GLIB_LIBS) $(READLINE_LIBS) @LEXLIB@
|
||||
DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\"
|
||||
INCLUDES = -I$(top_srcdir)/include $(GLIB_CFLAGS)
|
||||
LDADD = ../libmdb/libmdb.la
|
||||
if SQL
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
#include "mdbtools.h"
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
|
||||
#include "mdbtools.h"
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
dbcc_page_usage(MdbTableDef *table)
|
||||
{
|
||||
|
||||
@@ -17,9 +17,12 @@
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "mdbtools.h"
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
#define is_text_type(x) (x==MDB_TEXT || x==MDB_MEMO || x==MDB_SDATETIME)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
@@ -129,9 +132,11 @@ char *s;
|
||||
for (j=0;j<table->num_cols;j++) {
|
||||
free(bound_values[j]);
|
||||
}
|
||||
mdb_free_tabledef(table);
|
||||
}
|
||||
}
|
||||
|
||||
mdb_close(mdb);
|
||||
mdb_free_handle(mdb);
|
||||
mdb_exit();
|
||||
|
||||
|
||||
@@ -18,10 +18,13 @@
|
||||
|
||||
/* this utility dumps the C headers for an existing database */
|
||||
/* it will create three files - types.h and dump_types.[ch] */
|
||||
|
||||
#include "mdbtools.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
void copy_header (FILE *f)
|
||||
{
|
||||
fprintf (f, "/******************************************************************/\n");
|
||||
|
||||
@@ -19,11 +19,14 @@
|
||||
/* this utility converts a CSV from an existing database to a C file */
|
||||
/* input FOO.txt, output FOO.c */
|
||||
/* generates an array of type FOO */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
#define FILENAMESIZE 128
|
||||
#define BUFFERSIZE 4096
|
||||
#define LF 10
|
||||
|
||||
@@ -17,9 +17,12 @@
|
||||
*/
|
||||
|
||||
/* this utility dumps the schema for an existing database */
|
||||
|
||||
#include "mdbtools.h"
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_READLINE
|
||||
#include <readline/readline.h>
|
||||
@@ -24,6 +23,10 @@
|
||||
#include <string.h>
|
||||
#include "mdbsql.h"
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
void dump_results(MdbSQL *sql);
|
||||
void dump_results_pp(MdbSQL *sql);
|
||||
|
||||
@@ -415,6 +418,8 @@ FILE *in = NULL, *out = NULL;
|
||||
}
|
||||
mdb_sql_exit(sql);
|
||||
|
||||
free(mybuf);
|
||||
free(s);
|
||||
myexit(0);
|
||||
|
||||
return 0; /* make gcc -Wall happy */
|
||||
|
||||
@@ -17,9 +17,12 @@
|
||||
*/
|
||||
|
||||
/* this utility dumps the schema for an existing database */
|
||||
|
||||
#include "mdbtools.h"
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
@@ -84,7 +87,8 @@ int opt;
|
||||
if (!line_break)
|
||||
fprintf (stdout, "\n");
|
||||
|
||||
mdb_free_handle (mdb);
|
||||
mdb_close(mdb);
|
||||
mdb_free_handle(mdb);
|
||||
mdb_exit();
|
||||
if (delimiter) free(delimiter);
|
||||
|
||||
|
||||
@@ -17,8 +17,13 @@
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "mdbtools.h"
|
||||
#include "mdbprivate.h"
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
@@ -26,12 +31,15 @@ main(int argc, char **argv)
|
||||
MdbHandle *mdb;
|
||||
/* doesn't handle tables > 256 columns. Can that happen? */
|
||||
|
||||
/* setlocale (LC_ALL, ""); */
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
/*
|
||||
** optind is now the position of the first non-option arg,
|
||||
** see getopt(3)
|
||||
*/
|
||||
if (argc < 2) {
|
||||
fprintf(stderr,"Usage: %s <file>\n",argv[0]);
|
||||
fprintf(stderr,_("Usage: %s <file>\n"),argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -45,7 +53,7 @@ MdbHandle *mdb;
|
||||
} else if (IS_JET4(mdb)) {
|
||||
printf("JET4\n");
|
||||
} else {
|
||||
printf("unknown\n");
|
||||
printf(_("unknown database version\n"));
|
||||
}
|
||||
|
||||
mdb_free_handle(mdb);
|
||||
|
||||
Reference in New Issue
Block a user