Go to the source code of this file.
◆ 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.