root / qemu-error.h @ c05c7a73
History | View | Annotate | Download (1.4 kB)
1 | ba0fe87a | Markus Armbruster | /*
|
---|---|---|---|
2 | ba0fe87a | Markus Armbruster | * Error reporting
|
3 | ba0fe87a | Markus Armbruster | *
|
4 | ba0fe87a | Markus Armbruster | * Copyright (C) 2010 Red Hat Inc.
|
5 | ba0fe87a | Markus Armbruster | *
|
6 | ba0fe87a | Markus Armbruster | * Authors:
|
7 | ba0fe87a | Markus Armbruster | * Markus Armbruster <armbru@redhat.com>,
|
8 | ba0fe87a | Markus Armbruster | *
|
9 | ba0fe87a | Markus Armbruster | * This work is licensed under the terms of the GNU GPL, version 2 or later.
|
10 | ba0fe87a | Markus Armbruster | * See the COPYING file in the top-level directory.
|
11 | ba0fe87a | Markus Armbruster | */
|
12 | ba0fe87a | Markus Armbruster | |
13 | 2f792016 | Markus Armbruster | #ifndef QEMU_ERROR_H
|
14 | 2f792016 | Markus Armbruster | #define QEMU_ERROR_H
|
15 | 2f792016 | Markus Armbruster | |
16 | 827b0813 | Markus Armbruster | typedef struct Location { |
17 | 827b0813 | Markus Armbruster | /* all members are private to qemu-error.c */
|
18 | 0f0bc3f1 | Markus Armbruster | enum { LOC_NONE, LOC_CMDLINE, LOC_FILE } kind;
|
19 | 827b0813 | Markus Armbruster | int num;
|
20 | 827b0813 | Markus Armbruster | const void *ptr; |
21 | 827b0813 | Markus Armbruster | struct Location *prev;
|
22 | 827b0813 | Markus Armbruster | } Location; |
23 | 827b0813 | Markus Armbruster | |
24 | 827b0813 | Markus Armbruster | Location *loc_push_restore(Location *loc); |
25 | 827b0813 | Markus Armbruster | Location *loc_push_none(Location *loc); |
26 | 827b0813 | Markus Armbruster | Location *loc_pop(Location *loc); |
27 | 827b0813 | Markus Armbruster | Location *loc_save(Location *loc); |
28 | 827b0813 | Markus Armbruster | void loc_restore(Location *loc);
|
29 | 827b0813 | Markus Armbruster | void loc_set_none(void); |
30 | 0f0bc3f1 | Markus Armbruster | void loc_set_cmdline(char **argv, int idx, int cnt); |
31 | cf5a65aa | Markus Armbruster | void loc_set_file(const char *fname, int lno); |
32 | 827b0813 | Markus Armbruster | |
33 | ba0fe87a | Markus Armbruster | void error_vprintf(const char *fmt, va_list ap); |
34 | ba0fe87a | Markus Armbruster | void error_printf(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); |
35 | aa924ae7 | Markus Armbruster | void error_printf_unless_qmp(const char *fmt, ...) |
36 | aa924ae7 | Markus Armbruster | __attribute__ ((format(printf, 1, 2))); |
37 | 827b0813 | Markus Armbruster | void error_print_loc(void); |
38 | 65abca0a | Markus Armbruster | void error_set_progname(const char *argv0); |
39 | 1ecda02b | Markus Armbruster | void error_report(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); |
40 | ab5b027e | Markus Armbruster | void qerror_report_internal(const char *file, int linenr, const char *func, |
41 | ab5b027e | Markus Armbruster | const char *fmt, ...) |
42 | ab5b027e | Markus Armbruster | __attribute__ ((format(printf, 4, 5))); |
43 | 2f792016 | Markus Armbruster | |
44 | ab5b027e | Markus Armbruster | #define qerror_report(fmt, ...) \
|
45 | ab5b027e | Markus Armbruster | qerror_report_internal(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__) |
46 | 2f792016 | Markus Armbruster | |
47 | 2f792016 | Markus Armbruster | #endif |