xref: /openbsd/gnu/usr.bin/cvs/src/error.h (revision 43c1707e)
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 # endif
38 #endif
39 
40 #ifdef __STDC__
41 void error (int, int, const char *, ...) \
42   __attribute__ ((__format__ (__printf__, 3, 4)));
43 #else
44 void error ();
45 #endif
46 
47 /* Exit due to an error.  Similar to error (1, 0, "message"), but call
48    it in the case where the message has already been printed.  */
49 extern void error_exit PROTO ((void));
50 
51 /* If non-zero, error will use the CVS protocol to report error
52    messages.  This will only be set in the CVS server parent process;
53    most other code is run via do_cvs_command, which forks off a child
54    process and packages up its stderr in the protocol.  */
55 extern int error_use_protocol;
56 
57 #endif /* ERROR_H */
58