util.h (422B)
1#pragma once 2 3#include <stddef.h> 4 5#define MIN(a, b) ((a) < (b) ? (a) : (b)) 6#define MAX(a, b) ((a) < (b) ? (b) : (a)) 7#define ABS(a) ((a) > 0 ? (a) : -(a)) 8 9__attribute__((noreturn)) 10__attribute__((format(printf, 1, 2))) 11void die(const char *fmt, ...); 12 13size_t strdcpy(char *dst, const char *src, size_t n); 14size_t strdcat(char *dst, const char *src, size_t n); 15 16extern const char *progname; 17extern int (*cleanup)(void);