merge conflicts, new reach-over Makefiles

This commit is contained in:
christos 2016-01-13 03:39:27 +00:00
parent 75f6d617e2
commit f8c23a2b94
19 changed files with 845 additions and 32 deletions

7
external/gpl2/diffutils/Makefile vendored Normal file
View File

@ -0,0 +1,7 @@
# $NetBSD: Makefile,v 1.1 2016/01/13 03:39:27 christos Exp $
# We don't use GNU cmp and GNU sdiff, but have our own
SUBDIR= lib .WAIT bin
.include <bsd.subdir.mk>

8
external/gpl2/diffutils/Makefile.inc vendored Normal file
View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile.inc,v 1.1 2016/01/13 03:39:28 christos Exp $
WARNS= 0
IDIST= ${NETBSDSRCDIR}/external/gpl2/diffutils/dist
CPPFLAGS+= -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H \
-I${IDIST}/../include -I${IDIST}/lib

7
external/gpl2/diffutils/bin/Makefile vendored Normal file
View File

@ -0,0 +1,7 @@
# $NetBSD: Makefile,v 1.1 2016/01/13 03:39:28 christos Exp $
# We don't use GNU cmp and GNU sdiff, but have our own
SUBDIR= diff diff3 # sdiff cmp
.include <bsd.subdir.mk>

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile.inc,v 1.1 2016/01/13 03:39:28 christos Exp $
.include "${.PARSEDIR}/../Makefile.inc"
PROGDPLIBS+= diffutils ${.CURDIR}/../../lib
BINDIR=/usr/bin

View File

@ -0,0 +1,11 @@
# $NetBSD: Makefile,v 1.1 2016/01/13 03:39:28 christos Exp $
.include <bsd.init.mk>
DIST= ${IDIST}/src
.PATH: ${DIST} ${IDIST}/man
PROG= cmp
SRCS= cmp.c version.c
.include <bsd.prog.mk>

View File

@ -0,0 +1,20 @@
# $NetBSD: Makefile,v 1.1 2016/01/13 03:39:28 christos Exp $
.include <bsd.init.mk>
DIST= ${IDIST}/src
.PATH: ${DIST} ${IDIST}/doc ${IDIST}/man
PROG= diff
SRCS= analyze.c context.c diff.c dir.c ed.c ifdef.c io.c \
normal.c side.c util.c version.c
INFOFLAGS= -I${IDIST}/doc
TEXINFO= diff.texi
COPTS.ifdef.c = -Wno-stack-protector
CWARNFLAGS.clang+= -Wno-unused-value -Wno-string-plus-int
.include <bsd.info.mk>
.include <bsd.prog.mk>

View File

@ -0,0 +1,13 @@
# $NetBSD: Makefile,v 1.1 2016/01/13 03:39:28 christos Exp $
.include <bsd.init.mk>
DIST= ${IDIST}/src
.PATH: ${DIST} ${IDIST}/man
PROG= diff3
SRCS= diff3.c version.c
CWARNFLAGS.clang+= -Wno-unused-value
.include <bsd.prog.mk>

View File

@ -0,0 +1,11 @@
# $NetBSD: Makefile,v 1.1 2016/01/13 03:39:28 christos Exp $
.include <bsd.init.mk>
DIST= ${IDIST}/src
.PATH: ${DIST} ${IDIST}/man
PROG= sdiff
SRCS= sdiff.c version.c
.include <bsd.prog.mk>

77
external/gpl2/diffutils/diffutils2netbsd vendored Executable file
View File

