home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d183 / mklib.lha / Mklib / Edlib / hextoint.c < prev    next >
C/C++ Source or Header  |  1989-02-26  |  374b  |  19 lines

  1. /* edlib  version 1.0 of 04/08/88 */
  2. /* this function takes a string of hex digits and returns its value */
  3. #include <ctype.h>
  4.  
  5. int hextoint(number)
  6. char *number;
  7. {
  8.     int value = 0;
  9.  
  10.     while ( *number )
  11.         if ( isxdigit(*number) ) {
  12.             value = ( value << 4 )  + toint(*number++);
  13.         } else {
  14.             return(value);
  15.         }
  16.  
  17.     return(value);
  18. }
  19.