Mon, 17 Nov 2003 14:28:28 +0100
trunk: changeset 59
Set _GNU_SOURCE when compiling with system asprintf. Default to system
asprintf.
5 | 1 | /* |
2 | * libtu/output.h | |
3 | * | |
36 | 4 | * Copyright (c) Tuomo Valkonen 1999-2002. |
53 | 5 | * |
6 | * You may distribute and modify this library under the terms of either | |
7 | * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. | |
5 | 8 | */ |
9 | ||
8 | 10 | #ifndef LIBTU_OUTPUT_H |
11 | #define LIBTU_OUTPUT_H | |
5 | 12 | |
13 | #include <stdarg.h> | |
14 | ||
15 | #include "types.h" | |
16 | ||
35 | 17 | typedef void WarnHandler(const char *); |
18 | extern WarnHandler *set_warn_handler(WarnHandler *handler); | |
5 | 19 | |
20 | extern void verbose(const char *p, ...); | |
21 | extern void verbose_v(const char *p, va_list args); | |
22 | extern void verbose_enable(bool enable); | |
23 | extern int verbose_indent(int depth); | |
24 | ||
25 | extern void warn_progname_enable(bool enable); | |
26 | ||
27 | extern void die(const char *p, ...); | |
28 | extern void die_v(const char *p, va_list args); | |
29 | ||
30 | extern void die_obj(const char *obj, const char *p, ...); | |
31 | extern void die_obj_v(const char *obj, const char *p, va_list args); | |
32 | extern void die_obj_line(const char *obj, int line, const char *p, ...); | |
33 | extern void die_obj_line_v(const char *obj, int line, const char *p, va_list args); | |
34 | ||
35 | extern void die_err(); | |
36 | extern void die_err_obj(const char *obj); | |
37 | extern void die_err_obj_line(const char *obj, int line); | |
38 | ||
39 | ||
40 | extern void warn(const char *p, ...); | |
41 | extern void warn_v(const char *p, va_list args); | |
42 | ||
43 | extern void warn_obj(const char *obj, const char *p, ...); | |
44 | extern void warn_obj_v(const char *obj, const char *p, va_list args); | |
45 | extern void warn_obj_line(const char *obj, int line, const char *p, ...); | |
46 | extern void warn_obj_line_v(const char *obj, int line, const char *p, va_list args); | |
47 | ||
48 | extern void warn_err(); | |
49 | extern void warn_err_obj(const char *obj); | |
50 | extern void warn_err_obj_line(const char *obj, int line); | |
51 | ||
25 | 52 | |
53 | extern char *errmsg(const char *p, ...); | |
54 | extern char *errmsg_v(const char *p, va_list args); | |
55 | ||
56 | extern char *errmsg_obj(const char *obj, const char *p, ...); | |
57 | extern char *errmsg_obj_v(const char *obj, const char *p, va_list args); | |
58 | extern char *errmsg_obj_line(const char *obj, int line, const char *p, ...); | |
59 | extern char *errmsg_obj_line_v(const char *obj, int line, const char *p, va_list args); | |
60 | ||
61 | extern char *errmsg_err(); | |
62 | extern char *errmsg_err_obj(const char *obj); | |
63 | extern char *errmsg_err_obj_line(const char *obj, int line); | |
64 | ||
31 | 65 | extern void libtu_asprintf(char **ret, const char *fmt, ...); |
66 | extern void libtu_vasprintf(char **ret, const char *fmt, va_list args); | |
67 | ||
8 | 68 | #endif /* LIBTU_OUTPUT_H */ |