]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Remove inclusion of <ctype.h> and definitions of is* ctype macros to system.h.
authorJim Meyering <jim@meyering.net>
Mon, 7 Dec 1992 04:54:04 +0000 (04:54 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 7 Dec 1992 04:54:04 +0000 (04:54 +0000)
Change a few more uses of is* ctype macros to (protected) upper case versions.

14 files changed:
src/csplit.c
src/cut.c
src/expand.c
src/fold.c
src/head.c
src/join.c
src/od.c
src/pr.c
src/sort.c
src/split.c
src/tail.c
src/tr.c
src/unexpand.c
src/uniq.c

index ec8d2ed51799ea82615a0537b0fdfc7a5ed95e6f..7b2165e5f97a4deb32867d6cc9b6bcea6f0476b1 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <stdio.h>
 #include <getopt.h>
-#include <ctype.h>
 #include <sys/types.h>
 #include <signal.h>
 #include "regex.h"
@@ -1051,7 +1050,7 @@ string_to_number (result, num)
 
   while ((ch = *num++))
     {
-      if (!isdigit (ch))
+      if (!ISDIGIT (ch))
        return FALSE;
       val = val * 10 + ch - '0';
     }
index 1069a6400e5d4881cc2b96c264c241076ac4a00e..6e95f0a1507cf677319b7221cf5b834d5673a331 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
 
 /* Get isblank from GNU libc.  */
 #define _GNU_SOURCE
-#include <ctype.h>
-#ifndef isblank
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
+
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include "system.h"
 
-#ifdef isascii
-#define ISDIGIT(c) (isascii ((c)) && isdigit ((c)))
-#else
-#define ISDIGIT(c) (isdigit ((c)))
-#endif
-
 char *xmalloc ();
 char *xrealloc ();
 void error ();
@@ -286,7 +277,7 @@ set_fields (fieldstr)
          else
            initial = 1;
        }
