1/* error.h -- declaration for error-reporting function
2   Copyright (C) 1995 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 2, or (at your option)
7   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#ifndef ERROR_H
15#define ERROR_H
16
17/* Add prototype support.  Normally this is done in cvs.h, but that
18   doesn't get included from lib/savecwd.c.  */
19#ifndef PROTO
20#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
21#define PROTO(ARGS) ARGS
22#else
23#define PROTO(ARGS) ()
24#endif
25#endif
26
27#ifndef __attribute__
28/* This feature is available in gcc versions 2.5 and later.  */
29# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
30#  define __attribute__(Spec) /* empty */
31# endif
32/* The __-protected variants of `format' and `printf' attributes
33   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
34# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
35#  define __format__	format
36#  define __printf__	printf
37#  define __noreturn__	noreturn
38# endif
39#endif
40
41#ifdef __STDC__
42void error (int, int, const char *, ...) \
43  __attribute__ ((__format__ (__printf__, 3, 4)));
44#else
45void error ();
46#endif
47
48/* Exit due to an error.  Similar to error (1, 0, "message"), but call
49   it in the case where the message has already been printed.  */
50#ifdef __STDC__
51void error_exit (void) __attribute__ ((__noreturn__));
52#else
53void error_exit ();
54#endif
55
56/* If non-zero, error will use the CVS protocol to report error
57   messages.  This will only be set in the CVS server parent process;
58   most other code is run via do_cvs_command, which forks off a child
59   process and packages up its stderr in the protocol.  */
60extern int error_use_protocol;
61
62#endif /* ERROR_H */
63