ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
Functions
mathio.c File Reference

String to number conversions with floating point support. More...

#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include "mathio.h"
#include <math.h>

Go to the source code of this file.

Functions

MEMSPACE int atodigit (int c, int radix)
 Convert ASCII character to radix based digit , or -1. More...
 
MEMSPACE long atoh (const char *p)
 Convert ASCII hex string to long integer. More...
 
MEMSPACE long aton (char *str, int base)
 Convert ASCII string to number in a given base. More...
 
MEMSPACE int mul10str (uint8_t *str, int size)
 Fast multiply number of any size by 10. More...
 
MEMSPACE long strtol (const char *nptr, char **endptr, int base)
 Convert ASCII string to number in a given base. More...
 
MEMSPACE long long strtoll (const char *nptr, char **endptr, int base)
 Convert ASCII string to number in a given base. More...
 
MEMSPACE int atoi (const char *str)
 Convert ASCII string to number in base 10. More...
 
MEMSPACE long atol (const char *str)
 Convert ASCII string to number in base 10. More...
 

Detailed Description

String to number conversions with floating point support.

Copyright © 2014-2017 Mike Gore, All rights reserved. GPL License
See also
http://github.com/magore/hp85disk
http://github.com/magore/hp85disk/COPYRIGHT.md for specific Copyright details
You are free to use this code under the terms of GPL
please retain a copy of this notice in any code you use it in.

This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file mathio.c.

Function Documentation

MEMSPACE int atodigit ( int  c,
int  radix 
)

Convert ASCII character to radix based digit , or -1.

Parameters
[in]ccharacter
[in]radixradix
Returns
radix based digit , or -1
See also
strtol

Definition at line 58 of file mathio.c.

Referenced by process_args(), strtol(), and strtoll().

MEMSPACE long atoh ( const char *  p)

Convert ASCII hex string to long integer.

Parameters
[in]pString to convert.
Returns
long integer result.
See also
strtol() for return overflow and underflow results.

Definition at line 79 of file mathio.c.

MEMSPACE int atoi ( const char *  str)

Convert ASCII string to number in base 10.

Parameters
[in]strstring
Returns
int value
See also
strtol

Definition at line 281 of file mathio.c.

Referenced by html_status(), main(), parse_http_request(), posix_tests(), ReadBdf(), and user_tests().

MEMSPACE long atol ( const char *  str)

Convert ASCII string to number in base 10.

Parameters
[in]strstring
Returns
long value
See also
strtol

Definition at line 295 of file mathio.c.

Referenced by fatfs_tests().

MEMSPACE long aton ( char *  str,
int  base 
)

Convert ASCII string to number in a given base.

Parameters
[in]strstring
[in]baseradix
Returns
long value
See also
strtol

Definition at line 93 of file mathio.c.

MEMSPACE int mul10str ( uint8_t str,
int  size 
)

Fast multiply number of any size by 10.

Parameters
[in]strstring
[in]sizestring size
Returns
non-zero on overflow , 0 if ok

Definition at line 108 of file mathio.c.

MEMSPACE long strtol ( const char *  nptr,
char **  endptr,
int  base 
)

Convert ASCII string to number in a given base.

Parameters
[in]nptrstring
[in]endptrpointer to string pointer return value
[in]baseradix
Returns
long value

Definition at line 136 of file mathio.c.

Referenced by atoh(), atoi(), atol(), aton(), get_value(), main(), posix_tests(), and setdate_r().

MEMSPACE long long strtoll ( const char *  nptr,
char **  endptr,
int  base 
)

Convert ASCII string to number in a given base.

Parameters
[in]nptrstring
[in]endptrpointer to string pointer return value
[in]baseradix
Returns
long long

Definition at line 183 of file mathio.c.