Subversion Repositories Kolibri OS

Rev

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

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