#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
|
long | shell_strtol (const char *str, int base, int *err) |
| String to long conversion with error check.
|
|
unsigned long | shell_strtoul (const char *str, int base, int *err) |
| String to unsigned long conversion with error check.
|
|
unsigned long long | shell_strtoull (const char *str, int base, int *err) |
| String to unsigned long long conversion with error check.
|
|
bool | shell_strtobool (const char *str, int base, int *err) |
| String to boolean conversion with error check.
|
|
◆ shell_strtobool()
bool shell_strtobool |
( |
const char * | str, |
|
|
int | base, |
|
|
int * | err ) |
String to boolean conversion with error check.
- Warning
- On success the passed err reference will not be altered to avoid err check bloating. Passed err reference should be initialized to zero.
- Parameters
-
str | Input string. |
base | Conversion base. |
err | Error code pointer: Set to -EINVAL on invalid string input. Set to -ERANGE if numeric string input is to large to convert. Unchanged on success. |
- Returns
- Converted boolean value.
◆ shell_strtol()
long shell_strtol |
( |
const char * | str, |
|
|
int | base, |
|
|
int * | err ) |
String to long conversion with error check.
- Warning
- On success the passed err reference will not be altered to avoid err check bloating. Passed err reference should be initialized to zero.
- Parameters
-
str | Input string. |
base | Conversion base. |
err | Error code pointer: -EINVAL on invalid string input. -ERANGE if numeric string input is to large to convert. Unchanged on success. |
- Returns
- Converted long value.
◆ shell_strtoul()
unsigned long shell_strtoul |
( |
const char * | str, |
|
|
int | base, |
|
|
int * | err ) |
String to unsigned long conversion with error check.
- Warning
- On success the passed err reference will not be altered to avoid err check bloating. Passed err reference should be initialized to zero.
- Parameters
-
str | Input string. |
base | Conversion base. |
err | Error code pointer: Set to -EINVAL on invalid string input. Set to -ERANGE if numeric string input is to large to convert. Unchanged on success. |
- Returns
- Converted unsigned long value.
◆ shell_strtoull()
unsigned long long shell_strtoull |
( |
const char * | str, |
|
|
int | base, |
|
|
int * | err ) |
String to unsigned long long conversion with error check.
- Warning
- On success the passed err reference will not be altered to avoid err check bloating. Passed err reference should be initialized to zero.
- Parameters
-
str | Input string. |
base | Conversion base. |
err | Error code pointer: Set to -EINVAL on invalid string input. Set to -ERANGE if numeric string input is to large to convert. Unchanged on success. |
- Returns
- Converted unsigned long long value.