move string conversion functions to stdlib.h

This commit is contained in:
Stefan Lankes 2013-11-13 21:34:32 +01:00
parent 9e8509a1c1
commit dcf3f79e9b
2 changed files with 31 additions and 25 deletions

View file

@ -37,33 +37,13 @@ extern "C" {
#define NULL ((void*) 0)
/*
* macros, which are later used to determine the core id
* and their "private" data
*/
#define per_core(name) name
#define CORE_ID 0
/** @brief String to long
*
* @return Long value of the parsed numerical string
*/
long strtol(const char* str, char** endptr, int base);
/** @brief String to unsigned long
*
* @return Unsigned long value of the parsed numerical string
*/
unsigned long strtoul(const char* nptr, char** endptr, int base);
/** @brief ASCII to integer
*
* Convenience function using strtol().
*
* @return Integer value of the parsed numerical string
*/
static inline int atoi(const char *str)
{
return (int)strtol(str, (char **)NULL, 10);
}
#ifdef __cplusplus
}
#endif

View file

@ -38,13 +38,39 @@
#define __STDLIB_H__
#include <eduos/config.h>
#include <eduos/tasks_types.h>
#include <asm/stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/** @brief String to long
*
* Convert a string value to a long
*
* @return Long value of the parsed numerical string
*/
long strtol(const char* str, char** endptr, int base);
/** @brief String to unsigned long
*
* Convert a string value to a unsigned long
*
* @return Unsigned long value of the parsed numerical string
*/
unsigned long strtoul(const char* nptr, char** endptr, int base);
/** @brief ASCII to integer
*
* Convert ASCII string to integer
*
* @return Integer value of the parsed numerical string
*/
static inline int atoi(const char *str)
{
return (int)strtol(str, (char **)NULL, 10);
}
#ifdef __cplusplus
}
#endif