mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] mldonkey distrib/ChangeLog src/config/mingw/os_...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/config/mingw/os_...
Date: Mon, 20 Feb 2006 00:53:57 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Branch:         
Changes by:     spiralvoice <address@hidden>    06/02/20 00:53:57

Modified files:
        distrib        : ChangeLog 
        src/config/mingw: os_stubs_c.c 
        src/config/unix: os_stubs_c.c 
        src/utils/lib  : os_stubs.h stubs_c.c tiger.c tiger.h 

Log message:
        patch #4920

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.738&tr2=1.739&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/config/mingw/os_stubs_c.c.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/config/unix/os_stubs_c.c.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/utils/lib/os_stubs.h.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/utils/lib/stubs_c.c.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/utils/lib/tiger.c.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/utils/lib/tiger.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.738 mldonkey/distrib/ChangeLog:1.739
--- mldonkey/distrib/ChangeLog:1.738    Fri Feb 17 22:25:32 2006
+++ mldonkey/distrib/ChangeLog  Mon Feb 20 00:53:57 2006
@@ -14,6 +14,9 @@
 ChangeLog
 =========
 
+2006/02/20
+4920: Cleanup included header files in C code (Schlumpf)
+
 2006/02/17
 4910: EDK: Use updated protocol information when parsing
       consecutive messages (sam_dennis)
Index: mldonkey/src/config/mingw/os_stubs_c.c
diff -u mldonkey/src/config/mingw/os_stubs_c.c:1.14 
mldonkey/src/config/mingw/os_stubs_c.c:1.15
--- mldonkey/src/config/mingw/os_stubs_c.c:1.14 Mon Feb 13 20:41:15 2006
+++ mldonkey/src/config/mingw/os_stubs_c.c      Mon Feb 20 00:53:57 2006
@@ -1,15 +1,16 @@
-#include <caml/mlvalues.h>
-#include <caml/alloc.h>
-#include <caml/memory.h>
-#include <caml/custom.h>
-#include <caml/callback.h>
-#include <caml/fail.h>
+
 
 #include "../../utils/lib/os_stubs.h"
 
-#ifdef HAS_SIGNALS_H
-#include <signals.h>
-#endif
+
+
+/*******************************************************************
+
+
+                         os_read
+
+
+*******************************************************************/
 
 #define UNIX_BUFFER_SIZE 16384
 
@@ -33,6 +34,14 @@
   return numread;
 }
 
+/*******************************************************************
+
+
+                         os_ftruncate
+
+
+*******************************************************************/
+
 #include <winioctl.h>
 
 void os_ftruncate(OS_FD fd, OFF_T size, /* bool */ int sparse)
@@ -62,11 +71,27 @@
     }
 }
 
+/*******************************************************************
+
+
+                         os_getdtablesize
+
+
+*******************************************************************/
+
 int os_getdtablesize()
 {
   return 32767;
 }
 
+/*******************************************************************
+
+
+                         os_getfdsize
+                         
+
+*******************************************************************/
+
 int64 os_getfdsize(OS_FD fd)
 {
   long len_high;
@@ -76,6 +101,14 @@
   return ((int64) len_high << 32 | ret);
 }
 
+/*******************************************************************
+
+
+                         os_getfilesize
+
+
+*******************************************************************/
+
 int64 os_getfilesize(char *path)
 {
   OS_FD fd = CreateFile(path, GENERIC_READ, FILE_SHARE_READ,
@@ -97,6 +130,14 @@
   }
 }
 
+/*******************************************************************
+
+
+                         os_lseek
+
+
+*******************************************************************/
+
 OFF_T os_lseek(OS_FD fd, OFF_T ofs, int cmd)
 {
   DWORD ret;
@@ -115,6 +156,14 @@
   return ((OFF_T) ofs_high << 32 | ret);
 }
 
+/*******************************************************************
+
+
+                         os_set_nonblock
+
+
+*******************************************************************/
+
 #include <winsock2.h>
 
 void os_set_nonblock(OS_SOCKET fd)
@@ -130,6 +179,13 @@
   }
 }
 
