f606ea2469ad803ab6fbcb97e34e0a2a4f4e9702
[debian/amanda] / common-src / amregex.h
1 /*
2  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3  * Copyright (c) 1991-1998 University of Maryland at College Park
4  * All Rights Reserved.
5  *
6  * Permission to use, copy, modify, distribute, and sell this software and its
7  * documentation for any purpose is hereby granted without fee, provided that
8  * the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation, and that the name of U.M. not be used in advertising or
11  * publicity pertaining to distribution of the software without specific,
12  * written prior permission.  U.M. makes no representations about the
13  * suitability of this software for any purpose.  It is provided "as is"
14  * without express or implied warranty.
15  *
16  * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  *
23  * Authors: the Amanda Development Team.  Its members are listed in a
24  * file named AUTHORS, in the root directory of this distribution.
25  */
26 /*
27  * $Id: amregex.h,v 1.9 1998/07/04 00:18:36 oliva Exp $
28  *
29  * compatibility header file for Henry Spencer's regex library.
30  */
31 #ifndef AMREGEX_H
32 #define AMREGEX_H
33
34 #ifdef HAVE_CONFIG_H
35 #include "config.h"
36 #endif
37
38 #ifdef HAVE_SYS_TYPES_H
39 #include <sys/types.h>
40 #endif
41
42 #ifdef HAVE_STRINGS_H
43 #include <strings.h>
44 #endif
45
46 #include <limits.h>
47
48 #ifndef HAVE__POSIX2_RE_DUP_MAX
49 #define _POSIX2_RE_DUP_MAX 255
50 #endif
51
52 #ifndef HAVE_CHAR_MIN
53 #define CHAR_MIN (-128)
54 #endif
55
56 #ifndef HAVE_CHAR_MAX
57 #define CHAR_MAX 127
58 #endif
59
60 #ifndef HAVE_CHAR_BIT
61 #define CHAR_BIT 8
62 #endif
63
64 #if STDC_HEADERS
65 #  define P(parms)      parms
66 #else
67 #  define P(parms)      ()
68 #endif
69
70 /*
71  * So that we can use GNUC attributes (such as to get -Wall warnings
72  * for printf-like functions).  Only do this in gcc 2.7 or later ...
73  * it may work on earlier stuff, but why chance it.
74  */
75 #if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 7
76 #define __attribute__(__x)
77 #endif
78
79 #ifndef HAVE_BCOPY_DECL
80 extern void bcopy P((const void *from, void *to, size_t n));
81 #endif
82
83 #ifndef HAVE_MEMMOVE_DECL
84 extern char *memmove P((char *to, char *from, size_t n));
85 #endif
86
87 #ifndef HAVE_MEMSET_DECL
88 extern void *memset P((void *s, int c, size_t n));
89 #endif
90
91 #if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
92 #define USEBCOPY
93 #endif
94
95 #if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF)
96 #define ap_snprintf     snprintf
97 #define ap_vsnprintf    vsnprintf
98 #endif
99 #ifndef HAVE_SNPRINTF_DECL
100 #include "arglist.h"
101 int ap_snprintf  P((char *buf, size_t len, const char *format,...))
102                     __attribute__((format(printf,3,4)));
103 #endif
104 #ifndef HAVE_VSNPRINTF_DECL
105 #include "arglist.h"
106 int ap_vsnprintf P((char *buf, size_t len, const char *format, va_list ap));
107 #endif
108
109 #define POSIX_MISTAKE
110
111 #ifdef HAVE_UNSIGNED_LONG_CONSTANTS
112 #undef NO_UL_CNSTS
113 #else
114 #define NO_UL_CNSTS
115 #endif
116
117 #endif /* AMREGEX_H */