summaryrefslogtreecommitdiff
path: root/src/system.h
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-11-24 14:19:32 +0000
committerJim Meyering <jim@meyering.net>1997-11-24 14:19:32 +0000
commitc781b840f2c38e914bfc9d073704c92427bd8800 (patch)
tree863c6ad5baf250d99ad355b67adf25b3ae37cfef /src/system.h
parentd8415fe94f27c45d66c4f0828258c8e27bb23959 (diff)
downloadcoreutils-c781b840f2c38e914bfc9d073704c92427bd8800.tar.xz
move big chunk of defs to sys2
Diffstat (limited to 'src/system.h')
-rw-r--r--src/system.h149
1 files changed, 3 insertions, 146 deletions
diff --git a/src/system.h b/src/system.h
index e60ee53fe..990eee116 100644
--- a/src/system.h
+++ b/src/system.h
@@ -172,13 +172,11 @@ char *memchr ();
extern int errno;
#endif
-#ifdef STDC_HEADERS
+#if HAVE_STDLIB_H
# define getopt system_getopt
# include <stdlib.h>
# undef getopt
-#else /* not STDC_HEADERS */
-char *getenv ();
-#endif /* STDC_HEADERS */
+#endif
/* The following test is to work around the gross typo in
systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
@@ -277,145 +275,4 @@ char *getenv ();
# endif /* !hpux */
#endif /* HAVE_ST_BLOCKS */
-#ifndef RETSIGTYPE
-# define RETSIGTYPE void
-#endif
-
-#ifndef __GNUC__
-# ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-# else
-# ifdef _AIX
-# pragma alloca
-# else
-# ifndef alloca
-char *alloca ();
-# endif
-# endif
-# endif
-#endif
-
-#include <ctype.h>
-
-/* Jim Meyering writes:
-
- "... Some ctype macros are valid only for character codes that
- isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
- using /bin/cc or gcc but without giving an ansi option). So, all
- ctype uses should be through macros like ISPRINT... If
- STDC_HEADERS is defined, then autoconf has verified that the ctype
- macros don't need to be guarded with references to isascii. ...
- Defining isascii to 1 should let any compiler worth its salt
- eliminate the && through constant folding."
-
- Bruno Haible adds:
-
- "... Furthermore, isupper(c) etc. have an undefined result if c is
- outside the range -1 <= c <= 255. One is tempted to write isupper(c)
- with c being of type `char', but this is wrong if c is an 8-bit
- character >= 128 which gets sign-extended to a negative value.
- The macro ISUPPER protects against this as well." */
-
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
-#endif
-
-#ifdef isblank
-# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c))
-#else
-# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
-#endif
-#ifdef isgraph
-# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (c))
-#else
-# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (c) && !isspace (c))
-#endif
-
-#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
-#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
-#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
-#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c))
-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
-#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
-#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
-#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
-
-/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
- - Its arg may be any int or unsigned int; it need not be an unsigned char.
- - It's guaranteed to evaluate its argument exactly once.
- - It's typically faster.
- Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
- only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless
- it's important to use the locale's definition of `digit' even when the
- host does not conform to Posix. */
-#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
-
-#ifndef __P
-# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
-# define __P(args) args
-# else
-# define __P(args) ()
-# endif /* GCC. */
-#endif /* Not __P. */
-
-/* Take care of NLS matters. */
-
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
-#if !HAVE_SETLOCALE
-# define setlocale(Category, Locale) /* empty */
-#endif
-
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# undef bindtextdomain
-# define bindtextdomain(Domain, Directory) /* empty */
-# undef textdomain
-# define textdomain(Domain) /* empty */
-# define _(Text) Text
-#endif
-
-#define STREQ(a,b) (strcmp((a), (b)) == 0)
-
-#ifndef HAVE_DECLARATION_FREE
-void free ();
-#endif
-
-#ifndef HAVE_DECLARATION_MALLOC
-char *malloc ();
-#endif
-
-#ifndef HAVE_DECLARATION_REALLOC
-char *realloc ();
-#endif
-
-#ifndef HAVE_DECLARATION_STPCPY
-char *stpcpy ();
-#endif
-
-#ifndef HAVE_DECLARATION_STRSTR
-char *strstr ();
-#endif
-
-#include "xalloc.h"
-
-#ifndef HAVE_MEMPCPY
-# if defined (__GNUC__)
-/* Use an inline function with GNU C so we don't get the warning that
- `value computed is not used'. */
-static __inline__ void*
-mempcpy (void *d, const void *s, size_t n)
-{
- return (char *) memcpy (d, s, n) + n;
-}
-# else
-# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
-# endif
-#endif
+#include "sys2.h"