Subversion Repositories Kolibri OS

Rev

Rev 4874 | Blame | Compare with Previous | Last modification | View Log | RSS feed

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