]> sjero.net Git - wget/blobdiff - src/cmpt.c
[svn] New option `--limit-rate'.
[wget] / src / cmpt.c
index 4b4d68cb4b34e9bc3b76689f9f3ec258b2e113fa..7a7add09bd607da57a3b908c5c73b3e1d8ea9d59 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,19 @@ strptime (buf, format, tm)
   return strptime_internal (buf, format, tm, &decided);
 }
 #endif /* not HAVE_STRPTIME */
+
+
+#ifndef HAVE_USLEEP
+/* A simple usleep implementation based on select().  This will
+   probably not work on Windows.  */
+
+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 HAVE_USLEEP */