00001 /* sqlNum.h - routines to convert from ascii to 00002 * unsigned/integer a bit more quickly than atoi. 00003 * 00004 * This file is copyright 2002 Jim Kent, but license is hereby 00005 * granted for all use - public, private or commercial. */ 00006 00007 #ifndef SQLNUM_H 00008 #define SQLNUM_H 00009 00010 /* get off_t */ 00011 #include <sys/types.h> 00012 00013 unsigned sqlUnsigned(char *s); 00014 /* Convert series of digits to unsigned integer about 00015 * twice as fast as atoi (by not having to skip white 00016 * space or stop except at the null byte.) */ 00017 00018 unsigned long sqlUnsignedLong(char *s); 00019 /* Convert series of digits to unsigned long about 00020 * twice as fast as atol (by not having to skip white 00021 * space or stop except at the null byte.) */ 00022 00023 int sqlSigned(char *s); 00024 /* Convert string to signed integer. Unlike atol assumes 00025 * all of string is number. */ 00026 00027 long long sqlLongLong(char *s); 00028 /* Convert string to a long long. Unlike atol assumes all of string is 00029 * number. */ 00030 00031 float sqlFloat(char *s); 00032 /* Convert string to a float. Assumes all of string is number 00033 * and aborts on an error. */ 00034 00035 double sqlDouble(char *s); 00036 /* Convert string to a double. Assumes all of string is number 00037 * and aborts on an error. */ 00038 00039 #endif /* SQLNUM_H */ 00040
1.5.2