diff options
Diffstat (limited to 'pkgtools/libnbcompat/files/nbcompat')
18 files changed, 620 insertions, 176 deletions
diff --git a/pkgtools/libnbcompat/files/nbcompat/assert.h b/pkgtools/libnbcompat/files/nbcompat/assert.h new file mode 100644 index 00000000000..736e0563982 --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/assert.h @@ -0,0 +1,54 @@ +/* $NetBSD: assert.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Johnny C. Lam. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NBCOMPAT_ASSERT_H_ +#define _NBCOMPAT_ASSERT_H_ + +#if HAVE_ASSERT_H +# include <assert.h> +#endif + +/* + * Declare macros and functions that may be missing in <assert.h>. + */ + +#ifndef _DIAGASSERT +#define _DIAGASSERT(cond) assert(cond) +#endif + +#endif /* !_NBCOMPAT_ASSERT_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/cdefs.h b/pkgtools/libnbcompat/files/nbcompat/cdefs.h new file mode 100644 index 00000000000..0149af8667d --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/cdefs.h @@ -0,0 +1,95 @@ +/* $NetBSD: cdefs.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Johnny C. Lam. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NBCOMPAT_SYS_CDEFS_H_ +#define _NBCOMPAT_SYS_CDEFS_H_ + +#if HAVE_SYS_CDEFS_H +# include <sys/cdefs.h> +#endif + +/* + * Declare macros and functions that may be missing in <sys/cdefs.h>. + */ + +#ifndef __IDSTRING +# define __IDSTRING(name,string) \ + static const char name[] __attribute__((__unused__)) = string +#endif + +#ifndef __COPYRIGHT +# define __COPYRIGHT(_s) __IDSTRING(copyright,_s) +#endif + +#ifndef __RCSID +# define __RCSID(_s) __IDSTRING(rcsid,_s) +#endif + +#ifndef __P +# if defined(__STDC__) || defined(__cplusplus) +# define __P(protos) protos /* full-blown ANSI C */ +# else +# define __P(protos) () /* traditional C preprocessor */ +# endif +#endif + +#ifndef __CONCAT +# if defined(__STDC__) || defined(__cplusplus) +# define __CONCAT(x,y) x ## y +# else +# define __CONCAT(x,y) x/**/y +# endif +#endif + +#ifndef __BEGIN_DECLS +# if defined(__cplusplus) +# define __BEGIN_DECLS extern "C" { +# else +# define __BEGIN_DECLS +# endif +#endif + +#ifndef __END_DECLS +# if defined(__cplusplus) +# define __END_DECLS }; +# else +# define __END_DECLS +# endif +#endif + +#endif /* !_NBCOMPAT_SYS_CDEFS_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/config.h.in b/pkgtools/libnbcompat/files/nbcompat/config.h.in index 5904fbc6d8e..e60ebfe97e3 100644 --- a/pkgtools/libnbcompat/files/nbcompat/config.h.in +++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in @@ -3,6 +3,9 @@ /* Define to 1 if the `getpgrp' function requires zero arguments. */ #undef GETPGRP_VOID +/* Define to 1 if you have the <alloca.h> header file. */ +#undef HAVE_ALLOCA_H + /* Define to 1 if you have the <assert.h> header file. */ #undef HAVE_ASSERT_H @@ -15,6 +18,17 @@ /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO +/* Define to 1 if you have the <ctype.h> header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the declaration of `optind', and to 0 if you don't. + */ +#undef HAVE_DECL_OPTIND + +/* Define to 1 if you have the declaration of `optreset', and to 0 if you + don't. */ +#undef HAVE_DECL_OPTRESET + /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R @@ -191,18 +205,9 @@ /* Define to 1 if you have the <netinet/in6_machtypes.h> header file. */ #undef HAVE_NETINET_IN6_MACHTYPES_H -/* Define to 1 if optarg is declared in <stdlib.h> or <unistd.h> */ -#undef HAVE_OPTARG_D - -/* Define to 1 if optind is declared in <stdlib.h> or <unistd.h> */ -#undef HAVE_OPTIND_D - /* Define to 1 if you have the <paths.h> header file. */ #undef HAVE_PATHS_H -/* Define to 1 if you have the `poll' function. */ -#undef HAVE_POLL - /* Define to 1 if you have the <poll.h> header file. */ #undef HAVE_POLL_H @@ -249,12 +254,21 @@ /* Define to 1 if you have the <sha1.h> header file. */ #undef HAVE_SHA1_H +/* Define to 1 if you have the <signal.h> header file. */ +#undef HAVE_SIGNAL_H + /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `statvfs' function. */ #undef HAVE_STATVFS +/* Define to 1 if you have the <stdarg.h> header file. */ +#undef HAVE_STDARG_H + +/* Define to 1 if you have the <stddef.h> header file. */ +#undef HAVE_STDDEF_H + /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H @@ -273,9 +287,6 @@ /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R -/* Define to 1 if you have the <stringlist.h> header file. */ -#undef HAVE_STRINGLIST_H - /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H @@ -300,6 +311,9 @@ /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL +/* Define to 1 if `d_namlen' is member of `struct dirent'. */ +#undef HAVE_STRUCT_DIRENT_D_NAMLEN + /* Define to 1 if `f_fsize' is member of `struct statfs'. */ #undef HAVE_STRUCT_STATFS_F_FSIZE @@ -312,6 +326,9 @@ /* Define to 1 if you have the `strvis' function. */ #undef HAVE_STRVIS +/* Define to 1 if you have the `svis' function. */ +#undef HAVE_SVIS + /* Define to 1 if you have the <sys/bitypes.h> header file. */ #undef HAVE_SYS_BITYPES_H @@ -366,15 +383,15 @@ /* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the <sys/uio.h> header file. */ +#undef HAVE_SYS_UIO_H + /* Define to 1 if you have the <sys/vfs.h> header file. */ #undef HAVE_SYS_VFS_H /* Define to 1 if you have the <termcap.h> header file. */ #undef HAVE_TERMCAP_H -/* Define to 1 if you have the <termios.h> header file. */ -#undef HAVE_TERMIOS_H - /* Define to 1 if you have the <time.h> header file. */ #undef HAVE_TIME_H @@ -402,6 +419,9 @@ /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV +/* Define to 1 if you have the `unvis' function. */ +#undef HAVE_UNVIS + /* Define to 1 if you have the `user_from_uid' function. */ #undef HAVE_USER_FROM_UID @@ -414,8 +434,8 @@ /* Define to 1 if you have the `utimes' function. */ #undef HAVE_UTIMES -/* Define to 1 if you have the <utmp.h> header file. */ -#undef HAVE_UTMP_H +/* Define to 1 if you have the <utime.h> header file. */ +#undef HAVE_UTIME_H /* Define to 1 if the system has the type `u_int16_t'. */ #undef HAVE_U_INT16_T @@ -429,12 +449,18 @@ /* Define to 1 if the system has the type `u_int8_t'. */ #undef HAVE_U_INT8_T +/* Define to 1 if you have the `vis' function. */ +#undef HAVE_VIS + /* Define to 1 if you have the <vis.h> header file. */ #undef HAVE_VIS_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF +/* Define to 1 if you have the `warn' function. */ +#undef HAVE_WARN + /* Define to 1 if `long long' is supported and sizeof(off_t) >= 8. */ #undef HAVE_WORKING_LONG_LONG @@ -485,112 +511,3 @@ # define __attribute__(x) #endif -#if HAVE_SYS_CDEFS_H -#include <sys/cdefs.h> -#endif - -#ifndef __IDSTRING -# define __IDSTRING(name,string) \ - static const char name[] __attribute__((__unused__)) = string -#endif - -#ifndef __RCSID -# define __RCSID(_s) __IDSTRING(rcsid,_s) -#endif - -#ifndef __COPYRIGHT -# define __COPYRIGHT(_s) __IDSTRING(copyright,_s) -#endif - -#ifndef __P -# if defined(__STDC__) || defined(__cplusplus) -# define __P(protos) protos /* full-blown ANSI C */ -# else -# define __P(protos) () /* traditional C preprocessor */ -# endif -#endif - -#ifndef __CONCAT -# if defined(__STDC__) || defined(__cplusplus) -# define __CONCAT(x,y) x ## y -# else -# define __CONCAT(x,y) x/**/y -# endif -#endif - -#ifndef __BEGIN_DECLS -# if defined(__cplusplus) -# define __BEGIN_DECLS extern "C" { -# else -# define __BEGIN_DECLS -# endif -#endif - -#ifndef __END_DECLS -# if defined(__cplusplus) -# define __END_DECLS }; -# else -# define __END_DECLS -# endif -#endif - -#if HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif - -#if HAVE_SYS_ENDIAN_H -#include <sys/endian.h> -#endif - -#if HAVE_MACHINE_ENDIAN_H -#include <machine/endian.h> -#endif - -#if HAVE_SYS_BYTEORDER_H -#include <sys/byteorder.h> -#endif - -#if HAVE_LIMITS_H -#include <limits.h> -#endif - -#ifndef LITTLE_ENDIAN -# define LITTLE_ENDIAN 1234 -#endif - -#ifndef BIG_ENDIAN -# define BIG_ENDIAN 4321 -#endif - -#ifndef UINT_MAX -# define UINT_MAX 4294967295U -#endif - -#ifndef BYTE_ORDER -# if defined(_BIG_ENDIAN) -# define BYTE_ORDER BIG_ENDIAN -# elif defined(_LITTE_ENDIAN) -# define BYTE_ORDER LITTLE_ENDIAN -# elif defined(WORDS_BIGENDIAN) -# define BYTE_ORDER BIG_ENDIAN -# else -# define BYTE_ORDER LITTLE_ENDIAN -# endif -#endif - -#if defined(HAVE_MEMSET) -# define MEMSET_BZERO(p,l) memset((p), 0, (l)) -#elif defined(HAVE_BZERO) -# define MEMSET_BZERO(p,l) bzero((p), (l)) -#else -# error You need either memset or bzero -#endif - -#if defined(HAVE_MEMCPY) -# define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) -#elif defined(HAVE_BCOPY) -# define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) -#else -# error You need either memcpy or bcopy -#endif - diff --git a/pkgtools/libnbcompat/files/nbcompat/ctype.h b/pkgtools/libnbcompat/files/nbcompat/ctype.h new file mode 100644 index 00000000000..a90bbdc36a4 --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/ctype.h @@ -0,0 +1,54 @@ +/* $NetBSD: ctype.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Johnny C. Lam. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NBCOMPAT_CTYPE_H_ +#define _NBCOMPAT_CTYPE_H_ + +#if HAVE_CTYPE_H +# include <ctype.h> +#endif + +/* + * Declare macros and functions that may be missing in <ctype.h>. + */ + +#if !HAVE_ISBLANK +int isblank(int); +#endif + +#endif /* !_NBCOMPAT_CTYPE_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/dirent.h b/pkgtools/libnbcompat/files/nbcompat/dirent.h new file mode 100644 index 00000000000..b23adfc60ec --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/dirent.h @@ -0,0 +1,65 @@ +/* $NetBSD: dirent.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Johnny C. Lam. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NBCOMPAT_DIRENT_H_ +#define _NBCOMPAT_DIRENT_H_ + +#if HAVE_DIRENT_H +# include <dirent.h> +#else +# define dirent direct +# if HAVE_SYS_NDIR_H +# include <sys/ndir.h> +# endif +# if HAVE_SYS_DIR_H +# include <sys/dir.h> +# endif +# if HAVE_NDIR_H +# include <ndir.h> +# endif +#endif + +/* + * Declare functions and macros that may be missing in <dirent.h>. + */ + +#ifndef dirfd +#define dirfd(dirp) ((dirp)->dd_fd) +#endif + +#endif /* !_NBCOMPAT_DIRENT_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/endian.h b/pkgtools/libnbcompat/files/nbcompat/endian.h new file mode 100644 index 00000000000..2a6a475552d --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/endian.h @@ -0,0 +1,79 @@ +/* $NetBSD: endian.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Johnny C. Lam. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NBCOMPAT_ENDIAN_H_ +#define _NBCOMPAT_ENDIAN_H_ + +#if HAVE_SYS_ENDIAN_H +# include <sys/endian.h> +#endif + +#if HAVE_MACHINE_ENDIAN_H +# include <machine/endian.h> +#endif + +#if HAVE_SYS_BYTEORDER_H +# include <sys/byteorder.h> +#endif + +/* + * Declare macros that may be missing in <sys/endian.h>, <machine/endian.h>, + * and <sys/byteorder.h> + */ + +#ifndef LITTLE_ENDIAN +# define LITTLE_ENDIAN 1234 +#endif + +#ifndef BIG_ENDIAN +# define BIG_ENDIAN 4321 +#endif + +#ifndef BYTE_ORDER +# if defined(_BIG_ENDIAN) +# define BYTE_ORDER BIG_ENDIAN +# elif defined(_LITTE_ENDIAN) +# define BYTE_ORDER LITTLE_ENDIAN +# elif defined(WORDS_BIGENDIAN) +# define BYTE_ORDER BIG_ENDIAN +# else +# define BYTE_ORDER LITTLE_ENDIAN +# endif +#endif + +#endif /* !_NBCOMPAT_ENDIAN_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/err.h b/pkgtools/libnbcompat/files/nbcompat/err.h index 5aac0839b9c..eb7f0a06bf0 100644 --- a/pkgtools/libnbcompat/files/nbcompat/err.h +++ b/pkgtools/libnbcompat/files/nbcompat/err.h @@ -1,4 +1,4 @@ -/* $NetBSD: err.h,v 1.3 2004/08/16 17:24:57 jlam Exp $ */ +/* $NetBSD: err.h,v 1.4 2004/08/23 03:32:13 jlam Exp $ */ /* * Copyright (c) 1989, 1993 @@ -38,15 +38,22 @@ #ifndef _NBCOMPAT_ERR_H_ #define _NBCOMPAT_ERR_H_ +#if HAVE_ERR_H +# include <err.h> +#endif + #if !HAVE_ERR -void err(int, const char *, ...); -void errx(int, const char *, ...); -void verr(int, const char *, va_list); -void verrx(int, const char *, va_list); -void warn(const char *, ...); -void warnx(const char *, ...); -void vwarn(const char *, va_list); -void vwarnx(const char *, va_list); +void err __P((int, const char *, ...)); +void errx __P((int, const char *, ...)); +void verr __P((int, const char *, va_list)); +void verrx __P((int, const char *, va_list)); +#endif + +#if !HAVE_WARN +void warn __P((const char *, ...)); +void warnx __P((const char *, ...)); +void vwarn __P((const char *, va_list)); +void vwarnx __P((const char *, va_list)); #endif #endif /* !_NBCOMPAT_ERR_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/getopt.h b/pkgtools/libnbcompat/files/nbcompat/getopt.h index 04ed5a6cb76..8af7a9c3896 100644 --- a/pkgtools/libnbcompat/files/nbcompat/getopt.h +++ b/pkgtools/libnbcompat/files/nbcompat/getopt.h @@ -1,4 +1,4 @@ -/* $NetBSD: getopt.h,v 1.3 2004/08/16 17:24:57 jlam Exp $ */ +/* $NetBSD: getopt.h,v 1.4 2004/08/23 03:32:13 jlam Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -39,13 +39,8 @@ #ifndef _NBCOMPAT_GETOPT_H_ #define _NBCOMPAT_GETOPT_H_ -#if HAVE_SYS_CDEFS_H -#include <sys/cdefs.h> -#endif - -#if HAVE_UNISTD_H -#include <unistd.h> -#endif +#include <nbcompat/cdefs.h> +#include <nbcompat/unistd.h> /* * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions diff --git a/pkgtools/libnbcompat/files/nbcompat/limits.h b/pkgtools/libnbcompat/files/nbcompat/limits.h index 51a30f6e1a0..1f060ad90bf 100644 --- a/pkgtools/libnbcompat/files/nbcompat/limits.h +++ b/pkgtools/libnbcompat/files/nbcompat/limits.h @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */ +/* $NetBSD: limits.h,v 1.2 2004/08/23 03:32:13 jlam Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -47,6 +47,10 @@ * Declare functions and macros that may be missing in <limits.h>. */ +#ifndef UINT_MAX +# define UINT_MAX 4294967295U +#endif + #if !defined(LLONG_MAX) # if defined(LONG_LONG_MAX) # define LLONG_MAX LONG_LONG_MAX diff --git a/pkgtools/libnbcompat/files/nbcompat/param.h b/pkgtools/libnbcompat/files/nbcompat/param.h new file mode 100644 index 00000000000..e46c221645b --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/param.h @@ -0,0 +1,57 @@ +/* $NetBSD: param.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Johnny C. Lam. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NBCOMPAT_SYS_PARAM_H_ +#define _NBCOMPAT_SYS_PARAM_H_ + +#if HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif + +/* + * Declare macros and functions that may be missing in <sys/param.h>. + */ + +#if !defined(MIN) +# define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif +#if !defined(MAX) +# define MAX(a, b) ((a) < (b) ? (b) : (a)) +#endif + +#endif /* !_NBCOMPAT_SYS_PARAM_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/regex.h b/pkgtools/libnbcompat/files/nbcompat/regex.h index c4d5cc3fb2f..ed63c0e327e 100644 --- a/pkgtools/libnbcompat/files/nbcompat/regex.h +++ b/pkgtools/libnbcompat/files/nbcompat/regex.h @@ -1,4 +1,4 @@ -/* $NetBSD: regex.h,v 1.1 2004/08/16 17:24:57 jlam Exp $ */ +/* $NetBSD: regex.h,v 1.2 2004/08/23 03:32:13 jlam Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -74,12 +74,8 @@ #ifndef _NBCOMPAT_REGEX_H_ #define _NBCOMPAT_REGEX_H_ -#if HAVE_SYS_CDEFS_H -#include <sys/cdefs.h> -#endif -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif +#include <nbcompat/cdefs.h> +#include <nbcompat/types.h> /* types */ #if 1 /* __LIBC12_SOURCE__ - should go away */ diff --git a/pkgtools/libnbcompat/files/nbcompat/stat.h b/pkgtools/libnbcompat/files/nbcompat/stat.h index 97f2bf07071..20c2999369a 100644 --- a/pkgtools/libnbcompat/files/nbcompat/stat.h +++ b/pkgtools/libnbcompat/files/nbcompat/stat.h @@ -1,4 +1,4 @@ -/* $NetBSD: stat.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */ +/* $NetBSD: stat.h,v 1.2 2004/08/23 03:32:13 jlam Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -63,4 +63,8 @@ int lchmod(const char *, mode_t); # define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) #endif +#if !defined(DEFFILEMODE) +# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) +#endif + #endif /* !_NBCOMPAT_STAT_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/statvfs.h b/pkgtools/libnbcompat/files/nbcompat/statvfs.h index 0dbc17af20a..6561b06a9f0 100644 --- a/pkgtools/libnbcompat/files/nbcompat/statvfs.h +++ b/pkgtools/libnbcompat/files/nbcompat/statvfs.h @@ -1,4 +1,4 @@ -/* $NetBSD: statvfs.h,v 1.2 2004/08/10 18:47:55 jlam Exp $ */ +/* $NetBSD: statvfs.h,v 1.3 2004/08/23 03:32:13 jlam Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -45,13 +45,8 @@ #if !HAVE_STATVFS -#if HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -#if HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif +#include <nbcompat/types.h> +#include <nbcompat/param.h> #if HAVE_SYS_MOUNT_H #include <sys/mount.h> diff --git a/pkgtools/libnbcompat/files/nbcompat/stdlib.h b/pkgtools/libnbcompat/files/nbcompat/stdlib.h index d57623bc430..52da70c2a3e 100644 --- a/pkgtools/libnbcompat/files/nbcompat/stdlib.h +++ b/pkgtools/libnbcompat/files/nbcompat/stdlib.h @@ -1,4 +1,4 @@ -/* $NetBSD: stdlib.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */ +/* $NetBSD: stdlib.h,v 1.2 2004/08/23 03:32:13 jlam Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -42,9 +42,13 @@ #if HAVE_STDLIB_H # include <stdlib.h> #endif +#if HAVE_ALLOCA_H +# include <alloca.h> +#endif /* - * Declare functions and macros that may be missing in <stdlib.h>. + * Declare functions and macros that may be missing in <stdlib.h> and + * <alloca.h>. */ #if !HAVE_MKSTEMP diff --git a/pkgtools/libnbcompat/files/nbcompat/termcap.h b/pkgtools/libnbcompat/files/nbcompat/termcap.h new file mode 100644 index 00000000000..11bf60bc853 --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/termcap.h @@ -0,0 +1,59 @@ +/* $NetBSD: termcap.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Johnny C. Lam. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NBCOMPAT_TERMCAP_H_ +#define _NBCOMPAT_TERMCAP_H_ + +#if HAVE_TERMCAP_H +# include <termcap.h> +#endif + +/* + * Declare macros and functions that may be missing in <termcap.h>. + */ + +#if !HAVE_TERMCAP_H +int tgetent __P((char *, const char *)); +char *tgetstr __P((const char *, char **)); +int tgetflag __P((const char *)); +int tgetnum __P((const char *)); +char *tgoto __P((const char *, int, int)); +void tputs __P((const char *, int, int (*)(int))); +#endif + +#endif /* !_NBCOMPAT_TERMCAP_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/types.h b/pkgtools/libnbcompat/files/nbcompat/types.h new file mode 100644 index 00000000000..6121bab11ca --- /dev/null +++ b/pkgtools/libnbcompat/files/nbcompat/types.h @@ -0,0 +1,59 @@ +/* $NetBSD: types.h,v 1.1 2004/08/23 03:32:13 jlam Exp $ */ + +/*- + * Copyright (c) 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Johnny C. Lam. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _NBCOMPAT_SYS_TYPES_H_ +#define _NBCOMPAT_SYS_TYPES_H_ + +#if HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif + +/* + * Declare macros and functions that may be missing in <sys/types.h>. + */ + +#if !defined(makedev) +# if HAVE_SYS_MKDEV_H +# include <sys/mkdev.h> +# if defined(mkdev) +# define makedev mkdev +# endif +# endif +#endif + +#endif /* !_NBCOMPAT_SYS_TYPES_H_ */ diff --git a/pkgtools/libnbcompat/files/nbcompat/unistd.h b/pkgtools/libnbcompat/files/nbcompat/unistd.h index 288120febb7..653722c75af 100644 --- a/pkgtools/libnbcompat/files/nbcompat/unistd.h +++ b/pkgtools/libnbcompat/files/nbcompat/unistd.h @@ -1,4 +1,4 @@ -/* $NetBSD: unistd.h,v 1.1 2004/08/10 18:47:55 jlam Exp $ */ +/* $NetBSD: unistd.h,v 1.2 2004/08/23 03:32:13 jlam Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -59,6 +59,15 @@ extern int optind; char *getpass(const char *); #endif +/* + * If getpassphrase() exists, then use it in place of getpass(). + */ +#if HAVE_GETPASSPHRASE +# ifndef getpass +# define getpass getpassphrase +# endif +#endif + #if !HAVE_LCHOWN int lchown(const char *, uid_t, gid_t); #endif diff --git a/pkgtools/libnbcompat/files/nbcompat/vis.h b/pkgtools/libnbcompat/files/nbcompat/vis.h index 04614595e33..2361de40098 100644 --- a/pkgtools/libnbcompat/files/nbcompat/vis.h +++ b/pkgtools/libnbcompat/files/nbcompat/vis.h @@ -1,4 +1,4 @@ -/* $NetBSD: vis.h,v 1.2 2004/08/16 17:24:57 jlam Exp $ */ +/* $NetBSD: vis.h,v 1.3 2004/08/23 03:32:13 jlam Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,6 +38,8 @@ #ifndef _NBCOMPAT_VIS_H_ #define _NBCOMPAT_VIS_H_ +#include <nbcompat/types.h> + /* * to select alternate encoding format */ @@ -74,18 +76,7 @@ */ #define UNVIS_END 1 /* no more characters */ -#ifndef _DIAGASSERT -#define _DIAGASSERT(e) -#endif - -#if HAVE_SYS_CDEFS_H -#include <sys/cdefs.h> -#endif - -#ifndef __BEGIN_DECLS -#define __BEGIN_DECLS -#define __END_DECLS -#endif +#include <nbcompat/cdefs.h> __BEGIN_DECLS char *vis (char *, int, int, int); |