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 /* If the real definitions of fopen or fclose are macros, we lose -- the
23 #undef won't restore them. */
26 fopen (const char *filename
, const char *mode
)
29 FILE *ret
= fopen (filename
, mode
);
30 #if defined (KPSE_COMPAT_API)
31 kpathsea kpse
= kpse_def
;
32 if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN
))
34 DEBUGF3 ("fopen(%s, %s) => 0x%I64x\n", filename
, mode
, (unsigned __int64
) ret
);
36 DEBUGF3 ("fopen(%s, %s) => 0x%lx\n", filename
, mode
, (unsigned long) ret
);
47 #if defined (KPSE_COMPAT_API)
48 kpathsea kpse
= kpse_def
;
49 if (KPATHSEA_DEBUG_P (KPSE_DEBUG_FOPEN
))
51 DEBUGF2 ("fclose(0x%I64x) => %d\n", (unsigned __int64
) f
, ret
);
53 DEBUGF2 ("fclose(0x%lx) => %d\n", (unsigned long) f
, ret
);
59 #endif /* KPSE DEBUG */