| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#include "msg.h" |
| 23 |
|
| 24 |
#if HAVE_VPRINTF || HAVE_DOPRNT |
| 25 |
# define HAVE_STDVARARGS 1 |
| 26 |
# if __STDC__ |
| 27 |
# include <stdarg.h> |
| 28 |
# define VA_START(args, lastarg) va_start(args, lastarg) |
| 29 |
# else |
| 30 |
# include <varargs.h> |
| 31 |
# define VA_START(args, lastarg) va_start(args) |
| 32 |
# endif |
| 33 |
# if HAVE_VPRINTF |
| 34 |
# define VA_PRINTF(fp, lastarg, args) vfprintf((fp), (lastarg), (args)) |
| 35 |
# else |
| 36 |
# define VA_PRINTF(fp, lastarg, args) _doprnt((lastarg), (args), (fp)) |
| 37 |
# endif |
| 38 |
# define VA_END(args) va_end(args) |
| 39 |
#else |
| 40 |
|
| 41 |
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8 |
| 42 |
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; |
| 43 |
# define VA_START(args, lastarg) |
| 44 |
# define VA_PRINTF(fp, lastarg, args) fprintf((fp), (lastarg), va_alist) |
| 45 |
# define VA_END(args) |
| 46 |
#endif |
| 47 |
|
| 48 |
|
| 49 |
void |
| 50 |
#if __STDC__ && HAVE_STDVARARGS |
| 51 |
dbg_errmsg(const char *fmt, ...) |
| 52 |
#else |
| 53 |
dbg_errmsg (const char *fmt, va_alist) |
| 54 |
#endif |
| 55 |
{ |
| 56 |
#if HAVE_STDVARARGS |
| 57 |
va_list args; |
| 58 |
#endif |
| 59 |
fprintf(stdout, "** "); |
| 60 |
VA_START (args, fmt); |
| 61 |
VA_PRINTF (stdout, fmt, args); |
| 62 |
VA_END (args); |
| 63 |
fprintf (stdout, "\n"); |
| 64 |
fflush (stdout); |
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
void |
| 69 |
#if __STDC__ && HAVE_STDVARARGS |
| 70 |
dbg_msg(const char *fmt, ...) |
| 71 |
#else |
| 72 |
|
| 73 |
dbg_msg (const char *fmt, va_alist) |
| 74 |
#endif |
| 75 |
{ |
| 76 |
#if HAVE_STDVARARGS |
| 77 |
va_list args; |
| 78 |
#endif |
| 79 |
VA_START (args, fmt); |
| 80 |
VA_PRINTF (stdout, fmt, args); |
| 81 |
VA_END (args); |
| 82 |
fprintf (stdout, "\n"); |
| 83 |
fflush (stdout); |
| 84 |
} |