1 /* Copyright 2014-2019 Free Software Foundation, Inc.
2
3 This program is free software: you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation, either version 3 of the License, or
6 (at your option) any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
15
16 #include <config.h>
17 #include <stdarg.h>
18 #include <stdio.h>
19
20 #include "parser.h"
21
22 /* Whether to dump debugging output on stderr. */
23 int debug_output = 0;
24
25 void
debug(char * s,...)26 debug (char *s, ...)
27 {
28 va_list v;
29
30 if (!debug_output)
31 return;
32 va_start (v, s);
33 vfprintf (stderr, s, v);
34 fputc ('\n', stderr);
35 }
36
37 void
debug_nonl(char * s,...)38 debug_nonl (char *s, ...)
39 {
40 va_list v;
41
42 if (!debug_output)
43 return;
44 va_start (v, s);
45 vfprintf (stderr, s, v);
46 }
47