]> sjero.net Git - wget/blobdiff - src/sysdep.h
[svn] New option `--limit-rate'.
[wget] / src / sysdep.h
index 5ecef669e540b24ad94dd73a33b994ce470e3290..1c5deb1b8290c293e59b69a6b3da24b571ecd77e 100644 (file)
@@ -1,20 +1,20 @@
 /* Dirty system-dependent hacks.
    Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
 
-This file is part of Wget.
+This file is part of GNU Wget.
 
-This program is free software; you can redistribute it and/or modify
+GNU Wget is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or (at
 your option) any later version.
 
-This program is distributed in the hope that it will be useful,
+GNU Wget is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
+along with Wget; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 /* This file is included by wget.h.  Random .c files need not include
@@ -94,6 +94,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #endif
 #endif
 
+#ifdef __BEOS__
+# undef READ
+# undef WRITE
+# define READ(fd, buf, cnt) recv((fd), (buf), (cnt), 0)
+# define WRITE(fd, buf, cnt) send((fd), (buf), (cnt), 0)
+#endif
+
 /* mswindows.h defines these.  */
 #ifndef READ
 # define READ(fd, buf, cnt) read ((fd), (buf), (cnt))
@@ -156,6 +163,9 @@ char *strptime ();
 #ifndef HAVE_VSNPRINTF
 int vsnprintf ();
 #endif
+#ifndef HAVE_USLEEP
+int usleep ();
+#endif
 
 /* SunOS brain damage -- for some reason, SunOS header files fail to
    declare the functions below, which causes all kinds of problems
@@ -178,4 +188,35 @@ void *memcpy ();
 #endif /* sun */
 #endif /* STDC_HEADERS */
 
+/* Some systems (Linux libc5, "NCR MP-RAS 3.0", and others) don't
+   provide MAP_FAILED, a symbolic constant for the value returned by
+   mmap() when it doesn't work.  Usually, this constant should be -1.
+   This only makes sense for files that use mmap() and include
+   sys/mman.h *before* sysdep.h, but doesn't hurt others.  */
+
+#ifndef MAP_FAILED
+# define MAP_FAILED ((void *) -1)
+#endif
+
+/* Define wrapper macros for different MD5 routines. */
+#ifdef HAVE_MD5
+
+#ifdef HAVE_BUILTIN_MD5
+# include <gnu-md5.h>
+# define MD5_CONTEXT_TYPE struct md5_ctx
+# define MD5_INIT(ctx) md5_init_ctx (ctx)
+# define MD5_UPDATE(buffer, len, ctx) md5_process_bytes (buffer, len, ctx)
+# define MD5_FINISH(ctx, result) md5_finish_ctx (ctx, result)
+#endif
+
+#ifdef HAVE_SOLARIS_MD5
+# include <md5.h>
+# define MD5_CONTEXT_TYPE MD5_CTX
+# define MD5_INIT(ctx) MD5Init (ctx)
+# define MD5_UPDATE(buffer, len, ctx) MD5Update (ctx, (unsigned char *)(buffer), len)
+# define MD5_FINISH(ctx, result) MD5Final ((unsigned char *)(result), ctx)
+#endif
+
+#endif /* HAVE_MD5 */
+
 #endif /* SYSDEP_H */