Subversion Repositories Kolibri OS

Rev

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

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