common.h (315B)
1 #pragma once 2 3 /** 4 * program dies, if pid == 1 the program hangs in a while(1)-loop otherwise exit(1) 5 */ 6 void die() __attribute__((noreturn)); 7 8 /** 9 * strdup but it returns NULL if `str` is empty 10 */ 11 char* strdupn(const char* str); 12 13 /** 14 * just comparing strings 15 */ 16 #define streq(a, b) \ 17 (strcmp((a), (b)) == 0)