#pragma once #include void copyUntilStr(char* destination, char* source, const char* cmpstr) { int index = 0; char* ptr = source; int cmpStrLen = strlen(cmpstr); while (strncmp(ptr, cmpstr, cmpStrLen) != 0) { destination[index++] = *ptr; ptr++; } destination[index] = '\0'; } int endsWith(const char *str, const char *suffix) { size_t str_len = strlen(str); size_t suffix_len = strlen(suffix); return (str_len >= suffix_len) && (!memcmp(str + str_len - suffix_len, suffix, suffix_len)); } void getCurrentDateStr(char* text) { time_t now = time(NULL); sprintf(text, "%s GMT", ctime(&now)); }