hextolfp.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 1996 by Sun Microsystems, Inc.
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* hextolfp - convert an ascii hex string to an l_fp number
*/
#include <stdio.h>
#include <ctype.h>
#include "ntp_fp.h"
#include "ntp_string.h"
#include "ntp_stdlib.h"
int
const char *str;
{
register const char *cp;
register const char *cpstart;
static const char *digits = "0123456789abcdefABCDEF";
/*
* We understand numbers of the form:
*
* [spaces]8_hex_digits[.]8_hex_digits[spaces|\n|\0]
*/
cp++;
cp++;
}
return 0;
if (*cp == '.')
cp++;
cp++;
}
return 0;
return 0;
return 1;
}