output.h

Mon, 17 Jan 2005 22:02:09 +0100

author
tuomov
date
Mon, 17 Jan 2005 22:02:09 +0100
changeset 85
9f94b2e96e3b
parent 81
ebefcbcb126f
permissions
-rw-r--r--

trunk: changeset 1934
Fixed everything that requires locale stuff to check CF_NO_LOCALE.

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

mercurial