cmd screen

This commit is contained in:
2025-10-06 19:18:30 -05:00
parent fc52afdb00
commit cf2e6bf382
3 changed files with 101 additions and 0 deletions

View File

@@ -133,6 +133,20 @@ bool_t stringToU16(const char_t *str, uint16_t *out) {
return true;
}
bool_t stringToF32(const char_t *str, float_t *out) {
assertNotNull(str, "str must not be NULL");
assertNotNull(out, "out must not be NULL");
char_t *endptr;
errno = 0;
float_t result = strtof(str, &endptr);
if (errno != 0 || *endptr != '\0') {
return false;
}
*out = result;
return true;
}
bool_t stringEndsWith(const char_t *str, const char_t *suffix) {
assertNotNull(str, "str must not be NULL");
assertNotNull(suffix, "suffix must not be NULL");

View File

@@ -127,6 +127,15 @@ bool_t stringToI16(const char_t *str, int16_t *out);
*/
bool_t stringToU16(const char_t *str, uint16_t *out);
/**
* Converts a string to a float.
*
* @param str The string to convert.
* @param out The output float.
* @return TRUE if the conversion was successful, FALSE otherwise.
*/
bool_t stringToF32(const char_t *str, float_t *out);
/**
* Determines if a string ends with a specified suffix.
*