[BACK]Return to ctype.h CVS log [TXT][DIR] Up to [local] / src / include

Diff for /src/include/ctype.h between version 1.21 and 1.22

version 1.21, 2010/07/25 15:35:29 version 1.22, 2010/10/01 20:10:24
Line 57 
Line 57 
 extern const short      *_tolower_tab_;  extern const short      *_tolower_tab_;
 extern const short      *_toupper_tab_;  extern const short      *_toupper_tab_;
   
 /* extern __inline is a GNU C extension */  
 #ifdef __GNUC__  
 #  if __GNUC_PREREQ__(4, 2)  
 #define __CTYPE_INLINE  extern __inline __attribute__((__gnu_inline__))  
 #  else  
 #define __CTYPE_INLINE  extern __inline  
 #  endif  
 #else  
 #define __CTYPE_INLINE  static __inline  
 #endif  
   
 #if defined(__GNUC__) || defined(_ANSI_LIBRARY) || defined(lint)  #if defined(__GNUC__) || defined(_ANSI_LIBRARY) || defined(lint)
 int     isalnum(int);  int     isalnum(int);
 int     isalpha(int);  int     isalpha(int);
Line 99 
Line 88 
   
 #if !defined(_ANSI_LIBRARY) && !defined(lint)  #if !defined(_ANSI_LIBRARY) && !defined(lint)
   
 __CTYPE_INLINE int isalnum(int c)  __only_inline int isalnum(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L|_N)));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L|_N)));
 }  }
   
 __CTYPE_INLINE int isalpha(int c)  __only_inline int isalpha(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L)));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L)));
 }  }
   
 __CTYPE_INLINE int iscntrl(int c)  __only_inline int iscntrl(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _C));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _C));
 }  }
   
 __CTYPE_INLINE int isdigit(int c)  __only_inline int isdigit(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));
 }  }
   
 __CTYPE_INLINE int isgraph(int c)  __only_inline int isgraph(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N)));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N)));
 }  }
   
 __CTYPE_INLINE int islower(int c)  __only_inline int islower(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _L));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _L));
 }  }
   
 __CTYPE_INLINE int isprint(int c)  __only_inline int isprint(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N|_B)));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N|_B)));
 }  }
   
 __CTYPE_INLINE int ispunct(int c)  __only_inline int ispunct(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _P));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _P));
 }  }
   
 __CTYPE_INLINE int isspace(int c)  __only_inline int isspace(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _S));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _S));
 }  }
   
 __CTYPE_INLINE int isupper(int c)  __only_inline int isupper(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _U));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _U));
 }  }
   
 __CTYPE_INLINE int isxdigit(int c)  __only_inline int isxdigit(int c)
 {  {
         return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_N|_X)));          return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_N|_X)));
 }  }
   
 __CTYPE_INLINE int tolower(int c)  __only_inline int tolower(int c)
 {  {
         if ((unsigned int)c > 255)          if ((unsigned int)c > 255)
                 return (c);                  return (c);
         return ((_tolower_tab_ + 1)[c]);          return ((_tolower_tab_ + 1)[c]);
 }  }
   
 __CTYPE_INLINE int toupper(int c)  __only_inline int toupper(int c)
 {  {
         if ((unsigned int)c > 255)          if ((unsigned int)c > 255)
                 return (c);                  return (c);
Line 170 
Line 159 
   
 #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE > 200112 \  #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE > 200112 \
     || __XPG_VISIBLE > 600      || __XPG_VISIBLE > 600
 __CTYPE_INLINE int isblank(int c)  __only_inline int isblank(int c)
 {  {
         return (c == ' ' || c == '\t');          return (c == ' ' || c == '\t');
 }  }
 #endif  #endif
   
 #if __BSD_VISIBLE || __XPG_VISIBLE  #if __BSD_VISIBLE || __XPG_VISIBLE
 __CTYPE_INLINE int isascii(int c)  __only_inline int isascii(int c)
 {  {
         return ((unsigned int)c <= 0177);          return ((unsigned int)c <= 0177);
 }  }
   
 __CTYPE_INLINE int toascii(int c)  __only_inline int toascii(int c)
 {  {
         return (c & 0177);          return (c & 0177);
 }  }
   
 __CTYPE_INLINE int _tolower(int c)  __only_inline int _tolower(int c)
 {  {
         return (c - 'A' + 'a');          return (c - 'A' + 'a');
 }  }
   
 __CTYPE_INLINE int _toupper(int c)  __only_inline int _toupper(int c)
 {  {
         return (c - 'a' + 'A');          return (c - 'a' + 'A');
 }  }
Line 201 
Line 190 
 #endif /* !_ANSI_LIBRARY && !lint */  #endif /* !_ANSI_LIBRARY && !lint */
   
 __END_DECLS  __END_DECLS
   
 #undef __CTYPE_INLINE  
   
 #endif /* !_CTYPE_H_ */  #endif /* !_CTYPE_H_ */

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22