#pragma once #include #include #include namespace util { template auto malloc(size_t size) noexcept -> Type * { return static_cast(::malloc(size)); } auto str_ends_with(const char *str, const char *other_str) noexcept -> bool; /** * Extracts a portion of a string. * * @param str The target string. * @param end A pointer to a place inside the target string. * @param dest Output buffer. */ void substr(const char *str, const char *end, char *dest) noexcept; /** * Compares two strings. * * Wrapper function for strcmp. * * @param str_one The first string. * @param str_two The second string. * * @returns Whether or not the two string are the same. */ auto streq(const char *str_one, const char *str_two) noexcept -> bool; void quit() noexcept; } // namespace util