1 /******************************************************************************
2 * Copyright (c) 2000-2016 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
12 ******************************************************************************/
13 #ifndef _langviz_error_H
14 #define _langviz_error_H
17 /** If a C compiler other than GCC is used the macro below will substitute all
18 * GCC-specific non-standard attributes with an empty string. */
20 #define __attribute__(arg)
30 * Verbosity level (bitmask).
33 * 1: "not supported" messages
40 * Debug bits define the debug level in the interval 0..7; 0 means no
41 * debug messages, 7 means very verbose.
43 extern unsigned verb_level
;
46 * The argv[0] of main, i.e. the programname.
48 extern const char *argv0
;
51 * FATAL_ERROR(const char *fmt, ...) macro prints a formatted error message
52 * to stderr and aborts execution. It calls the fatal_error function with
53 * appropriate file name and line number information
55 #if defined (__GNUC__)
57 * The preprocessors of GCC versions 2.95.3 or earlier do not support the
58 * standard notation for varadic macros in C++ mode.
59 * Therefore this proprietary notation is used with GCC.
61 #define FATAL_ERROR(fmt, args...) \
62 (fatal_error(__FILE__, __LINE__, fmt, ## args))
65 * This is the standard notation.
67 #define FATAL_ERROR(...) \
68 (fatal_error(__FILE__, __LINE__, __VA_ARGS__))
72 * fatal_error function, which is not supposed to be called directly.
74 extern void fatal_error(const char *filename
, int lineno
, const char *fmt
, ...)
75 __attribute__ ((__format__ (__printf__
, 3, 4), __noreturn__
));
78 * Prints a formatted error message to stderr.
80 extern void ERROR(const char *fmt
, ...)
81 __attribute__ ((__format__ (__printf__
, 1, 2)));
84 * Prints a formatted warning message to stderr.
86 extern void WARNING(const char *fmt
, ...)
87 __attribute__ ((__format__ (__printf__
, 1, 2)));
90 * Prints a formatted warning message to stderr: "Warning: Not supported: %s".
92 extern void NOTSUPP(const char *fmt
, ...)
93 __attribute__ ((__format__ (__printf__
, 1, 2)));
96 * Prints a formatted notify message to stderr.
98 extern void NOTIFY(const char *fmt
, ...)
99 __attribute__ ((__format__ (__printf__
, 1, 2)));
102 * Prints a formatted debug message to stderr.
104 extern void DEBUG(unsigned level
, const char *fmt
, ...)
105 __attribute__ ((__format__ (__printf__
, 2, 3)));
112 #endif // _langviz_error_H
This page took 0.038847 seconds and 5 git commands to generate.