26 |
#include <config.h> |
#include <config.h> |
27 |
#endif |
#endif |
28 |
#include <stdio.h> |
#include <stdio.h> |
|
#ifdef HAVE_STDARG_H |
|
29 |
#include <stdarg.h> |
#include <stdarg.h> |
|
#else |
|
|
#include <varargs.h> |
|
|
#endif |
|
30 |
#ifdef STDC_HEADERS |
#ifdef STDC_HEADERS |
31 |
#include <stdlib.h> |
#include <stdlib.h> |
32 |
#endif |
#endif |
63 |
#define PHP_LBRACK '[' |
#define PHP_LBRACK '[' |
64 |
#define PHP_RBRACK ']' |
#define PHP_RBRACK ']' |
65 |
|
|
|
#ifdef HAVE_STDARG_H |
|
66 |
static void debug_print(const char *, ...); |
static void debug_print(const char *, ...); |
|
#else |
|
|
static void debug_print(); |
|
|
#endif |
|
|
|
|
67 |
static int level; /* block nest level */ |
static int level; /* block nest level */ |
68 |
static STRBUF *string; /* string */ |
static STRBUF *string; /* string */ |
69 |
|
|
71 |
* For debug. |
* For debug. |
72 |
*/ |
*/ |
73 |
static void |
static void |
|
#ifdef HAVE_STDARG_H |
|
74 |
debug_print(const char *s, ...) |
debug_print(const char *s, ...) |
|
#else |
|
|
debug_print(s, va_alist) |
|
|
const char *s; |
|
|
va_dcl |
|
|
#endif |
|
75 |
{ |
{ |
76 |
va_list ap; |
va_list ap; |
77 |
|
|
78 |
if (!debug) |
if (!debug) |
79 |
return; |
return; |
|
#ifdef HAVE_STDARG_H |
|
80 |
va_start(ap, s); |
va_start(ap, s); |
|
#else |
|
|
va_start(ap); |
|
|
#endif |
|
81 |
(void)vfprintf(stderr, s, ap); |
(void)vfprintf(stderr, s, ap); |
82 |
va_end(ap); |
va_end(ap); |
83 |
} |
} |