OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc2/] [newlib/] [libc/] [include/] [ctype.h] - Diff between revs 207 and 520

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 520
#ifndef _CTYPE_H_
#ifndef _CTYPE_H_
#define _CTYPE_H_
#define _CTYPE_H_
 
 
#include "_ansi.h"
#include "_ansi.h"
 
 
_BEGIN_STD_C
_BEGIN_STD_C
 
 
int _EXFUN(isalnum, (int __c));
int _EXFUN(isalnum, (int __c));
int _EXFUN(isalpha, (int __c));
int _EXFUN(isalpha, (int __c));
int _EXFUN(iscntrl, (int __c));
int _EXFUN(iscntrl, (int __c));
int _EXFUN(isdigit, (int __c));
int _EXFUN(isdigit, (int __c));
int _EXFUN(isgraph, (int __c));
int _EXFUN(isgraph, (int __c));
int _EXFUN(islower, (int __c));
int _EXFUN(islower, (int __c));
int _EXFUN(isprint, (int __c));
int _EXFUN(isprint, (int __c));
int _EXFUN(ispunct, (int __c));
int _EXFUN(ispunct, (int __c));
int _EXFUN(isspace, (int __c));
int _EXFUN(isspace, (int __c));
int _EXFUN(isupper, (int __c));
int _EXFUN(isupper, (int __c));
int _EXFUN(isxdigit,(int __c));
int _EXFUN(isxdigit,(int __c));
int _EXFUN(tolower, (int __c));
int _EXFUN(tolower, (int __c));
int _EXFUN(toupper, (int __c));
int _EXFUN(toupper, (int __c));
 
 
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
int _EXFUN(isblank, (int __c));
int _EXFUN(isblank, (int __c));
#endif
#endif
 
 
#ifndef __STRICT_ANSI__
#ifndef __STRICT_ANSI__
int _EXFUN(isascii, (int __c));
int _EXFUN(isascii, (int __c));
int _EXFUN(toascii, (int __c));
int _EXFUN(toascii, (int __c));
#define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a')
#define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a')
#define _toupper(__c) ((unsigned char)(__c) - 'a' + 'A')
#define _toupper(__c) ((unsigned char)(__c) - 'a' + 'A')
#endif
#endif
 
 
#define _U      01
#define _U      01
#define _L      02
#define _L      02
#define _N      04
#define _N      04
#define _S      010
#define _S      010
#define _P      020
#define _P      020
#define _C      040
#define _C      040
#define _X      0100
#define _X      0100
#define _B      0200
#define _B      0200
 
 
#ifndef _MB_CAPABLE
#ifndef _MB_CAPABLE
_CONST
_CONST
#endif
#endif
extern  __IMPORT char   *__ctype_ptr__;
extern  __IMPORT char   *__ctype_ptr__;
 
 
#ifndef __cplusplus
#ifndef __cplusplus
/* These macros are intentionally written in a manner that will trigger
/* These macros are intentionally written in a manner that will trigger
   a gcc -Wall warning if the user mistakenly passes a 'char' instead
   a gcc -Wall warning if the user mistakenly passes a 'char' instead
   of an int containing an 'unsigned char'.  Note that the sizeof will
   of an int containing an 'unsigned char'.  Note that the sizeof will
   always be 1, which is what we want for mapping EOF to __ctype_ptr__[0];
   always be 1, which is what we want for mapping EOF to __ctype_ptr__[0];
   the use of a raw index inside the sizeof triggers the gcc warning if
   the use of a raw index inside the sizeof triggers the gcc warning if
   __c was of type char, and sizeof masks side effects of the extra __c.
   __c was of type char, and sizeof masks side effects of the extra __c.
   Meanwhile, the real index to __ctype_ptr__+1 must be cast to int,
   Meanwhile, the real index to __ctype_ptr__+1 must be cast to int,
   since isalpha(0x100000001LL) must equal isalpha(1), rather than being
   since isalpha(0x100000001LL) must equal isalpha(1), rather than being
   an out-of-bounds reference on a 64-bit machine.  */
   an out-of-bounds reference on a 64-bit machine.  */
