Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1.  
  2. /*
  3. FUNCTION
  4. <<isupper>>---uppercase character predicate
  5.  
  6. INDEX
  7. isupper
  8.  
  9. ANSI_SYNOPSIS
  10. #include <ctype.h>
  11. int isupper(int <[c]>);
  12.  
  13. TRAD_SYNOPSIS
  14. #include <ctype.h>
  15. int isupper(<[c]>);
  16.  
  17. DESCRIPTION
  18. <<isupper>> is a macro which classifies ASCII integer values by table
  19. lookup.  It is a predicate returning non-zero for uppercase letters
  20. (<<A>>--<<Z>>), and 0 for other characters.  It is defined only when
  21. <<isascii>>(<[c]>) is true or <[c]> is EOF.
  22.  
  23. You can use a compiled subroutine instead of the macro definition by
  24. undefining the macro using `<<#undef isupper>>'.
  25.  
  26. RETURNS
  27. <<isupper>> returns non-zero if <[c]> is a uppercase letter (A-Z).
  28.  
  29. PORTABILITY
  30. <<isupper>> is ANSI C.
  31.  
  32. No supporting OS subroutines are required.
  33. */
  34. #include <_ansi.h>
  35. #include <ctype.h>
  36.  
  37. #undef isupper
  38. int
  39. _DEFUN(isupper,(c),int c)
  40. {
  41.         return ((__ctype_ptr__[c+1] & (_U|_L)) == _U);
  42. }
  43.  
  44.