From 41fff233f29b6ee7274f4bf525052dcf0fa56c00 Mon Sep 17 00:00:00 2001 From: neonloop Date: Sat, 21 Aug 2021 00:10:44 +0000 Subject: Updates message display and adds loading message to pcsx --- util.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 util.h (limited to 'util.h') diff --git a/util.h b/util.h new file mode 100644 index 0000000..641165b --- /dev/null +++ b/util.h @@ -0,0 +1,21 @@ +#ifndef UTIL_H +#define UTIL_H + +#include +#include + +#define MAX(a, b) (a) > (b) ? (a) : (b) +#define MIN(a, b) (a) < (b) ? (a) : (b) + +#define array_size(x) (sizeof(x) / sizeof(x[0])) + +static inline bool has_suffix_i(const char *str, const char *suffix) { + const char *p = strrchr(str, suffix[0]); + if (!p) p = str; + return !strcasecmp(p, suffix); +} + +void string_truncate(char *string, size_t max_len); +void string_wrap(char *string, size_t max_len, size_t max_lines); + +#endif -- cgit v1.2.3