1 /* port.c 4/10/1995 2 * Functions missing on some OSs. 3 */ 4 5 /* This file has been placed int the PUBLIC DOMAIN by the author. 6 */ 7 8 #include "config.h" 9 10 #include <ctype.h> 11 #include <sys/types.h> 12 #include <sys/time.h> 13 #include <unistd.h> 14 #ifndef FD_ZERO 15 #include <poll.h> 16 #endif 17 18 #if !HAVE_STRCMP 19 int strcmp(const char * a,const char * b)20strcmp(const char *a, const char *b) 21 { 22 while (*a && *b && *a == *b) ++a, ++b; 23 return *a > *b ? 1 : *a < *b ? -1 : 0; 24 } 25 /* strcmp */ 26 #endif 27 28 #if !HAVE_STRCASECMP 29 int strcasecmp(const char * s1,const char * s2)30strcasecmp(const char *s1, const char *s2) 31 { 32 while (*s1 && *s2 && tolower(*s1) == tolower(*s2)) ++s1, ++s2; 33 return *s1 > *s2 ? 1 : *s1 < *s2 ? -1 : 0; 34 } 35 /* strcasecmp */ 36 #endif 37 38 /* end of port.c */ 39 40 41 /* VIM configuration: (do not delete this line) 42 * 43 * vim:bk:nodg:efm=%f\:%l\:%m:hid:icon: 44 * vim:sw=2:sm:textwidth=79:ul=1024:wrap: 45 */ 46