1 /* debug.c: help the user discover what's going on.
3 Copyright 1993, 1994, 2008 Karl Berry.
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this library; if not, see <http://www.gnu.org/licenses/>. */
18 #include <kpathsea/config.h>
20 #ifdef KPSE_DEBUG /* whole file */
22 unsigned kpathsea_debug = 0;
24 /* If the real definitions of fopen or fclose are macros, we lose -- the
25 #undef won't restore them. */
28 fopen P2C(const_string, filename, const_string, mode)
31 FILE *ret = fopen (filename, mode);
33 if (KPSE_DEBUG_P (KPSE_DEBUG_FOPEN))
34 DEBUGF3 ("fopen(%s, %s) => 0x%lx\n", filename, mode, (unsigned long) ret);
45 if (KPSE_DEBUG_P (KPSE_DEBUG_FOPEN))
46 DEBUGF2 ("fclose(0x%lx) => %d\n", (unsigned long) f, ret);
51 #endif /* KPSE DEBUG */