MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / string_data

Function string_data

string/std_string.c:1763–1770  ·  view source on GitHub ↗

* @brief Returns the raw string data. * * This function returns a pointer to the character array managed by the String object. * If the input String is NULL or uninitialized, an error is logged, and the function returns NULL. * * @param str The String object to retrieve data from. Must not be NULL. * @return A pointer to the character data, or NULL on error. */

Source from the content-addressed store, hash-verified

1761
1762 if (str == NULL) {
1763 STRING_LOG("[string_to_int]: Error - Null String object.");
1764 return 0;
1765 }
1766 if (string_empty(str)) {
1767 STRING_LOG("[string_to_int]: Error - Empty string.");
1768 return 0;
1769 }
1770
1771 int result = atoi(str->dataStr);
1772 STRING_LOG("[string_to_int]: Converted '%s' to integer %d.", str->dataStr, result);
1773 STRING_LOG("[string_to_int]: Function end.");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected