strtol10.c File Reference
Poor man's hex arrays (implementation). More...
#include "strtol10.h"#include <cfg/compiler.h>Go to the source code of this file.
Functions | |
| bool | strtoul10 (const char *first, const char *last, unsigned long *val) |
| Convert a formatted base-10 ASCII number to unsigned long binary representation. | |
| bool | strtol10 (const char *first, const char *last, long *val) |
| Convert a formatted base-10 ASCII number to signed long binary representation. | |
Detailed Description
Poor man's hex arrays (implementation).
Definition in file strtol10.c.
Function Documentation
| bool strtol10 | ( | const char * | first, | |
| const char * | last, | |||
| long * | val | |||
| ) |
Convert a formatted base-10 ASCII number to signed long binary representation.
- See also:
- strtoul10()
Definition at line 80 of file strtol10.c.
| bool strtoul10 | ( | const char * | first, | |
| const char * | last, | |||
| unsigned long * | val | |||
| ) |
Convert a formatted base-10 ASCII number to unsigned long binary representation.
Unlike the standard strtoul(), this function has an interface that makes it better suited for protocol parsers. It's also much simpler and smaller than a full featured strtoul().
- Parameters:
-
first Pointer to first byte of input range (STL-style). last Pointer to end of input range (STL-style). Pass NULL to parse up to the first \0. val Pointer to converted value.
- Returns:
- true for success, false for failure.
- See also:
- strtol10()
Definition at line 56 of file strtol10.c.
