From 3a11866cb6a8fd46d86cb6e04dc1022344ea8d45 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 8 May 2022 18:40:14 +0200 Subject: feat: add connecting to wifi --- src/util.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/util.hpp (limited to 'src/util.hpp') diff --git a/src/util.hpp b/src/util.hpp new file mode 100644 index 0000000..d6f7f1c --- /dev/null +++ b/src/util.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include +#include +#include + +namespace util +{ + +template +Type *malloc(size_t size) noexcept +{ + return static_cast(::malloc(size)); +} + +bool str_ends_with(const char *str, const char *other_str) noexcept; + +/** + * 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; + +} // namespace util -- cgit v1.2.3-18-g5258