#include "util.hpp" namespace util { auto str_ends_with(const char *target, size_t target_end, const char *other) noexcept -> bool { if (target == nullptr || other == nullptr) { return false; } const auto other_str_length = strlen(other); if (other_str_length > target_end) { return false; } return strncmp(target + target_end - other_str_length, other, other_str_length) == 0; } void substr(const char *str, const char *end, char *dest) noexcept { auto *dest_head = dest; for (const char *char_ptr = str; char_ptr != end; ++char_ptr) { *dest_head = *char_ptr; dest_head++; } } auto streq(const char *str_one, const char *str_two) noexcept -> bool { return strcmp(str_one, str_two) == 0; } void quit() noexcept { while (true) ; } } // namespace util