+/*******************************************************************
+
+
+                         gettimeofday
+
+
+*******************************************************************/
 
 //http://lists.gnu.org/archive/html/bug-gnu-chess/2004-01/msg00020.html
 void gettimeofday(struct timeval* p, void* tz /* IGNORED */){
@@ -144,6 +200,13 @@
    return;
 }
 
+/*******************************************************************
+
+
+                         os_uname
+
+
+*******************************************************************/
 
 // 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp
 #define BUFSIZE 80
Index: mldonkey/src/config/unix/os_stubs_c.c
diff -u mldonkey/src/config/unix/os_stubs_c.c:1.14 
mldonkey/src/config/unix/os_stubs_c.c:1.15
--- mldonkey/src/config/unix/os_stubs_c.c:1.14  Fri Jan  6 22:23:08 2006
+++ mldonkey/src/config/unix/os_stubs_c.c       Mon Feb 20 00:53:57 2006
@@ -1,48 +1,16 @@
 
 
-#include <errno.h>
-#include <stdio.h>
-#include <caml/mlvalues.h>
-#include <caml/alloc.h>
-#include <caml/memory.h>
-#include <caml/custom.h>
-#include <caml/callback.h>
-#include <caml/fail.h>
-#include <signal.h>
+#include "../../utils/lib/os_stubs.h"
 
-#ifdef HAS_SIGNALS_H
-#include <signals.h>
-#endif
 
-#include <sys/types.h>
-#include <sys/time.h>
 
-#ifdef HAS_SYS_SELECT_H
-#include <sys/select.h>
-#endif
+/*******************************************************************
 
-#include <stdio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
 
-#ifdef HAS_UNISTD
-#include <unistd.h>
-#else
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
-#endif
+                         os_lseek
 
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
-#include <string.h>
-#endif
 
-#if !defined(__MINGW32__) && !defined(__BEOS__)
-#include <sys/mman.h>
-#endif
-
-#include "../../../config/config.h"
-#include "../../utils/lib/os_stubs.h"
+*******************************************************************/
 
 OFF_T os_lseek(OS_FD fd, OFF_T pos, int dir)
 {
@@ -53,6 +21,14 @@
   return result;
 }
 
+/*******************************************************************
+
+
+                         os_read
+
+
+*******************************************************************/
+
 ssize_t os_read(OS_FD fd, char *buf, size_t len)
 {
   ssize_t result = read(fd, buf, len);
@@ -62,8 +38,15 @@
   return result;
 }
  
+/*******************************************************************
+
 
-// TODO: write whole file if sparse disabled
+                         os_ftruncate
+
+
+*******************************************************************/
+
+/* TODO: write whole file if sparse disabled */
 void os_ftruncate(OS_FD fd, OFF_T len, /* bool */ int sparse)
 {
   int64 cursize;
@@ -83,11 +66,27 @@
     }
 }
 
+/*******************************************************************
+
+
+                         os_getdtablesize
+
+
+*******************************************************************/
+
 int os_getdtablesize()
 {
   return getdtablesize();
 }
 
+/*******************************************************************
+
+
+                         os_getfdsize
+
+
+*******************************************************************/
+
 int64 os_getfdsize(OS_FD fd)
 {
   struct stat buf;
@@ -98,6 +97,14 @@
   return buf.st_size;
 }
 
+/*******************************************************************
+
+
+                         os_getfilesize
+
+
+*******************************************************************/
+
 int64 os_getfilesize(char *path)
 {
   struct stat buf;
@@ -108,34 +115,69 @@
   return buf.st_size;
 }
 
+/*******************************************************************
+
+
+                         os_set_nonblock
+
+
+*******************************************************************/
+
 void os_set_nonblock(OS_SOCKET fd)
 {
 
 }
 
+/*******************************************************************
+
+
+                         glibc_version
+
+
+*******************************************************************/
+
 value glibc_version(void)
 {
   CAMLparam0 ();
   CAMLlocal1 (v);
+
 #ifdef HAVE_GNU_LIBC_VERSION_H
-#  include <gnu/libc-version.h>
+#include <gnu/libc-version.h>
+
   v = copy_string (gnu_get_libc_version());
   CAMLreturn (v);
+  
 #else
+
   raise_constant(*(value *)caml_named_value("not supported"));
+  
 #endif
 }
 
