Fix CursorMove command to correctly honour EdgeScroll settings.
[fvwm.git] / modules / FvwmIconMan / debug.c
blob9b5c194133bea5fb1f93873e77204ea8c97f6044
1 /* -*-c-*- */
2 /* This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #include "config.h"
19 #include <stdarg.h>
20 #include <assert.h>
22 #include "FvwmIconMan.h"
24 static FILE *console = NULL;
26 /* I'm finding lots of the debugging is dereferencing pointers
27 to zero. I fixed some of them, until I grew tired of the game.
28 If you want to turn these back on, be prepared for lots of core
29 dumps. dje 11/15/98. */
30 int CORE = 0;
31 int FUNCTIONS = 0;
32 int X11 = 0;
33 int FVWM = 0;
34 int CONFIG = 0;
35 int WINLIST = 0;
37 void
38 ConsoleMessage(const char *fmt, ...)
40 va_list args;
42 assert(console != NULL);
44 fputs("FvwmIconMan: ", console);
46 va_start(args, fmt);
47 vfprintf(console, fmt, args);
48 va_end(args);
51 int
52 OpenConsole(const char *filenm)
54 if (!filenm)
56 console = stderr;
58 else if ((console = fopen(filenm, "w")) == NULL)
60 fprintf(stderr,"%s: cannot open %s\n", MyName, filenm);
61 return 0;
64 return 1;
67 void
68 ConsoleDebug(int flag, const char *fmt, ...)
70 assert(console != NULL);
72 #ifdef FVWM_DEBUG_MSGS
73 if (flag)
75 va_list args;
77 va_start(args, fmt);
78 vfprintf(console, fmt, args);
79 fflush(console);
80 va_end(args);
82 #endif