Subversion Repositories Kolibri OS

Rev

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

  1.  
  2. /*
  3. FUNCTION
  4. <<isxdigit>>---hexadecimal digit predicate
  5.  
  6. INDEX
  7. isxdigit
  8.  
  9. ANSI_SYNOPSIS
  10. #include <ctype.h>
  11. int isxdigit(int <[c]>);
  12.  
  13. TRAD_SYNOPSIS
  14. #include <ctype.h>
  15. int isxdigit(int <[c]>);
  16.  
  17. DESCRIPTION
  18. <<isxdigit>> is a macro which classifies ASCII integer values by table
  19. lookup.  It is a predicate returning non-zero for hexadecimal digits,
  20. and <<0>> for other characters.  It is defined only if <[c]> is
  21. representable as an 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 isxdigit>>'.
  25.  
  26. RETURNS
  27. <<isxdigit>> returns non-zero if <[c]> is a hexadecimal digit
  28. (<<0>>--<<9>>, <<a>>--<<f>>, or <<A>>--<<F>>).
  29.  
  30. PORTABILITY
  31. <<isxdigit>> is ANSI C.
  32.  
  33. No supporting OS subroutines are required.
  34. */
  35. #include <_ansi.h>
  36. #include <ctype.h>
  37.  
  38.  
  39. #undef isxdigit
  40. int
  41. _DEFUN(isxdigit,(c),int c)
  42. {
  43.         return(__ctype_ptr__[c+1] & ((_X)|(_N)));
  44. }
  45.  
  46.