the hito embeddable programming language
at main 18 lines 535 B view raw
1#ifndef util_h 2#define util_h 3#include <stdnoreturn.h> 4#include <stdbool.h> 5#include <stddef.h> 6bool starts_with_any_impl(const char *str, ...); 7#define starts_with_any(str, ...) starts_with_any_impl(str, __VA_ARGS__, NULL) 8 9noreturn void die_impl(const char *file, int line, const char *fmt, ...); 10 11// Simple FNV-1a hash for strings 12size_t hash_buffer(const char *buf, size_t len); 13size_t hash_string(const char *str); 14 15// Macro to capture file and line automatically 16#define die(...) die_impl(__FILE__, __LINE__, __VA_ARGS__) 17 18#endif