2 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
3 #define IS(w, y) !strcmp(w, y)
4 #define IS_START(w, y) !strncmp(w, y, strlen(y))
6 // read a line, truncating it if it doesn't fit
7 static inline char *my_fgets(char *s, size_t size, FILE *stream)
17 ret = fgets(s, size, stream);
18 if (ret != NULL && p >= 0 && s[p] != 0 && s[p] != '\n') {
22 ret2 = fgets(buf, sizeof(buf), stream);
24 while (ret2 != NULL && buf[p] != 0 && buf[p] != '\n');