#include <stdio.h>
#include <sys/types.h> /* for off_t */
#include <time.h>
-#if defined HAVE_STRING_H || defined STDC_HEADERS
-# include <string.h>
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H && !defined __GNUC__
-# include <memory.h>
-# endif
-# define memzero(s, n) memset ((voidp)(s), 0, (n))
-#else
-# include <strings.h>
-# define strchr index
-# define strrchr rindex
-# define memcpy(d, s, n) bcopy((s), (d), (n))
-# define memcmp(s1, s2, n) bcmp((s1), (s2), (n))
-# define memzero(s, n) bzero((s), (n))
-#endif
+#include <string.h>
+#define memzero(s, n) memset ((voidp)(s), 0, (n))
#ifndef RETSIGTYPE
# define RETSIGTYPE void
#include "tailor.h"
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#ifdef HAVE_FCNTL_H
-# include <fcntl.h>
-#endif
-
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
- extern int errno;
-#endif
+#include <limits.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <errno.h>
#include "gzip.h"
#include "crypt.h"
voidp buf;
unsigned int cnt;
{
-#ifdef SSIZE_MAX
- if (SSIZE_MAX < cnt)
- cnt = SSIZE_MAX;
-#endif
+ if (INT_MAX < cnt)
+ cnt = INT_MAX;
return read (fd, buf, cnt);
}
voidp buf;
unsigned int cnt;
{
-#ifdef SSIZE_MAX
- if (SSIZE_MAX < cnt)
- cnt = SSIZE_MAX;
-#endif
+ if (INT_MAX < cnt)
+ cnt = INT_MAX;
return write (fd, buf, cnt);
}
} while (p != name);
}
-
-#if !defined HAVE_STRING_H && !defined STDC_HEADERS
-
-/* Provide missing strspn and strcspn functions. */
-
-# ifndef __STDC__
-# define const
-# endif
-
-int strspn OF((const char *s, const char *accept));
-int strcspn OF((const char *s, const char *reject));
-
-/* ========================================================================
- * Return the length of the maximum initial segment
- * of s which contains only characters in accept.
- */
-int strspn(s, accept)
- const char *s;
- const char *accept;
-{
- register const char *p;
- register const char *a;
- register int count = 0;
-
- for (p = s; *p != '\0'; ++p) {
- for (a = accept; *a != '\0'; ++a) {
- if (*p == *a) break;
- }
- if (*a == '\0') return count;
- ++count;
- }
- return count;
-}
-
-/* ========================================================================
- * Return the length of the maximum inital segment of s
- * which contains no characters from reject.
- */
-int strcspn(s, reject)
- const char *s;
- const char *reject;
-{
- register int count = 0;
-
- while (*s != '\0') {
- if (strchr(reject, *s++) != NULL) return count;
- ++count;
- }
- return count;
-}
-
-#endif
-
/* ========================================================================
* Add an environment variable (if any) before argv, and update argc.
* Return the expanded environment variable to be freed later, or NULL