+int
+is_number(char *p)
+{
+ if(!p || !*p || (*p == '-' && !*++p))
+ return 0;
+
+ for(; *p; p++)
+ if(!isdigit(*p))
+ return 0;
+
+ return 1;
+}
+
+#ifndef HAVE_STRCASESTR
+char *
+strcasestr(const char *haystack, const char *needle)
+{
+ int i;
+ int k;
+
+ assert(haystack != NULL);
+ assert(needle != NULL);
+
+ for(i=0; i<strlen(haystack)-strlen(needle)+1; i++) {
+ for(k=0; k<strlen(needle); k++, i++) {
+ if (tolower(haystack[i]) != tolower(needle[k]))
+ break;
+ else if ((k+1) == strlen(needle))
+ return &haystack[i];
+ }
+ }
+
+ return NULL;
+}
+#endif