@ -0,0 +1,77 @@
#! /bin/sh
#
# $NetBSD: diffutils2netbsd,v 1.1 2016/01/13 03:39:28 christos Exp $
#
# Copyright (c) 2003 The NetBSD Foundation, Inc.
# All rights reserved.
#
# 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.
#
# 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.
#
# diffutils2netbsd: convert an diffutils source tree into a
# format suitable for commit. Works on current dir.
#
if [ ! -d "$1" ]; then exit 1; fi
cd "$1"
# delete some superfluous files
echo deleting some superfluous files
rm -rf ms
echo done
### Remove the $'s around RCS tags
cleantags .
### Add our NetBSD RCS Id
find . -type f -name '*.[chly]' -print | while read c; do
sed 1q < $c | grep -q '\$NetBSD' || (
echo "/* \$NetBSD\$ */" >/tmp/diffutils3$$
echo "" >>/tmp/diffutils3$$
cat $c >> /tmp/diffutils3$$
mv /tmp/diffutils3$$ $c && echo added NetBSD RCS tag to $c
)
done
find . -type f -name '*.[0-9]' -print | while read m; do
sed 1q < $m | grep -q '\$NetBSD' || (
echo ".\\\" \$NetBSD\$" >/tmp/diffutils4$$
echo ".\\\"" >>/tmp/diffutils4$$
cat $m >> /tmp/diffutils4$$
mv /tmp/diffutils4$$ $m && echo added NetBSD RCS tag to $m
)
done
find . -type f -name '*.texi' -print | while read t; do
sed "2 s/^/@c \$NetBSD\$\\
/" < $t > /tmp/diffutils5$$
mv /tmp/diffutils5$$ $t && echo added NetBSD RCS tag to $t
done
echo done
cat << EOF
You can import now using
cvs -d cvs.netbsd.org:/cvsroot import src/external/gpl2/diffutils/dist FSF diffutils-X-Y
_EOF
exit 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: xmalloc.c,v 1.1.1.1 2016/01/13 03:15:30 christos Exp $ */
/* $NetBSD: xmalloc.c,v 1.2 2016/01/13 03:39:28 christos Exp $ */
/* xmalloc.c -- malloc with out of memory checking
Copyright (C) 1990-1999, 2000, 2002 Free Software Foundation, Inc.
@ -84,7 +84,7 @@ xmalloc (size_t n)
void *p;
p = malloc (n);
if (p == 0)
if (p == 0 && n)
xalloc_die ();
return p;
}
@ -96,7 +96,7 @@ void *
xrealloc (void *p, size_t n)
{
p = realloc (p, n);
if (p == 0)
if (p == 0 && n)
xalloc_die ();
return p;
}
@ -109,7 +109,7 @@ xcalloc (size_t n, size_t s)
void *p;
p = calloc (n, s);
if (p == 0)
if (p == 0 && n && s)
xalloc_die ();
return p;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: context.c,v 1.1.1.1 2016/01/13 03:15:30 christos Exp $ */
/* $NetBSD: context.c,v 1.2 2016/01/13 03:39:28 christos Exp $ */
/* Context-format output routines for GNU DIFF.
@ -63,9 +63,9 @@ print_context_label (char const *mark,
int nsec = TIMESPEC_NS (inf->stat.st_mtim);
if (! (tm && nstrftime (buf, sizeof buf, time_format, tm, 0, nsec)))
{
long sec = inf->stat.st_mtime;
long long sec = inf->stat.st_mtime;
verify (info_preserved, sizeof inf->stat.st_mtime <= sizeof sec);
sprintf (buf, "%ld.%.9d", sec, nsec);
sprintf (buf, "%lld.%.9d", sec, nsec);
}
fprintf (outfile, "%s %s\t%s\n", mark, inf->name, buf);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: diff.c,v 1.1.1.1 2016/01/13 03:15:30 christos Exp $ */
/* $NetBSD: diff.c,v 1.2 2016/01/13 03:39:28 christos Exp $ */
/* diff - compare files line by line
@ -38,6 +38,7 @@
#include <regex.h>
#include <setmode.h>
#include <xalloc.h>
#include <posixver.h>
static char const authorship_msgid[] =
N_("Written by Paul Eggert, Mike Haertel, David Hayes,\n\
@ -1208,9 +1209,10 @@ compare_files (struct comparison const *parent,
else if ((same_files
= (cmp.file[0].desc != NONEXISTENT
&& cmp.file[1].desc != NONEXISTENT
&& 0 < same_file (&cmp.file[0].stat, &cmp.file[1].stat)
&& same_file_attributes (&cmp.file[0].stat,
&cmp.file[1].stat)))
&& (same_special_file (&cmp.file[0].stat, &cmp.file[1].stat)
|| (0 < same_file (&cmp.file[0].stat, &cmp.file[1].stat)
&& same_file_attributes (&cmp.file[0].stat,
&cmp.file[1].stat)))))
&& no_diff_means_no_output)
{
/* The two named files are actually the same physical file.

View File

@ -1,4 +1,4 @@
/* $NetBSD: diff3.c,v 1.1.1.1 2016/01/13 03:15:30 christos Exp $ */
/* $NetBSD: diff3.c,v 1.2 2016/01/13 03:39:28 christos Exp $ */
/* diff3 - compare three files line by line
@ -1404,7 +1404,7 @@ output_diff3 (FILE *outputfile, struct diff3_block *diff,
line = 0;
do
{
fprintf (outputfile, line_prefix);
fprintf (outputfile, "%s", line_prefix);
cp = D_RELNUM (ptr, realfile, line);
length = D_RELLEN (ptr, realfile, line);
fwrite (cp, sizeof (char), length, outputfile);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sdiff.c,v 1.1.1.1 2016/01/13 03:15:30 christos Exp $ */
/* $NetBSD: sdiff.c,v 1.2 2016/01/13 03:39:28 christos Exp $ */
/* sdiff - side-by-side merge of file differences
@ -263,22 +263,24 @@ perror_fatal (char const *msg)
}
static void
ck_editor_status (int errnum, int status)
check_child_status (int werrno, int wstatus, int max_ok_status,
char const *subsidiary_program)
{
if (errnum | status)
int status = (! werrno && WIFEXITED (wstatus)
? WEXITSTATUS (wstatus)
: INT_MAX);
if (max_ok_status < status)
{
char const *failure_msgid = N_("subsidiary program `%s' failed");
if (! errnum && WIFEXITED (status))
switch (WEXITSTATUS (status))
{
case 126:
failure_msgid = N_("subsidiary program `%s' not executable");
break;
case 127:
failure_msgid = N_("subsidiary program `%s' not found");
break;
}
error (0, errnum, _(failure_msgid), editor_program);
error (0, werrno,
_(status == 126
? "subsidiary program `%s' could not be invoked"
: status == 127
? "subsidiary program `%s' not found"
: status == INT_MAX
? "subsidiary program `%s' failed"
: "subsidiary program `%s' failed (exit status %d)"),
subsidiary_program, status);
exiterr ();
}
}
@ -726,7 +728,7 @@ main (int argc, char *argv[])
if (! interact_ok)
exiterr ();
ck_editor_status (werrno, wstatus);
check_child_status (werrno, wstatus, EXIT_FAILURE, diffargv[0]);
untrapsig (0);
checksigs ();
exit (WEXITSTATUS (wstatus));
@ -1089,7 +1091,8 @@ edit (struct line_filter *left, char const *lname, lin lline, lin llen,
}
ignore_SIGINT = 0;
ck_editor_status (werrno, wstatus);
check_child_status (werrno, wstatus, EXIT_SUCCESS,
editor_program);
}
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: system.h,v 1.1.1.1 2016/01/13 03:15:30 christos Exp $ */
/* $NetBSD: system.h,v 1.2 2016/01/13 03:39:28 christos Exp $ */
/* System dependent declarations.
@ -349,7 +349,7 @@ verify (lin_is_printable_as_long, sizeof (lin) <= sizeof (long));
/* Do struct stat *S, *T describe the same special file? */
#ifndef same_special_file
# if HAVE_ST_RDEV && defined S_ISBLK && defined S_ISCHR
# if HAVE_STRUCT_STAT_ST_RDEV && defined S_ISBLK && defined S_ISCHR
# define same_special_file(s, t) \
(((S_ISBLK ((s)->st_mode) && S_ISBLK ((t)->st_mode)) \
|| (S_ISCHR ((s)->st_mode) && S_ISCHR ((t)->st_mode))) \

515
external/gpl2/diffutils/include/config.h vendored Normal file
View File

@ -0,0 +1,515 @@
/* config.h. Generated by configure. */
/* config.hin. Generated from configure.ac by autoheader. */
/* Define to 1 if the `closedir' function returns void instead of `int'. */
/* #undef CLOSEDIR_VOID */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
/* #undef CRAY_STACKSEG_END */
/* Define to 1 if using `alloca.c'. */
/* #undef C_ALLOCA */
/* Name of "diff" program, unless overridden. */
#define DEFAULT_DIFF_PROGRAM "diff"
/* Name of editor program, unless overridden. */
#define DEFAULT_EDITOR_PROGRAM "ed"
/* Define to 1 if translation of program messages to the user's native
language is requested. */
/* #undef ENABLE_NLS */
/* Define on systems for which file names may have a so-called `drive letter'
prefix, define this to compute the length of that prefix, including the
colon. */
#define FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX 0
/* Define if the backslash character may also serve as a file name component
separator. */
#define FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR 0
#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
# define FILESYSTEM_PREFIX_LEN(Filename) \
((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
#else
# define FILESYSTEM_PREFIX_LEN(Filename) 0
#endif
/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
/* #undef HAVE_ALLOCA_H */
/* Define to 1 if you have the `bcopy' function. */
#define HAVE_BCOPY 1
/* Define to 1 if you have the `btowc' function. */
#define HAVE_BTOWC 1
/* Define to 1 if you have the `bzero' function. */
#define HAVE_BZERO 1
/* Define to 1 if you have the `clock_gettime' function. */
#define HAVE_CLOCK_GETTIME 1
/* Define if backslash-a works in C strings. */
#define HAVE_C_BACKSLASH_A 1
/* Define to 1 if C supports variable-length arrays. */
#define HAVE_C_VARARRAYS 1
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
/* #undef HAVE_DCGETTEXT */
/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_CLEARERR_UNLOCKED 0
/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
don't. */
#define HAVE_DECL_FEOF_UNLOCKED 0
/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FERROR_UNLOCKED 0
/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FFLUSH_UNLOCKED 0
/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FGETS_UNLOCKED 0
/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FPUTC_UNLOCKED 0
/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FPUTS_UNLOCKED 0
/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FREAD_UNLOCKED 0
/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_FWRITE_UNLOCKED 0
/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_GETCHAR_UNLOCKED 1
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
don't. */
#define HAVE_DECL_GETC_UNLOCKED 1
/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
*/
#define HAVE_DECL_GETENV 1
/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
you don't. */
#define HAVE_DECL_PUTCHAR_UNLOCKED 1
/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
don't. */
#define HAVE_DECL_PUTC_UNLOCKED 1
/* Define to 1 if you have the declaration of `strerror', and to 0 if you
don't. */
#define HAVE_DECL_STRERROR 1
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#define HAVE_DECL_STRERROR_R 1
/* Define to 1 if you have the declaration of `strtoimax', and to 0 if you
don't. */
#define HAVE_DECL_STRTOIMAX 1
/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
*/
#define HAVE_DECL_STRTOL 1
/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
don't. */
#define HAVE_DECL_STRTOUL 1
/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
don't. */
#define HAVE_DECL_STRTOULL 1
/* Define to 1 if you have the declaration of `strtoumax', and to 0 if you
don't. */
#define HAVE_DECL_STRTOUMAX 1
/* Define to 1 if you have the `diraccess' function. */
/* #undef HAVE_DIRACCESS */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define if the malloc check has been performed. */
#define HAVE_DONE_WORKING_MALLOC_CHECK 1
/* Define if the realloc check has been performed. */
#define HAVE_DONE_WORKING_REALLOC_CHECK 1
/* Define to 1 if you have the `doprnt' function. */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the `dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if your system has a working `fnmatch' function. */
/* #undef HAVE_FNMATCH */
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
/* Define if the GNU gettext() function is already present or preinstalled. */
/* #undef HAVE_GETTEXT */
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define if you have the iconv() function. */
#define HAVE_ICONV 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `isascii' function. */
#define HAVE_ISASCII 1
/* Define to 1 if you have the `iswprint' function. */
#define HAVE_ISWPRINT 1
/* Define to 1 if you have the <libintl.h> header file. */
#define HAVE_LIBINTL_H 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1
/* Define if you have the long long type. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the `mblen' function. */
#define HAVE_MBLEN 1
/* Define to 1 if you have the `mbrlen' function. */
#define HAVE_MBRLEN 1
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
#define HAVE_MBRTOWC 1
/* Define to 1 if you have the `memchr' function. */
#define HAVE_MEMCHR 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mempcpy' function. */
/* #undef HAVE_MEMPCPY */
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `mkstemp' function. */
#define HAVE_MKSTEMP 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
/* Define to 1 if you have the DOS-style `setmode' function. */
/* #undef HAVE_SETMODE_DOS */
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
/* Define to 1 if the system has the type `siginfo_t'. */
#define HAVE_SIGINFO_T 1
/* Define to 1 if you have the `sigprocmask' function. */
#define HAVE_SIGPROCMASK 1
/* Define to 1 if the system has the type `stack_t'. */
#define HAVE_STACK_T 1
/* Define to 1 if stdbool.h conforms to C99. */
#define HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the `strerror_r' function. */
#define HAVE_STRERROR_R 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strtoul' function. */
/* #undef HAVE_STRTOUL */
/* Define to 1 if you have the `strtoull' function. */
/* #undef HAVE_STRTOULL */
/* Define to 1 if you have the `strtoumax' function. */
#define HAVE_STRTOUMAX 1
/* Define to 1 if `st_blksize' is member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
/* Define to 1 if `st_rdev' is member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_RDEV 1
/* Define to 1 if `tm_zone' is member of `struct tm'. */
#define HAVE_STRUCT_TM_TM_ZONE 1
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#define HAVE_SYS_WAIT_H 1
/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define to 1 if you have the `tmpnam' function. */
#define HAVE_TMPNAM 1
/* Define if struct tm has the tm_gmtoff member. */
#define HAVE_TM_GMTOFF 1
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
`HAVE_STRUCT_TM_TM_ZONE' instead. */
#define HAVE_TM_ZONE 1
/* Define to 1 if you don't have `tm_zone' but do have the external array
`tzname'. */
/* #undef HAVE_TZNAME */
/* Define to 1 if you have the `tzset' function. */
#define HAVE_TZSET 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the unsigned long long type. */
#define HAVE_UNSIGNED_LONG_LONG 1
/* Define to 1 if you have the `vfork' function. */
#define HAVE_VFORK 1
/* Define to 1 if you have the <vfork.h> header file. */
/* #undef HAVE_VFORK_H */
/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1
/* Define to 1 if you have the `waitpid' function. */
#define HAVE_WAITPID 1
/* Define to 1 if you have the <wchar.h> header file. */
#define HAVE_WCHAR_H 1
/* Define to 1 if you have the <wctype.h> header file. */
#define HAVE_WCTYPE_H 1
/* Define to 1 if `fork' works. */
#define HAVE_WORKING_FORK 1
/* Define to 1 if `vfork' works. */
#define HAVE_WORKING_VFORK 1
/* Define to 1 if extending the stack slightly past the limit causes a
SIGSEGV, and an alternate stack can be established with sigaltstack, and
the signal handler is passed a context that specifies the run time stack.
This behavior is defined by POSIX 1003.1-2001 with the X/Open System
Interface (XSI) option and is a standardized way to implement a SEGV-based
stack overflow detection heuristic. */
/* #undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC */
/* Define to 1 if you have the `__secure_getenv' function. */
/* #undef HAVE___SECURE_GETENV */
#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
#else
# define ISSLASH(C) ((C) == '/')
#endif
/* Name of package */
#define PACKAGE "diffutils"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "bug-gnu-utils@gnu.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "GNU diffutils"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "GNU diffutils 2.8.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "diffutils"
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.8.1"
/* Define if compiler has function prototypes */
#define PROTOTYPES 1
/* Name of "pr" program. */
#define PR_PROGRAM "/usr/bin/pr"
/* Define to 1 to avoid alloca in the regular-expression implementation. */
#define REGEX_MALLOC 1
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if strerror_r returns char *. */
/* #undef STRERROR_R_CHAR_P */
/* Define to be the nanoseconds member of struct stat's st_mtim, if it exists.
*/
#define ST_MTIM_NSEC tv_nsec
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* Version number of package */
#define VERSION "2.8.1"
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Enable Solaris extensions. */
#define __EXTENSIONS__ 1
/* Define like PROTOTYPES; this can be used by system headers. */
#define __PROTOTYPES 1
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
if it is not supported. */
/* #undef inline */
/* Define to widest signed type if <inttypes.h> doesn't define. */
/* #undef intmax_t */
/* Define to rpl_malloc if the replacement function should be used. */
/* #undef malloc */
/* Define to a type if <wchar.h> does not define. */
/* #undef mbstate_t */
/* Define to the name of the strftime replacement function. */
#define my_strftime nstrftime
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef ptrdiff_t */
/* Define to rpl_realloc if the replacement function should be used. */
/* #undef realloc */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef ssize_t */
/* Define to widest unsigned type if <inttypes.h> doesn't define. */
/* #undef uintmax_t */
/* Define as `fork' if `vfork' does not work. */
/* #undef vfork */

View File

@ -0,0 +1,69 @@
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C" {
#endif
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef __P
#define __P(protos) protos
#else /* Not C++ or ANSI C. */
#undef __P
#define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((const char *__pattern, const char *__string,
int __flags));
#ifdef __cplusplus
}
#endif
#endif /* fnmatch.h */

