summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/diff/system.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-10-28 19:11:01 +0000
committerpeter <peter@FreeBSD.org>1995-10-28 19:11:01 +0000
commitc37ff62e9be62a7cd6340caca3316bb40062ac2d (patch)
tree987fcf998a10323a27da08d8512088fb01e8396f /gnu/usr.bin/diff/system.h
parent72fa7ec057bc2d7930e60d59f3936afe1de4bc11 (diff)
downloadFreeBSD-src-c37ff62e9be62a7cd6340caca3316bb40062ac2d.zip
FreeBSD-src-c37ff62e9be62a7cd6340caca3316bb40062ac2d.tar.gz
Merge in/out comflicts caused by Diffutils-2.7 import...
In future, it should be as easy as "update -j ....", but this time I had to go over it by hand. Not nice..
Diffstat (limited to 'gnu/usr.bin/diff/system.h')
-rw-r--r--gnu/usr.bin/diff/system.h158
1 files changed, 105 insertions, 53 deletions
diff --git a/gnu/usr.bin/diff/system.h b/gnu/usr.bin/diff/system.h
index 2da6247..47db287 100644
--- a/gnu/usr.bin/diff/system.h
+++ b/gnu/usr.bin/diff/system.h
@@ -1,5 +1,5 @@
/* System dependent declarations.
- Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1989, 1992, 1993, 1994 Free Software Foundation, Inc.
This file is part of GNU DIFF.
@@ -64,16 +64,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK)
#endif
-#ifndef S_IXOTH
-#define S_IXOTH 1
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP (S_IXOTH << 3)
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR (S_IXGRP << 3)
-#endif
-
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -104,8 +94,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if HAVE_FCNTL_H
#include <fcntl.h>
#else
+#if HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
+#endif
#if !HAVE_DUP2
#define dup2(f,t) (close (t), fcntl (f,F_DUPFD,t))
@@ -116,47 +108,39 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif
#if HAVE_SYS_WAIT_H
-#ifndef _POSIX_VERSION
-/* Prevent the NeXT prototype using union wait from causing problems. */
-#define wait system_wait
-#endif
#include <sys/wait.h>
-#ifndef _POSIX_VERSION
-#undef wait
#endif
-#endif /* HAVE_SYS_WAIT_H */
-
#ifndef WEXITSTATUS
-#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#undef WIFEXITED /* Avoid 4.3BSD incompatibility with Posix. */
+#define WEXITSTATUS(stat_val) ((unsigned) (stat_val) >> 8)
#endif
#ifndef WIFEXITED
#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
+#ifndef STAT_BLOCKSIZE
#if HAVE_ST_BLKSIZE
#define STAT_BLOCKSIZE(s) (s).st_blksize
#else
#define STAT_BLOCKSIZE(s) (8 * 1024)
#endif
+#endif
-#if DIRENT || defined (_POSIX_VERSION)
-#include <dirent.h>
-#else /* ! (DIRENT || defined (_POSIX_VERSION)) */
-#if SYSNDIR
-#include <sys/ndir.h>
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
-#if SYSDIR
-#include <sys/dir.h>
-#else
-#include <ndir.h>
-#endif
+# define dirent direct
+# define NAMLEN(dirent) ((dirent)->d_namlen)
+# 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
-#ifdef dirent
-#undef dirent
-#endif
-#define dirent direct
-#endif /* ! (DIRENT || defined (_POSIX_VERSION)) */
#if HAVE_VFORK_H
#include <vfork.h>
@@ -182,28 +166,44 @@ char *getenv ();
#define CHAR_BIT 8
#endif
-#if HAVE_STRING_H
-#include <string.h>
-#ifndef bzero
-#define bzero(s,n) memset (s,0,n)
+#if STDC_HEADERS || HAVE_STRING_H
+# include <string.h>
+# ifndef bzero
+# define bzero(s, n) memset (s, 0, n)
+# endif
+#else
+# if !HAVE_STRCHR
+# define strchr index
+# define strrchr rindex
+# endif
+char *strchr (), *strrchr ();
+# if !HAVE_MEMCHR
+# define memcmp(s1, s2, n) bcmp (s1, s2, n)
+# define memcpy(d, s, n) bcopy (s, d, n)
+void *memchr ();
+# endif
#endif
-#else /* !HAVE_STRING_H */
-#include <strings.h>
-#ifndef strchr
-#define strchr index
+
+#include <ctype.h>
+/* CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given
+ as an argument to <ctype.h> macros like `isspace'. */
+#if STDC_HEADERS
+#define CTYPE_DOMAIN(c) 1
+#else
+#define CTYPE_DOMAIN(c) ((unsigned) (c) <= 0177)
#endif
-#ifndef strrchr
-#define strrchr rindex
+#ifndef ISPRINT
+#define ISPRINT(c) (CTYPE_DOMAIN (c) && isprint (c))
#endif
-#ifndef memcpy
-#define memcpy(d,s,n) bcopy (s,d,n)
+#ifndef ISSPACE
+#define ISSPACE(c) (CTYPE_DOMAIN (c) && isspace (c))
#endif
-#ifndef memcmp
-#define memcmp(s1,s2,n) bcmp (s1,s2,n)
+#ifndef ISUPPER
+#define ISUPPER(c) (CTYPE_DOMAIN (c) && isupper (c))
#endif
-#endif /* !HAVE_STRING_H */
-#if !HAVE_MEMCHR
-char *memchr ();
+
+#ifndef ISDIGIT
+#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
#endif
#include <errno.h>
@@ -211,5 +211,57 @@ char *memchr ();
extern int errno;
#endif
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
#define min(a,b) ((a) <= (b) ? (a) : (b))
#define max(a,b) ((a) >= (b) ? (a) : (b))
+
+/* This section contains Posix-compliant defaults for macros
+ that are meant to be overridden by hand in config.h as needed. */
+
+#ifndef filename_cmp
+#define filename_cmp(a, b) strcmp (a, b)
+#endif
+
+#ifndef filename_lastdirchar
+#define filename_lastdirchar(filename) strrchr (filename, '/')
+#endif
+
+#ifndef HAVE_FORK
+#define HAVE_FORK 1
+#endif
+
+#ifndef HAVE_SETMODE
+#define HAVE_SETMODE 0
+#endif
+
+#ifndef initialize_main
+#define initialize_main(argcp, argvp)
+#endif
+
+/* Do struct stat *S, *T describe the same file? Answer -1 if unknown. */
+#ifndef same_file
+#define same_file(s,t) ((s)->st_ino==(t)->st_ino && (s)->st_dev==(t)->st_dev)
+#endif
+
+/* Place into Q a quoted version of A suitable for `popen' or `system',
+ incrementing Q and junking A.
+ Do not increment Q by more than 4 * strlen (A) + 2. */
+#ifndef SYSTEM_QUOTE_ARG
+#define SYSTEM_QUOTE_ARG(q, a) \
+ { \
+ *(q)++ = '\''; \
+ for (; *(a); *(q)++ = *(a)++) \
+ if (*(a) == '\'') \
+ { \
+ *(q)++ = '\''; \
+ *(q)++ = '\\'; \
+ *(q)++ = '\''; \
+ } \
+ *(q)++ = '\''; \
+ }
+#endif
OpenPOWER on IntegriCloud