Subversion Repositories Kolibri OS

Rev

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

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