1#include "main-header.h"
4int atoi(
const char *s) {
13 int z = ascii_parse_num(s[pos]);
24byte atoh(
const char *s) {
41int ascii_parse_num(
int b) {
42 if ((b <
'0') || (b >
'9')) {
47int ascii_parse_int(
const byte *buf,
int size,
int *
const newpos) {
53 CNWDEBUG(
"attempt to parse ascii int with size %i\r\n", size);
56 while (consumed < size) {
57 int b = ascii_parse_num(buf[consumed]);
71long ascii_parse_hex(
const byte *buf,
int size,
int *newpos) {
82 CNWDEBUG(
"attempt to parse ascii hex with size %i\r\n", size);
85 while (consumed < size) {
86 int t = charToHex(buf[consumed]);