+/*******************************************************************
+
+
+                         os_uname
+
+
+*******************************************************************/
+
 #ifdef HAVE_SYS_UTSNAME_H
 #include <sys/utsname.h>
-void os_uname(char buf[]) {
+
+void os_uname(char buf[]) 
+{
        struct utsname uts;
   uname(&uts);
        sprintf(buf, "%s %s %s %s %s", 
    uts.sysname, uts.nodename, uts.release, uts.version, uts.machine);
 }
+
 #else
-void os_uname(char buf[]) {
-// Do nothing to buf
+
+void os_uname(char buf[]) 
+{
+/* Do nothing to buf */
 }
+
 #endif
Index: mldonkey/src/utils/lib/os_stubs.h
diff -u mldonkey/src/utils/lib/os_stubs.h:1.12 
mldonkey/src/utils/lib/os_stubs.h:1.13
--- mldonkey/src/utils/lib/os_stubs.h:1.12      Sun Oct  9 15:53:36 2005
+++ mldonkey/src/utils/lib/os_stubs.h   Mon Feb 20 00:53:57 2006
@@ -1,12 +1,19 @@
-#if !defined(_OCAMLFD_H)
-#define _OCAMLFD_H
 
-#if defined(__MINGW32__)
+#include "../../../config/config.h"
 
-#if !defined(PTW32_STATIC_LIB)
-#define PTW32_STATIC_LIB
-#endif
-
+/*******************************************************************
+
+
+                         MINGW specific
+
+
+*******************************************************************/
+
+#ifdef __MINGW32__
+
+#ifndef PTW32_STATIC_LIB
+#define PTW32_STATIC_LIB
+#endif
 
 #define FD_SETSIZE 1024
 
@@ -28,54 +35,74 @@
 typedef unsigned int uint;
 extern void win32_maperr(unsigned long errcode);
 
-
-
-#else
+/*******************************************************************
+
+
+                         UNIX specific
 
 
+*******************************************************************/
+
+#else  /* __MINGW32__ */
+
 #define Fd_val(v) Int_val(v)
 #define Socket_val(v) Int_val(v)
 
 typedef int OS_FD;
 typedef int OS_SOCKET;
 
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
+#include <string.h>
+#endif
+
+#ifndef __BEOS__
+#include <sys/mman.h>
 #endif
 
-#include "caml/mlvalues.h"
-#include "caml/fail.h"
-#include "caml/alloc.h"
-#include "caml/memory.h"
+#endif  /* __MINGW32__ */
 
+/*******************************************************************
 
-#include <errno.h>
-#include <stdio.h>
+
+                         COMMON used 
+
+
+*******************************************************************/
+
+#include <caml/config.h>
+#include <caml/signals.h>
 #include <caml/mlvalues.h>
 #include <caml/alloc.h>
 #include <caml/memory.h>
+#include <caml/fail.h>
+#include <caml/custom.h>
+#include <caml/callback.h>
+
+#include <errno.h>
+#include <stdio.h>
 #include <signal.h>
+#include <fcntl.h>
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
 
 #ifdef HAS_SIGNALS_H
 #include <signals.h>
 #endif
 
-#include <sys/types.h>
-
-// off_t is long on mingw, long long everywhere else
-#ifdef _OFF64_T_
-typedef off64_t OFF_T;
-#else
-typedef off_t OFF_T;
-#endif
-
-#include <sys/time.h>
-
 #ifdef HAS_SYS_SELECT_H
 #include <sys/select.h>
 #endif
 
-#include <stdio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
+
+/* off_t is long on mingw, long long everywhere else */
+#ifdef _OFF64_T_
+typedef off64_t OFF_T;
+#else
+typedef off_t OFF_T;
+#endif
+
 
 #ifdef HAS_UNISTD
 #include <unistd.h>
@@ -93,13 +120,6 @@
 #define SEEK_END 2
 #endif
 
-#if defined(__OpenBSD__) || defined(__FreeBSD__)
-#include <string.h>
-#endif
-
-#if !defined(__MINGW32__) && !defined(__BEOS__)
-#include <sys/mman.h>
-#endif
 
 
 #define Nothing ((value) 0)
@@ -111,18 +131,17 @@
   SEEK_SET, SEEK_CUR, SEEK_END
 };
 
-extern OFF_T os_lseek(OS_FD fd, OFF_T pos, int dir);
-extern void os_ftruncate(OS_FD fd, OFF_T len, int sparse);
-extern ssize_t os_read(OS_FD fd, char *buf, size_t len);
+extern OFF_T os_lseek(OS_FD fd, OFF_T pos, int dir);
+extern void os_ftruncate(OS_FD fd, OFF_T len, int sparse);
+extern ssize_t os_read(OS_FD fd, char *buf, size_t len);
 extern int os_getdtablesize();
 extern int64 os_getfdsize(OS_FD fd);
 extern int64 os_getfilesize(char *path);
 extern void os_set_nonblock(OS_SOCKET fd);
-extern void os_uname(char buf[]);
+extern void os_uname(char buf[]);
+
+
+#define HASH_BUFFER_LEN 131072
+extern unsigned char hash_buffer[HASH_BUFFER_LEN];
+
 
-
-#define HASH_BUFFER_LEN 131072
-extern unsigned char hash_buffer[HASH_BUFFER_LEN];
-
-
-#endif
Index: mldonkey/src/utils/lib/stubs_c.c
diff -u mldonkey/src/utils/lib/stubs_c.c:1.36 
mldonkey/src/utils/lib/stubs_c.c:1.37
--- mldonkey/src/utils/lib/stubs_c.c:1.36       Fri Feb 17 22:23:34 2006
+++ mldonkey/src/utils/lib/stubs_c.c    Mon Feb 20 00:53:57 2006
@@ -17,28 +17,16 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include "../../../config/config.h"
 #include "../../utils/lib/os_stubs.h"
 
 #include <string.h> 
 #include <ctype.h>
-#include <caml/config.h>
-#include <caml/signals.h>
-#include <caml/mlvalues.h>
-#include <caml/alloc.h>
-#include <caml/memory.h>
-#include <caml/fail.h>
-#include <caml/custom.h>
-#include <caml/callback.h>
+
 
 #ifdef __MORPHOS__
 #include <inttypes.h>
 #endif  /* __MORPHOS__ */
 
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif /* HAVE_SYS_TIME_H */
-
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif /* HAVE_SYS_RESOURCE_H */
@@ -47,7 +35,6 @@
 #define read XXXXXXXXX
 #define ftruncate XXXXXXXXX
 
-#define UNIX_BUFFER_SIZE 16384
 
 
 /*******************************************************************
Index: mldonkey/src/utils/lib/tiger.c
diff -u mldonkey/src/utils/lib/tiger.c:1.10 mldonkey/src/utils/lib/tiger.c:1.11
--- mldonkey/src/utils/lib/tiger.c:1.10 Thu Feb  2 00:33:28 2006
+++ mldonkey/src/utils/lib/tiger.c      Mon Feb 20 00:53:57 2006
@@ -19,7 +19,6 @@
 
 #include "../../utils/lib/os_stubs.h"
 #include "tiger.h"
-#include <caml/config.h>
 
 /* The following macro denotes that an optimization    */
 /* for Alpha is required. It is used only for          */
@@ -817,11 +816,7 @@
 
 ***************************************************************************/
 
-#include "tiger.h"
 #include "md4.h"
-#include "caml/mlvalues.h"
-#include "caml/fail.h"
-#include "caml/alloc.h"
 
 OFF_T tiger_block_size(OFF_T len)
 {
Index: mldonkey/src/utils/lib/tiger.h
diff -u mldonkey/src/utils/lib/tiger.h:1.4 mldonkey/src/utils/lib/tiger.h:1.5
--- mldonkey/src/utils/lib/tiger.h:1.4  Thu Feb  2 00:33:28 2006
+++ mldonkey/src/utils/lib/tiger.h      Mon Feb 20 00:53:57 2006
@@ -17,7 +17,6 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include "../../utils/lib/os_stubs.h"
 #ifndef _TIGER_H
 #define _TIGER_H
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]