#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])
#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])
 
 
#define isalpha(__c)    (__ctype_lookup(__c)&(_U|_L))
#define isalpha(__c)    (__ctype_lookup(__c)&(_U|_L))
#define isupper(__c)    ((__ctype_lookup(__c)&(_U|_L))==_U)
#define isupper(__c)    ((__ctype_lookup(__c)&(_U|_L))==_U)
#define islower(__c)    ((__ctype_lookup(__c)&(_U|_L))==_L)
#define islower(__c)    ((__ctype_lookup(__c)&(_U|_L))==_L)
#define isdigit(__c)    (__ctype_lookup(__c)&_N)
#define isdigit(__c)    (__ctype_lookup(__c)&_N)
#define isxdigit(__c)   (__ctype_lookup(__c)&(_X|_N))
#define isxdigit(__c)   (__ctype_lookup(__c)&(_X|_N))
#define isspace(__c)    (__ctype_lookup(__c)&_S)
#define isspace(__c)    (__ctype_lookup(__c)&_S)
#define ispunct(__c)    (__ctype_lookup(__c)&_P)
#define ispunct(__c)    (__ctype_lookup(__c)&_P)
#define isalnum(__c)    (__ctype_lookup(__c)&(_U|_L|_N))
#define isalnum(__c)    (__ctype_lookup(__c)&(_U|_L|_N))
#define isprint(__c)    (__ctype_lookup(__c)&(_P|_U|_L|_N|_B))
#define isprint(__c)    (__ctype_lookup(__c)&(_P|_U|_L|_N|_B))
#define isgraph(__c)    (__ctype_lookup(__c)&(_P|_U|_L|_N))
#define isgraph(__c)    (__ctype_lookup(__c)&(_P|_U|_L|_N))
#define iscntrl(__c)    (__ctype_lookup(__c)&_C)
#define iscntrl(__c)    (__ctype_lookup(__c)&_C)
 
 
#if defined(__GNUC__) && \
#if defined(__GNUC__) && \
    (!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L)
    (!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L)
#define isblank(__c) \
#define isblank(__c) \
  __extension__ ({ __typeof__ (__c) __x = (__c);                \
  __extension__ ({ __typeof__ (__c) __x = (__c);                \
        (__ctype_lookup(__x)&_B) || (int) (__x) == '\t';})
        (__ctype_lookup(__x)&_B) || (int) (__x) == '\t';})
#endif
#endif
 
 
 
 
/* Non-gcc versions will get the library versions, and will be
/* Non-gcc versions will get the library versions, and will be
   slightly slower.  These macros are not NLS-aware so they are
   slightly slower.  These macros are not NLS-aware so they are
   disabled if the system supports the extended character sets. */
   disabled if the system supports the extended character sets. */
# if defined(__GNUC__)
# if defined(__GNUC__)
#  if !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS)
#  if !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS)
#   define toupper(__c) \
#   define toupper(__c) \
  __extension__ ({ __typeof__ (__c) __x = (__c);        \
  __extension__ ({ __typeof__ (__c) __x = (__c);        \
      islower (__x) ? (int) __x - 'a' + 'A' : (int) __x;})
      islower (__x) ? (int) __x - 'a' + 'A' : (int) __x;})
#   define tolower(__c) \
#   define tolower(__c) \
  __extension__ ({ __typeof__ (__c) __x = (__c);        \
  __extension__ ({ __typeof__ (__c) __x = (__c);        \
      isupper (__x) ? (int) __x - 'A' + 'a' : (int) __x;})
      isupper (__x) ? (int) __x - 'A' + 'a' : (int) __x;})
#  else /* _MB_EXTENDED_CHARSETS* */
#  else /* _MB_EXTENDED_CHARSETS* */
/* Allow a gcc warning if the user passed 'char', but defer to the
/* Allow a gcc warning if the user passed 'char', but defer to the
   function.  */
   function.  */
#   define toupper(__c) \
#   define toupper(__c) \
  __extension__ ({ __typeof__ (__c) __x = (__c);        \
  __extension__ ({ __typeof__ (__c) __x = (__c);        \
      (void) __ctype_ptr__[__x]; (toupper) (__x);})
      (void) __ctype_ptr__[__x]; (toupper) (__x);})
#   define tolower(__c) \
#   define tolower(__c) \
  __extension__ ({ __typeof__ (__c) __x = (__c);        \
  __extension__ ({ __typeof__ (__c) __x = (__c);        \
      (void) __ctype_ptr__[__x]; (tolower) (__x);})
      (void) __ctype_ptr__[__x]; (tolower) (__x);})
#  endif /* _MB_EXTENDED_CHARSETS* */
#  endif /* _MB_EXTENDED_CHARSETS* */
# endif /* __GNUC__ */
# endif /* __GNUC__ */
#endif /* !__cplusplus */
#endif /* !__cplusplus */
 
 
#ifndef __STRICT_ANSI__
#ifndef __STRICT_ANSI__
#define isascii(__c)    ((unsigned)(__c)<=0177)
#define isascii(__c)    ((unsigned)(__c)<=0177)
#define toascii(__c)    ((__c)&0177)
#define toascii(__c)    ((__c)&0177)
#endif
#endif
 
 
/* For C++ backward-compatibility only.  */
/* For C++ backward-compatibility only.  */
extern  __IMPORT _CONST char    _ctype_[];
extern  __IMPORT _CONST char    _ctype_[];
 
 
_END_STD_C
_END_STD_C
 
 
#endif /* _CTYPE_H_ */
#endif /* _CTYPE_H_ */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.