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 ///////////////////////////////////////////////////////////////////////////////
8 #ifndef _langviz_error_H
9 #define _langviz_error_H
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)
25 * Verbosity level (bitmask).
28 * 1: "not supported" messages
35 * Debug bits define the debug level in the interval 0..7; 0 means no
36 * debug messages, 7 means very verbose.
38 extern unsigned verb_level
;
41 * The argv[0] of main, i.e. the programname.
43 extern const char *argv0
;
46 * FATAL_ERROR(const char *fmt, ...) macro prints a formatted error message
47 * to stderr and aborts execution. It calls the fatal_error function with
48 * appropriate file name and line number information
50 #if defined (__GNUC__)
52 * The preprocessors of GCC versions 2.95.3 or earlier do not support the
53 * standard notation for varadic macros in C++ mode.
54 * Therefore this proprietary notation is used with GCC.
56 #define FATAL_ERROR(fmt, args...) \
57 (fatal_error(__FILE__, __LINE__, fmt, ## args))
60 * This is the standard notation.
62 #define FATAL_ERROR(...) \
63 (fatal_error(__FILE__, __LINE__, __VA_ARGS__))
67 * fatal_error function, which is not supposed to be called directly.
69 extern void fatal_error(const char *filename
, int lineno
, const char *fmt
, ...)
70 __attribute__ ((__format__ (__printf__
, 3, 4), __noreturn__
));
73 * Prints a formatted error message to stderr.
75 extern void ERROR(const char *fmt
, ...)
76 __attribute__ ((__format__ (__printf__
, 1, 2)));
79 * Prints a formatted warning message to stderr.
81 extern void WARNING(const char *fmt
, ...)
82 __attribute__ ((__format__ (__printf__
, 1, 2)));
85 * Prints a formatted warning message to stderr: "Warning: Not supported: %s".
87 extern void NOTSUPP(const char *fmt
, ...)
88 __attribute__ ((__format__ (__printf__
, 1, 2)));
91 * Prints a formatted notify message to stderr.
93 extern void NOTIFY(const char *fmt
, ...)
94 __attribute__ ((__format__ (__printf__
, 1, 2)));
97 * Prints a formatted debug message to stderr.
99 extern void DEBUG(unsigned level
, const char *fmt
, ...)
100 __attribute__ ((__format__ (__printf__
, 2, 3)));
107 #endif // _langviz_error_H
This page took 0.03962 seconds and 5 git commands to generate.