|
Revision 918, 1.2 kB
(checked in by takkaria, 3 months ago)
|
Use consistent newlines everywhere, and also set the svn:eol-style property to native on all text files.
|
- Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
#include "angband.h" |
|---|
| 19 |
#include "debug.h" |
|---|
| 20 |
|
|---|
| 21 |
typedef void debug_hook(const char *); |
|---|
| 22 |
|
|---|
| 23 |
static void to_stderr(const char *out); |
|---|
| 24 |
|
|---|
| 25 |
static debug_hook *d_out = to_stderr; |
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
static void to_stderr(const char *out) |
|---|
| 31 |
{ |
|---|
| 32 |
fputs(out, stderr); |
|---|
| 33 |
fputs("\n", stderr); |
|---|
| 34 |
} |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
void debug(const char *format, ...) |
|---|
| 43 |
{ |
|---|
| 44 |
va_list vp; |
|---|
| 45 |
char buffer[1024] = ""; |
|---|
| 46 |
|
|---|
| 47 |
va_start(vp, format); |
|---|
| 48 |
vstrnfmt(buffer, sizeof(buffer), format, vp); |
|---|
| 49 |
va_end(vp); |
|---|
| 50 |
|
|---|
| 51 |
d_out(buffer); |
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
return; |
|---|
| 55 |
} |
|---|