8cb511cb4832d86c9016f5661e766f756c57069d
[platform/upstream/m4.git] / lib / verror.h
1 /* Declaration for va_list error-reporting function
2    Copyright (C) 2006-2007, 2009-2011 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
16
17 #ifndef _VERROR_H
18 #define _VERROR_H 1
19
20 #include "error.h"
21 #include <stdarg.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /* Print a message with `vfprintf (stderr, FORMAT, ARGS)';
28    if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
29    If STATUS is nonzero, terminate the program with `exit (STATUS)'.
30    Use the globals error_print_progname and error_message_count similarly
31    to error().  */
32
33 extern void verror (int __status, int __errnum, const char *__format,
34                     va_list __args)
35      __attribute__ ((__format__ (__printf__, 3, 0)));
36
37 /* Print a message with `vfprintf (stderr, FORMAT, ARGS)';
38    if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
39    If STATUS is nonzero, terminate the program with `exit (STATUS)'.
40    If FNAME is not NULL, prepend the message with `FNAME:LINENO:'.
41    Use the globals error_print_progname, error_message_count, and
42    error_one_per_line similarly to error_at_line().  */
43
44 extern void verror_at_line (int __status, int __errnum, const char *__fname,
45                             unsigned int __lineno, const char *__format,
46                             va_list __args)
47      __attribute__ ((__format__ (__printf__, 5, 0)));
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif /* verror.h */