46
external/gpl2/diffutils/include/regex.h vendored Normal file
View File

@ -0,0 +1,46 @@
#ifndef _REGEX_H
#include <posix/regex.h>
/* Document internal interfaces. */
extern reg_syntax_t __re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
extern const char *__re_compile_pattern
_RE_ARGS ((const char *pattern, size_t length,
struct re_pattern_buffer *buffer));
extern int __re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
extern int __re_search
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range, struct re_registers *regs));
extern int __re_search_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, int range, struct re_registers *regs, int stop));
extern int __re_match
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
int length, int start, struct re_registers *regs));
extern int __re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
extern void __re_set_registers
_RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
unsigned num_regs, regoff_t *starts, regoff_t *ends));
extern int __regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
int __cflags));
extern int __regexec _RE_ARGS ((const regex_t *__preg,
const char *__string, size_t __nmatch,
regmatch_t __pmatch[], int __eflags));
extern size_t __regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
char *__errbuf, size_t __errbuf_size));
extern void __regfree _RE_ARGS ((regex_t *__preg));
#endif

18
external/gpl2/diffutils/lib/Makefile vendored Normal file
View File

@ -0,0 +1,18 @@
# $NetBSD: Makefile,v 1.1 2016/01/13 03:39:28 christos Exp $
LIBISPRIVATE= yes
.include <bsd.init.mk>
LIB= diffutils
DIST= ${IDIST}/lib
.PATH: ${DIST}
SRCS= basename.c c-stack.c cmpbuf.c error.c exclude.c exitfail.c \
freesoft.c \
hard-locale.c imaxtostr.c offtostr.c prepargs.c posixver.c quotesys.c \
regex.c setmode.c strftime.c umaxtostr.c xmalloc.c xstrtoumax.c
CWARNFLAGS.clang+= -Wno-unused-value -Wno-tautological-compare
.include <bsd.lib.mk>