util.h (433B)
1 2 #ifndef CHIBIPUB_UTIL 3 #define CHIBIPUB_UTIL 4 5 #include <ctype.h> 6 #include <string.h> 7 8 #include "cursor.h" 9 10 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) 11 12 static inline int stricmp(const char *a, const char *b) { 13 int len, i; 14 15 if ((len = strlen(a)) != strlen(b)) 16 return 0; 17 18 for (i = 0; i < len; i++) { 19 if (tolower(a[i]) != tolower(b[i])) 20 return 0; 21 } 22 23 return 1; 24 } 25 26 void print_around(struct cursor *cur, int range); 27 28 #endif