/* See LICENSE file for copyright and license details. */ #ifndef UTIL_H #define UTIL_H #include /* Memory allocation with error handling */ void *xmalloc(size_t size); void *xrealloc(void *ptr, size_t size); char *xstrdup(const char *s); /* String utilities */ char *str_trim(char *str); int str_starts_with(const char *str, const char *prefix); int str_ends_with(const char *str, const char *suffix); /* Error handling */ void die(const char *fmt, ...); void warn(const char *fmt, ...); #endif /* UTIL_H */