tutil.h - iomenu - interactive terminal-based selection menu HTML git clone git://bitreich.org/iomenu git://hg6vgqziawt5s4dj.onion/iomenu DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- tutil.h (716B) --- 1 /* 2 ** EPITECH PROJECT, 2017 3 ** util 4 ** File description: 5 ** util 6 */ 7 8 #ifndef UTIL_H 9 #define UTIL_H 10 11 #include <stdarg.h> 12 13 #define ESC 0x1b /* Esc key */ 14 #define CTL(c) ((c) & ~0x40) /* Ctr + (c) key */ 15 #define ALT(c) ((c) + 0x80) /* Alt + (c) key */ 16 #define CSI(c) ((c) + 0x80 + 0x80) /* Escape + '[' + (c) code */ 17 #define MIN(x, y) (((x) < (y)) ? (x) : (y)) 18 #define MAX(x, y) (((x) > (y)) ? (x) : (y)) 19 #define LEN(x) (sizeof(x) / sizeof(*(x))) 20 21 /* string */ 22 char *strcasestr(const char *, const char *); 23 size_t strlcpy(char *, const char *, size_t); 24 char *strsep(char **, const char *); 25 26 /* error */ 27 void err(int, const char *, ...); 28 void vwarn(const char *, va_list); 29 void warn(const char *, ...); 30 31 #endif