Imported Upstream version 2.5.1
[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.11 2006/05/25 01:47:11 johnfranks 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 /*
65  * So that we can use GNUC attributes (such as to get -Wall warnings
66  * for printf-like functions).  Only do this in gcc 2.7 or later ...
67  * it may work on earlier stuff, but why chance it.
68  */
69 #if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 7
70 #define __attribute__(__x)
71 #endif
72
73 #ifndef HAVE_BCOPY_DECL
74 extern void bcopy(const void *from, void *to, size_t n);
75 #endif
76
77 #ifndef HAVE_MEMMOVE_DECL
78 extern char *memmove(char *to, char *from, size_t n);
79 #endif
80
81 #ifndef HAVE_MEMSET_DECL
82 extern void *memset(void *s, int c, size_t n);
83 #endif
84
85 #if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
86 #define USEBCOPY
87 #endif
88
89 #ifndef HAVE_SNPRINTF_DECL
90 #include "arglist.h"
91 int snprintf (char *buf, size_t len, const char *format,...)
92                     __attribute__((format(printf,3,4)));
93 #endif
94 #ifndef HAVE_VSNPRINTF_DECL
95 #include "arglist.h"
96 int vsnprintf(char *buf, size_t len, const char *format, va_list ap);
97 #endif
98
99 #define POSIX_MISTAKE
100
101 #ifdef HAVE_UNSIGNED_LONG_CONSTANTS
102 #undef NO_UL_CNSTS
103 #else
104 #define NO_UL_CNSTS
105 #endif
106
107 #endif /* AMREGEX_H */