Debian Codegraph @

lib/error.in.h

raw symbols SCIP
1 /* Declarations for error-reporting functions.
2 Copyright (C) 1995-1997, 2003, 2006, 2008-2023 Free Software Foundation,
3 Inc.
4 This file is part of the GNU C Library.
5
6 This file is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation; either version 2.1 of the
9 License, or (at your option) any later version.
10
11 This file is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18
19 #ifndef _ERROR_H
20 #define _ERROR_H 1
21
22 /* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */
23 #include <stdio.h>
24
25 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
26
27 #if GNULIB_VFPRINTF_POSIX
28 # define _GL_ATTRIBUTE_SPEC_PRINTF_ERROR _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD
29 #else
30 # define _GL_ATTRIBUTE_SPEC_PRINTF_ERROR _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM
31 #endif
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /* Print a message with 'fprintf (stderr, FORMAT, ...)';
38 if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
39 If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */
40 #if @REPLACE_ERROR@
41 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
42 # undef error
43 # define error rpl_error
44 # endif
45 _GL_FUNCDECL_RPL (error, void,
46 (int __status, int __errnum, const char *__format, ...)
47 _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4)));
48 _GL_CXXALIAS_RPL (error, void,
49 (int __status, int __errnum, const char *__format, ...));
50 #else
51 # if ! @HAVE_ERROR@
52 _GL_FUNCDECL_SYS (error, void,
53 (int __status, int __errnum, const char *__format, ...)
54 _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 3, 4)));
55 # endif
56 _GL_CXXALIAS_SYS (error, void,
57 (int __status, int __errnum, const char *__format, ...));
58 #endif
59 #if __GLIBC__ >= 2
60 _GL_CXXALIASWARN (error);
61 #endif
62
63 /* Likewise. If FILENAME is non-NULL, include FILENAME:LINENO: in the
64 message. */
65 #if @REPLACE_ERROR_AT_LINE@
66 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
67 # undef error_at_line
68 # define error_at_line rpl_error_at_line
69 # endif
70 _GL_FUNCDECL_RPL (error_at_line, void,
71 (int __status, int __errnum, const char *__filename,
72 unsigned int __lineno, const char *__format, ...)
73 _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5, 6)));
74 _GL_CXXALIAS_RPL (error_at_line, void,
75 (int __status, int __errnum, const char *__filename,
76 unsigned int __lineno, const char *__format, ...));
77 #else
78 # if ! @HAVE_ERROR_AT_LINE@
79 _GL_FUNCDECL_SYS (error_at_line, void,
80 (int __status, int __errnum, const char *__filename,
81 unsigned int __lineno, const char *__format, ...)
82 _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_ERROR, 5, 6)));
83 # endif
84 _GL_CXXALIAS_SYS (error_at_line, void,
85 (int __status, int __errnum, const char *__filename,
86 unsigned int __lineno, const char *__format, ...));
87 #endif
88 _GL_CXXALIASWARN (error_at_line);
89
90 /* If NULL, error will flush stdout, then print on stderr the program
91 name, a colon and a space. Otherwise, error will call this
92 function without parameters instead. */
93 extern void (*error_print_progname) (void);
94
95 /* This variable is incremented each time 'error' is called. */
96 extern unsigned int error_message_count;
97
98 /* Sometimes we want to have at most one error per line. This
99 variable controls whether this mode is selected or not. */
100 extern int error_one_per_line;
101
102 #ifdef __cplusplus
103 }
104 #endif
105
106 #endif /* error.h */