Functions | |
| const char * | get_psm_charger_type (PsmChargerType type) |
| string representation of charger type | |
| void | get_time_string (char *buffer, int size) |
| get current time as formatted string | |
| void * | safe_malloc (size_t size) |
| safe malloc with zero-initialization | |
| char * | safe_strdup (const char *src) |
| safe strdup | |
| void | set_dynamic_string (char **field, const char *value) |
| set dynamic string field with memory management | |
| ssize_t | safe_write (int fd, const char *buf, size_t len) |
| safe socket write with retry | |
| static size_t | write_memory_callback (void *contents, size_t size, size_t nmemb, void *userp) |
| CURL write callback for memory buffer. | |
| void | replace_placeholder (char **str, const char *placeholder, const char *value) |
| replace all occurrences of placeholder in string (html) with value | |
| const char * get_psm_charger_type | ( | PsmChargerType | type | ) |
| void get_time_string | ( | char * | buffer, |
| int | size | ||
| ) |
| void replace_placeholder | ( | char ** | str, |
| const char * | placeholder, | ||
| const char * | value | ||
| ) |
replace all occurrences of placeholder in string (html) with value
| str | ptr to the string pointer that contains placeholders to replace. |
| placeholder | the placeholder text to search for in the string (e.g., "@@HASHRATE@@"). |
| value | the replacement text to substitute for the placeholder. |
| void * safe_malloc | ( | size_t | size | ) |
| char * safe_strdup | ( | const char * | src | ) |
| ssize_t safe_write | ( | int | fd, |
| const char * | buf, | ||
| size_t | len | ||
| ) |
| void set_dynamic_string | ( | char ** | field, |
| const char * | value | ||
| ) |
|
static |
CURL write callback for memory buffer.
| contents | received data |
| size | size of data |
| nmemb | number of elements |
| userp | ptr to MemoryStruct |