Print this page
2964 need POSIX 2008 locale object support
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/rtld/common/external.c
          +++ new/usr/src/cmd/sgs/rtld/common/external.c
↓ open down ↓ 660 lines elided ↑ open up ↑
 661  661          extern ssize_t __read(int, void *, size_t);
 662  662          return (__read(fd, buf, size));
 663  663  }
 664  664  
 665  665  ssize_t
 666  666  write(int fd, const void *buf, size_t size)
 667  667  {
 668  668          extern ssize_t __write(int, const void *, size_t);
 669  669          return (__write(fd, buf, size));
 670  670  }
      671 +
      672 +/*
      673 + * ASCII versions of ctype character classification functions.  This avoids
      674 + * pulling in the entire locale framework that is in libc.
      675 + */
      676 +
      677 +int
      678 +isdigit(int c)
      679 +{
      680 +        return ((c >= '0' && c <= '9') ? 1 : 0);
      681 +}
      682 +
      683 +int
      684 +isupper(int c)
      685 +{
      686 +        return ((c >= 'A' && c <= 'Z') ? 1 : 0);
      687 +}
      688 +
      689 +int
      690 +islower(int c)
      691 +{
      692 +        return ((c >= 'a' && c <= 'z') ? 1 : 0);
      693 +}
      694 +
      695 +int
      696 +isspace(int c)
      697 +{
      698 +        return (((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n') ||
      699 +            (c == '\v') || (c == '\f')) ? 1 : 0);
      700 +}
      701 +
      702 +int
      703 +isxdigit(int c)
      704 +{
      705 +        return ((isdigit(c) || (c >= 'A' && c <= 'F') ||
      706 +            (c >= 'a' && c <= 'f')) ? 1 : 0);
      707 +}
      708 +
      709 +int
      710 +isalpha(int c)
      711 +{
      712 +        return ((isupper(c) || islower(c)) ? 1 : 0);
      713 +}
      714 +
      715 +int
      716 +isalnum(int c)
      717 +{
      718 +        return ((isalpha(c) || isdigit(c)) ? 1 : 0);
      719 +}
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX