main uint/cterm / include / utils.h
 1#ifndef UTILS_H
 2#define UTILS_H
 3
 4#include <stddef.h>
 5#include <stdint.h>
 6
 7/* perror `msg` and exit program with `ec`
 8   TODO? stdarg */
 9void die(int ec, const char* msg);
10
11/* pack r, g, b and a into u32 (AARRGGBB) */
12uint32_t rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
13
14/* malloc, die on failure */
15void* xmalloc(size_t len);
16
17#endif /* UTILS_H */