mdbtools/src/util/mdb-ver.c

57 lines
1.4 KiB
C
Raw Normal View History

2002-03-21 12:27:37 +08:00
/* MDB Tools - A library for reading MS Access database file
* Copyright (C) 2000 Brian Bruns
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "mdbtools.h"
int
2002-03-21 12:27:37 +08:00
main(int argc, char **argv)
{
MdbHandle *mdb;
/* doesn't handle tables > 256 columns. Can that happen? */
/*
** 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]);
exit(1);
}
mdb_init();
if (!(mdb = mdb_open(argv[optind]))) {
exit(1);
}
2003-01-02 06:29:39 +08:00
if (IS_JET3(mdb)) {
printf("JET3\n");
} else if (IS_JET4(mdb)) {
printf("JET4\n");
} else {
printf("unknown\n");
2002-03-21 12:27:37 +08:00
}
mdb_free_handle(mdb);
mdb_exit();
exit(0);
2002-03-21 12:27:37 +08:00
}