117721Speter/* error.h -- declaration for error-reporting function
217721Speter   Copyright (C) 1995 Software Foundation, Inc.
317721Speter
417721Speter   This program is free software; you can redistribute it and/or modify
517721Speter   it under the terms of the GNU General Public License as published by
617721Speter   the Free Software Foundation; either version 2, or (at your option)
717721Speter   any later version.
817721Speter
917721Speter   This program is distributed in the hope that it will be useful,
1017721Speter   but WITHOUT ANY WARRANTY; without even the implied warranty of
1117721Speter   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1225839Speter   GNU General Public License for more details.  */
1317721Speter
1481404Speter#ifndef ERROR_H
1581404Speter#define ERROR_H
1617721Speter
1725839Speter/* Add prototype support.  Normally this is done in cvs.h, but that
1825839Speter   doesn't get included from lib/savecwd.c.  */
1925839Speter#ifndef PROTO
2025839Speter#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
2125839Speter#define PROTO(ARGS) ARGS
2225839Speter#else
2325839Speter#define PROTO(ARGS) ()
2425839Speter#endif
2525839Speter#endif
2625839Speter
2717721Speter#ifndef __attribute__
2817721Speter/* This feature is available in gcc versions 2.5 and later.  */
2917721Speter# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
3017721Speter#  define __attribute__(Spec) /* empty */
3117721Speter# endif
3217721Speter/* The __-protected variants of `format' and `printf' attributes
3317721Speter   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
3417721Speter# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
35102840Speter#  define __format__	format
36102840Speter#  define __printf__	printf
37102840Speter#  define __noreturn__	noreturn
3817721Speter# endif
3917721Speter#endif
4017721Speter
4125839Speter#ifdef __STDC__
4217721Spetervoid error (int, int, const char *, ...) \
4317721Speter  __attribute__ ((__format__ (__printf__, 3, 4)));
4417721Speter#else
4517721Spetervoid error ();
4617721Speter#endif
4717721Speter
4825839Speter/* Exit due to an error.  Similar to error (1, 0, "message"), but call
4925839Speter   it in the case where the message has already been printed.  */
50102840Speter#ifdef __STDC__
51102840Spetervoid error_exit (void) __attribute__ ((__noreturn__));
52102840Speter#else
53102840Spetervoid error_exit ();
54102840Speter#endif
5525839Speter
5617721Speter/* If non-zero, error will use the CVS protocol to report error
5717721Speter   messages.  This will only be set in the CVS server parent process;
5817721Speter   most other code is run via do_cvs_command, which forks off a child
5917721Speter   process and packages up its stderr in the protocol.  */
6017721Speterextern int error_use_protocol;
6117721Speter
6281404Speter#endif /* ERROR_H */
63