blob: 4b17577e6e6a395e944045da653cb7c351a5fa31 [file] [log] [blame]
Jari Aalto726f6381996-08-26 18:22:31 +00001/* error.h -- External declarations of functions appearing in error.c. */
2
Jari Aalto31859422009-01-12 13:36:28 +00003/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
Jari Aalto726f6381996-08-26 18:22:31 +00004
5 This file is part of GNU Bash, the Bourne Again SHell.
6
Jari Aalto31859422009-01-12 13:36:28 +00007 Bash is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
Jari Aalto726f6381996-08-26 18:22:31 +000011
Jari Aalto31859422009-01-12 13:36:28 +000012 Bash is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
Jari Aalto726f6381996-08-26 18:22:31 +000016
Jari Aalto31859422009-01-12 13:36:28 +000017 You should have received a copy of the GNU General Public License
18 along with Bash. If not, see <http://www.gnu.org/licenses/>.
19*/
Jari Aalto726f6381996-08-26 18:22:31 +000020
Jari Aaltoccc6cda1996-12-23 17:02:34 +000021#if !defined (_ERROR_H_)
22#define _ERROR_H_
23
24#include "stdc.h"
25
Jari Aalto726f6381996-08-26 18:22:31 +000026/* Get the name of the shell or shell script for an error message. */
Jari Aaltof73dda02001-11-13 17:56:06 +000027extern char *get_name_for_error __P((void));
Jari Aalto726f6381996-08-26 18:22:31 +000028
29/* Report an error having to do with FILENAME. */
Jari Aaltof73dda02001-11-13 17:56:06 +000030extern void file_error __P((const char *));
Jari Aalto726f6381996-08-26 18:22:31 +000031
32/* Report a programmer's error, and abort. Pass REASON, and ARG1 ... ARG5. */
Jari Aaltof73dda02001-11-13 17:56:06 +000033extern void programming_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
Jari Aalto726f6381996-08-26 18:22:31 +000034
35/* General error reporting. Pass FORMAT and ARG1 ... ARG5. */
Jari Aaltof73dda02001-11-13 17:56:06 +000036extern void report_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
Jari Aaltoccc6cda1996-12-23 17:02:34 +000037
38/* Error messages for parts of the parser that don't call report_syntax_error */
Jari Aaltof73dda02001-11-13 17:56:06 +000039extern void parser_error __P((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3)));
Jari Aalto726f6381996-08-26 18:22:31 +000040
41/* Report an unrecoverable error and exit. Pass FORMAT and ARG1 ... ARG5. */
Jari Aaltof73dda02001-11-13 17:56:06 +000042extern void fatal_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
Jari Aaltoccc6cda1996-12-23 17:02:34 +000043
44/* Report a system error, like BSD warn(3). */
Jari Aaltof73dda02001-11-13 17:56:06 +000045extern void sys_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
Jari Aaltoccc6cda1996-12-23 17:02:34 +000046
47/* Report an internal error. */
Jari Aaltof73dda02001-11-13 17:56:06 +000048extern void internal_error __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
Jari Aaltoccc6cda1996-12-23 17:02:34 +000049
Jari Aaltocce855b1998-04-17 19:52:44 +000050/* Report an internal warning. */
Jari Aaltof73dda02001-11-13 17:56:06 +000051extern void internal_warning __P((const char *, ...)) __attribute__((__format__ (printf, 1, 2)));
Jari Aaltocce855b1998-04-17 19:52:44 +000052
Jari Aalto31859422009-01-12 13:36:28 +000053/* Debugging functions, not enabled in released version. */
Chet Rameyac50fba2014-02-26 09:36:43 -050054extern char *strescape __P((const char *));
Jari Aalto7117c2d2002-07-17 14:10:11 +000055extern void itrace __P((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2)));
Jari Aalto31859422009-01-12 13:36:28 +000056extern void trace __P((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2)));
Jari Aalto7117c2d2002-07-17 14:10:11 +000057
Jari Aaltob72432f1999-02-19 17:11:39 +000058/* Report an error having to do with command parsing or execution. */
59extern void command_error __P((const char *, int, int, int));
60
61extern char *command_errstr __P((int));
62
Chet Rameyac50fba2014-02-26 09:36:43 -050063/* Specific error message functions that eventually call report_error or
Jari Aalto7117c2d2002-07-17 14:10:11 +000064 internal_error. */
65
66extern void err_badarraysub __P((const char *));
67extern void err_unboundvar __P((const char *));
68extern void err_readonly __P((const char *));
Jari Aaltof73dda02001-11-13 17:56:06 +000069
Jari Aaltoccc6cda1996-12-23 17:02:34 +000070#endif /* !_ERROR_H_ */