1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
12 /** If a C compiler other than GCC is used the macro below will substitute all
13 * GCC-specific non-standard attributes with an empty string. */
15 #define __attribute__(arg)
24 * \defgroup error Error reporting functions
25 * \author Roland Gecse <ethrge@eth.ericsson.se>
32 * Verbosity level (bitmask).
35 * 1: "not supported" messages
42 * Debug bits define the debug level in the interval 0..7; 0 means no
43 * debug messages, 7 means very verbose.
45 extern unsigned verb_level
;
48 * The argv[0] of main, i.e. the program name.
50 extern const char *argv0
;
53 * FATAL_ERROR(const char *fmt, ...) macro prints a formatted error message
54 * to stderr and aborts execution. It calls the fatal_error function with
55 * appropriate file name and line number information
57 #if defined(__GNUC__) && __GNUC__ < 3
59 * The preprocessors of GCC versions earlier than 3.0 do not support the
60 * standard notation for variadic macros in C++ mode.
61 * Therefore this proprietary notation is used with those old GCC versions.
63 #define FATAL_ERROR(fmt, args...) \
64 (fatal_error(__FILE__, __LINE__, fmt, ## args))
67 * This is the standard notation.
69 #define FATAL_ERROR(...) \
70 (fatal_error(__FILE__, __LINE__, __VA_ARGS__))
74 * fatal_error function, which is not supposed to be called directly.
76 extern void fatal_error(const char *filename
, int lineno
, const char *fmt
, ...)
77 __attribute__ ((__format__ (__printf__
, 3, 4), __noreturn__
));
80 * Prints a formatted error message to stderr.
81 * Used for reporting system-related errors, e.g. file not found etc.
82 * Compiler errors are reported through Common::Location::error.
84 extern void ERROR(const char *fmt
, ...)
85 __attribute__ ((__format__ (__printf__
, 1, 2)));
88 * Prints a formatted warning message to stderr.
90 extern void WARNING(const char *fmt
, ...)
91 __attribute__ ((__format__ (__printf__
, 1, 2)));
94 * Prints a formatted warning message to stderr: "Warning: Not supported: %s".
96 extern void NOTSUPP(const char *fmt
, ...)
97 __attribute__ ((__format__ (__printf__
, 1, 2)));
100 * Prints a formatted notify message to stderr.
102 extern void NOTIFY(const char *fmt
, ...)
103 __attribute__ ((__format__ (__printf__
, 1, 2)));
106 * Prints a formatted debug message to stderr.
108 extern void DEBUG(unsigned level
, const char *fmt
, ...)
109 __attribute__ ((__format__ (__printf__
, 2, 3)));
112 * Returns the current value of the error counter.
114 extern unsigned int get_error_count(void);
117 * Returns the current value of the warning counter.
119 extern unsigned int get_warning_count(void);
121 /** @} end of error group */
127 #endif /* _ERROR_H */
This page took 0.033188 seconds and 5 git commands to generate.