]> sjero.net Git - wget/blobdiff - src/cmpt.c
[svn] Windows fixes by Herold Heiko.
[wget] / src / cmpt.c
index 4b4d68cb4b34e9bc3b76689f9f3ec258b2e113fa..6fb7fc0413442c82a406ee53f304fdc781b5902b 100644 (file)
@@ -205,6 +205,24 @@ ret0:
 }
 #endif /* not HAVE_STRSTR */
 
+#ifndef HAVE_STRPBRK
+/* Find the first ocurrence in S of any character in ACCEPT.  */
+char *
+strpbrk (const char *s, const char *accept)
+{
+  while (*s != '\0')
+    {
+      const char *a = accept;
+      while (*a != '\0')
+       if (*a++ == *s)
+         return (char *) s;
+      ++s;
+    }
+
+  return 0;
+}
+#endif /* HAVE_STRPBRK */
+
 #ifndef HAVE_MKTIME
 /* From GNU libc 2.0.  */
 
@@ -1188,3 +1206,23 @@ strptime (buf, format, tm)
   return strptime_internal (buf, format, tm, &decided);
 }
 #endif /* not HAVE_STRPTIME */
+
+
+#ifndef HAVE_USLEEP
+#ifndef WINDOWS
+
+/* A simple usleep implementation based on select().  For Unix and
+   Unix-like systems.  */
+
+int
+usleep (unsigned long usec)
+{
+  struct timeval tm;
+  tm.tv_sec = 0;
+  tm.tv_usec = usec;
+  select (0, NULL, NULL, NULL, &tm);
+  return 0;
+}
+
+#endif /* not WINDOWS */
+#endif /* not HAVE_USLEEP */