1 /* MDB Tools - A library for reading MS Access database file
2 * Copyright (C) 2004 Brian Bruns
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
33 static unsigned long opts;
36 static void load_options();
39 mdb_debug(int klass, char *fmt, ...)
44 if (!optset) load_options();
47 vfprintf (stdout,fmt, ap);
60 if (!optset && (s=getenv("MDBOPTS"))) {
63 if (!strcmp(opt, "use_index")) opts |= MDB_USE_INDEX;
64 if (!strcmp(opt, "debug_like")) opts |= MDB_DEBUG_LIKE;
65 if (!strcmp(opt, "debug_write")) opts |= MDB_DEBUG_WRITE;
66 if (!strcmp(opt, "debug_usage")) opts |= MDB_DEBUG_USAGE;
67 if (!strcmp(opt, "debug_ole")) opts |= MDB_DEBUG_OLE;
68 if (!strcmp(opt, "debug_row")) opts |= MDB_DEBUG_ROW;
69 if (!strcmp(opt, "debug_all")) {
70 opts |= MDB_DEBUG_LIKE;
71 opts |= MDB_DEBUG_WRITE;
72 opts |= MDB_DEBUG_USAGE;
73 opts |= MDB_DEBUG_OLE;
74 opts |= MDB_DEBUG_ROW;
76 opt = strtok(NULL,":");
82 mdb_get_option(unsigned long optnum)
84 if (!optset) load_options();
85 return ((opts & optnum) > 0);