-      else if (*fieldstr == ',' || isblank (*fieldstr) || *fieldstr == '\0')
+      else if (*fieldstr == ',' || ISBLANK (*fieldstr) || *fieldstr == '\0')
        {
          /* Ending the string, or this field/byte sublist. */
          if (dash_found)
index a4fb1af5bbff5f2d3c5db237775efddd548aa0e7..17d215b43ef7f09d0ade4eeeda9eaf9f555485a9 100644 (file)
 
 /* Get isblank from GNU libc.  */
 #define _GNU_SOURCE
-#include <ctype.h>
-#ifndef isblank
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
+
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include "system.h"
 
-#ifdef isascii
-#define ISDIGIT(c) (isascii ((c)) && isdigit ((c)))
-#else
-#define ISDIGIT(c) (isdigit ((c)))
-#endif
-
 /* The number of bytes added at a time to the amount of memory
    allocated for the output line. */
 #define OUTPUT_BLOCK 256
@@ -187,7 +178,7 @@ parse_tabstops (stops)
 
   for (; *stops; stops++)
     {
-      if (*stops == ',' || isblank (*stops))
+      if (*stops == ',' || ISBLANK (*stops))
        {
          add_tabstop (tabval);
          tabval = -1;
index 3cd47159670a0a5503b175c2e8fa3e876f043cfa..fcdd885b1641e4ce5aed59034646472c57eac287 100644 (file)
 
 /* Get isblank from GNU libc.  */
 #define _GNU_SOURCE
-#include <ctype.h>
-#ifndef isblank
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
+
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -169,7 +166,7 @@ fold_file (filename, width)
 
              for (logical_end = offset_out - 1; logical_end >= 0;
                   logical_end--)
-               if (isblank (line_out[logical_end]))
+               if (ISBLANK (line_out[logical_end]))
                  break;
              if (logical_end >= 0)
                {
index b0719c82671d721ca119084d954fd13977e472cb..c818c661207ab4cfe10e399cb6cdc178491a4ed3 100644 (file)
 
 #include <stdio.h>
 #include <getopt.h>
-#include <ctype.h>
 #include <sys/types.h>
 #include "system.h"
 
-#ifdef isascii
-#define ISDIGIT(c) (isascii ((c)) && isdigit ((c)))
-#else
-#define ISDIGIT(c) (isdigit ((c)))
-#endif
-
 /* Number of lines/chars/blocks to head. */
 #define DEFAULT_NUMBER 10
 
index 2399ad4ac8d84a8ba3a47b98a1b6eea5fd5a1e20..c826df8249d4f15186a2fb80a03bc221c7d2deea 100644 (file)
 
 /* Get isblank from GNU libc.  */
 #define _GNU_SOURCE
-#include <ctype.h>
-#ifndef isblank
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <getopt.h>
 #include "system.h"
 
-#ifdef isascii
-#define ISSPACE(c) (isascii(c) && isspace(c))
-#define ISDIGIT(c) (isascii(c) && isdigit(c))
-#else
-#define ISSPACE(c) isspace(c)
-#define ISDIGIT(c) isdigit(c)
-#endif
-
 char *xmalloc ();
 char *xrealloc ();
 void error ();
@@ -526,7 +515,7 @@ add_field_list (str)
 
   for (; *str; str++)
     {
-      if (*str == ',' || isblank (*str))
+      if (*str == ',' || ISBLANK (*str))
        {
          added += add_field (file, field);
          file = field = -1;
index eb6ffed31a9f0bb9cc55c0994bf9ac06237b07b8..ae2c3da3b3154c66fae49ea0f07f94429170f10e 100644 (file)
--- a/src/od.c
+++ b/src/od.c
@@ -33,20 +33,11 @@ char *alloca ();
 #endif /* not __GNUC__ */
 
 #include <stdio.h>
-#include <ctype.h>
 #include <assert.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include "system.h"
 
-#ifdef isascii
-#define ISPRINT(c) (isascii (c) && isprint (c))
-#define ISDIGIT(c) (isascii (c) && isdigit (c))
-#else
-#define ISPRINT(c) isprint (c)
-#define ISDIGIT(c) isdigit (c)
-#endif
-
 #if defined(__GNUC__) || defined(STDC_HEADERS)
 #include <float.h>
 #endif
index fe65c765965bb5f38d3ebe750b6df727fab0d0ff..c49819d8063b78529e2533df48c09b5e0fcac1f8 100644 (file)
--- a/src/pr.c
+++ b/src/pr.c
 
    -w width    Set the page width to WIDTH characters. */
 \f
+
 #include <stdio.h>
 #include <getopt.h>
-#include <ctype.h>
 #include <sys/types.h>
 #include <time.h>
 #include "system.h"
 
-#ifdef isascii
-#define ISPRINT(c) (isascii (c) && isprint (c))
-#define ISDIGIT(c) (isascii (c) && isdigit (c))
-#else
-#define ISPRINT(c) isprint (c)
-#define ISDIGIT(c) isdigit (c)
-#endif
-
 char *xmalloc ();
 char *xrealloc ();
 void error ();
index c2f15ec8bb755d927e8132e07013b5310466c1f0..e514284b8d9995515fce443ca8338f7e2f7cb926 100644 (file)
 
 /* Get isblank from GNU libc.  */
 #define _GNU_SOURCE
-#include <ctype.h>
-#ifndef isblank
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
+
 #include <sys/types.h>
 #include <signal.h>
 #include <stdio.h>
@@ -49,18 +46,6 @@ static void usage ();
 #define UCHAR_LIM (UCHAR_MAX + 1)
 #define UCHAR(c) ((unsigned char) (c))
 
-#ifdef isascii
-#define ISALNUM(c) (isascii(c) && isalnum(c))
-#define ISDIGIT(c) (isascii(c) && isdigit(c))
-#define ISPRINT(c) (isascii(c) && isprint(c))
-#define ISLOWER(c) (isascii(c) && islower(c))
-#else
-#define ISALNUM(c) isalnum(c)
-#define ISDIGIT(c) isdigit(c)
-#define ISPRINT(c) isprint(c)
-#define ISLOWER(c) islower(c)
-#endif
-
 /* The kind of blanks for '-b' to skip in various options. */
 enum blanktype { bl_start, bl_end, bl_both };
 
@@ -353,13 +338,13 @@ inittables ()
 
   for (i = 0; i < UCHAR_LIM; ++i)
     {
-      if (isblank (i))
+      if (ISBLANK (i))
        blanks[i] = 1;
       if (ISDIGIT (i))
        digits[i] = 1;
       if (!ISPRINT (i))
        nonprinting[i] = 1;
-      if (!ISALNUM (i) && !isblank (i))
+      if (!ISALNUM (i) && !ISBLANK (i))
        nondictionary[i] = 1;
       if (ISLOWER (i))
        fold_toupper[i] = toupper (i);
index a2aee897bc627120d51b421d93b5de68fc01f293..980edf310e254dce64ecab9d09feaccfa24a9343 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <stdio.h>
 #include <getopt.h>
-#include <ctype.h>
 #include <sys/types.h>
 #include "system.h"
 
@@ -262,7 +261,7 @@ isdigits (str)
 {
   do
     {
-      if (!isdigit (*str))
+      if (!ISDIGIT (*str))
        return 0;
       str++;
     }
index 969488b7b9d26640a6068bd09594989b48b23153..a94ac9c63912bd5dc11b66bfc4555806abe00669 100644 (file)
 
 #include <stdio.h>
 #include <getopt.h>
-#include <ctype.h>
 #include <sys/types.h>
 #include <signal.h>
 #include "system.h"
 
-#ifdef isascii
-#define ISDIGIT(c) (isascii ((c)) && isdigit ((c)))
-#else
-#define ISDIGIT(c) (isdigit ((c)))
-#endif
-
 /* Number of items to tail. */
 #define DEFAULT_NUMBER 10
 
index e943903f881a6eaee4ebb11e67dd5ad8c541a6a8..8ba07d0a75cc8e6116aec71e1a522f7fbe1a3d07 100644 (file)
--- a/src/tr.c
+++ b/src/tr.c
 
 /* Get isblank from GNU libc.  */
 #define _GNU_SOURCE
-#include <ctype.h>
-
-#ifndef isascii
-#define isascii(c) 1
-#endif
-
-#ifdef isblank
-#define ISBLANK(c) (isascii (c) isblank (c))
-#else
-#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
-#endif
-#ifdef isgraph
-#define ISGRAPH(c) (isascii (c) isgraph (c))
-#else
-#define ISGRAPH(c) (isascii (c) isprint (c) && !isspace (c))
-#endif
-
-#define ISPRINT(c) (isascii (c) isprint (c))
-#define ISDIGIT(c) (isascii (c) isdigit (c))
-#define ISALNUM(c) (isascii (c) isalnum (c))
-#define ISALPHA(c) (isascii (c) isalpha (c))
-#define ISCNTRL(c) (isascii (c) iscntrl (c))
-#define ISLOWER(c) (isascii (c) islower (c))
-#define ISPUNCT(c) (isascii (c) ispunct (c))
-#define ISSPACE(c) (isascii (c) isspace (c))
-#define ISUPPER(c) (isascii (c) isupper (c))
-#define ISXDIGIT(c) (isascii (c) isxdigit (c))
 
 #include <stdio.h>
 #include <assert.h>
index e3de5e70986a6aa580fa5793af39618734bcb80f..01dc417622981cabd53b0df52b2829873c2e86b3 100644 (file)
 
 /* Get isblank from GNU libc.  */
 #define _GNU_SOURCE
-#include <ctype.h>
-#ifndef isblank
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
+
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include "system.h"
 
-#ifdef isascii
-#define ISDIGIT(c) (isascii((c)) && isdigit((c)))
-#else
-#define ISDIGIT(c) (isdigit((c)))
-#endif
-
 /* The number of bytes added at a time to the amount of memory
    allocated for the output line. */
 #define OUTPUT_BLOCK 256
@@ -189,7 +180,7 @@ parse_tabstops (stops)
 
   for (; *stops; stops++)
     {
-      if (*stops == ',' || isblank (*stops))
+      if (*stops == ',' || ISBLANK (*stops))
        {
          add_tabstop (tabval);
          tabval = -1;
index 1b8e8e4d322cf3e0a2a0f00e7ac5177a8ace7cbf..944727f810c1c6f906eae006dfd397657e55f562 100644 (file)
 \f
 /* Get isblank from GNU libc.  */
 #define _GNU_SOURCE
-#include <ctype.h>
-#ifndef isblank
-#define isblank(c) ((c) == ' ' || (c) == '\t')
-#endif
+
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
@@ -249,9 +246,9 @@ find_field (line)
 
   for (count = 0; count < skip_fields && i < size; count++)
     {
-      while (i < size && isblank (lp[i]))
+      while (i < size && ISBLANK (lp[i]))
        i++;
-      while (i < size && !isblank (lp[i]))
+      while (i < size && !ISBLANK (lp[i]))
        i++;
     }