[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r5816 - in GNUnet/src: applications/chat applications/dht/t
From: |
gnunet |
Subject: |
[GNUnet-SVN] r5816 - in GNUnet/src: applications/chat applications/dht/tools applications/fs/lib applications/fs/tools applications/stats applications/tbench applications/template applications/tracekit applications/vpn include server setup transports |
Date: |
Thu, 6 Dec 2007 18:04:30 -0700 (MST) |
Author: grothoff
Date: 2007-12-06 18:04:29 -0700 (Thu, 06 Dec 2007)
New Revision: 5816
Modified:
GNUnet/src/applications/chat/gnunet-chat.c
GNUnet/src/applications/dht/tools/dht-query.c
GNUnet/src/applications/fs/lib/fslib.c
GNUnet/src/applications/fs/tools/gnunet-directory.c
GNUnet/src/applications/fs/tools/gnunet-download.c
GNUnet/src/applications/fs/tools/gnunet-insert.c
GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
GNUnet/src/applications/fs/tools/gnunet-search.c
GNUnet/src/applications/fs/tools/gnunet-unindex.c
GNUnet/src/applications/stats/gnunet-stats.c
GNUnet/src/applications/tbench/gnunet-tbench.c
GNUnet/src/applications/template/gnunet-template.c
GNUnet/src/applications/tracekit/gnunet-tracekit.c
GNUnet/src/applications/vpn/gnunet-vpn.c
GNUnet/src/include/gnunet_fs_lib.h
GNUnet/src/include/gnunet_transport.h
GNUnet/src/include/gnunet_transport_service.h
GNUnet/src/include/plibc.h
GNUnet/src/server/connection.c
GNUnet/src/server/connection.h
GNUnet/src/server/gnunet-peer-info.c
GNUnet/src/server/gnunet-transport-check.c
GNUnet/src/server/gnunet-update.c
GNUnet/src/server/gnunetd.c
GNUnet/src/server/handler.c
GNUnet/src/setup/gnunet-setup.c
GNUnet/src/transports/http.c
GNUnet/src/transports/smtp.c
Log:
formatting
Modified: GNUnet/src/applications/chat/gnunet-chat.c
===================================================================
--- GNUnet/src/applications/chat/gnunet-chat.c 2007-12-07 01:04:03 UTC (rev
5815)
+++ GNUnet/src/applications/chat/gnunet-chat.c 2007-12-07 01:04:29 UTC (rev
5816)
@@ -51,7 +51,7 @@
{'r', "room", "NAME",
gettext_noop ("set the chat room to join (requred)"),
1, &GNUNET_getopt_configure_set_string, &roomname},
- COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/dht/tools/dht-query.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht-query.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/dht/tools/dht-query.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -56,7 +56,7 @@
gettext_noop
("allow TIME ms to process a GET command or expire PUT content after ms
TIME"),
1, &GNUNET_getopt_configure_set_ulong, &timeout},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c 2007-12-07 01:04:03 UTC (rev
5815)
+++ GNUnet/src/applications/fs/lib/fslib.c 2007-12-07 01:04:29 UTC (rev
5816)
@@ -414,7 +414,7 @@
*/
int
GNUNET_FS_prepare_to_index (struct GNUNET_ClientServerConnection *sock,
- const GNUNET_HashCode * fileHc, const char *fn)
+ const GNUNET_HashCode * fileHc, const char *fn)
{
int ret;
CS_fs_request_init_index_MESSAGE *ri;
Modified: GNUnet/src/applications/fs/tools/gnunet-directory.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-directory.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/fs/tools/gnunet-directory.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -144,7 +144,7 @@
{'t', "track", NULL,
gettext_noop ("start tracking entries for the directory database"),
0, &GNUNET_getopt_configure_set_one, &do_track},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/fs/tools/gnunet-download.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-download.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/fs/tools/gnunet-download.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -86,7 +86,7 @@
{'R', "recursive", NULL,
gettext_noop ("download a GNUnet directory recursively"),
0, &GNUNET_getopt_configure_set_one, &do_recursive},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -335,7 +335,7 @@
gettext_noop ("ID of the previous version of the content"
" (for namespace update only)"),
1, &GNUNET_getopt_configure_set_string, &prev_id},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/fs/tools/gnunet-pseudonym.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/fs/tools/gnunet-pseudonym.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -105,7 +105,7 @@
{'s', "set-rating", "ID:VALUE",
gettext_noop ("set the rating of a namespace"),
0, &GNUNET_getopt_configure_set_string, &set_rating},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/fs/tools/gnunet-search.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-search.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/fs/tools/gnunet-search.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -148,7 +148,7 @@
{'t', "timeout", "DELAY",
gettext_noop ("wait DELAY seconds for search results before aborting"),
1, &GNUNET_getopt_configure_set_uint, &delay},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/fs/tools/gnunet-unindex.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-unindex.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/fs/tools/gnunet-unindex.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -108,7 +108,7 @@
GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Unindex files.")), /* -h
*/
GNUNET_COMMAND_LINE_OPTION_HOSTNAME, /* -H */
GNUNET_COMMAND_LINE_OPTION_LOGGING, /* -L */
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/stats/gnunet-stats.c
===================================================================
--- GNUnet/src/applications/stats/gnunet-stats.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/stats/gnunet-stats.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -86,7 +86,7 @@
{'p', "protocols", NULL,
gettext_noop ("prints supported protocol messages"),
0, &GNUNET_getopt_configure_set_option, "STATS:PRINT-PROTOCOLS=YES"},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/tbench/gnunet-tbench.c
===================================================================
--- GNUnet/src/applications/tbench/gnunet-tbench.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/tbench/gnunet-tbench.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -85,7 +85,7 @@
gettext_noop ("time to wait for the completion of an iteration (in ms)"),
1,
&GNUNET_getopt_configure_set_ulong, &messageTimeOut},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
{'X', "xspace", "COUNT",
gettext_noop ("number of messages in a message block"), 1,
&GNUNET_getopt_configure_set_ulong, &messageTrainSize},
Modified: GNUnet/src/applications/template/gnunet-template.c
===================================================================
--- GNUnet/src/applications/template/gnunet-template.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/template/gnunet-template.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -42,7 +42,7 @@
GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Template description.")),
/* -h */
GNUNET_COMMAND_LINE_OPTION_HOSTNAME, /* -H */
GNUNET_COMMAND_LINE_OPTION_LOGGING, /* -L */
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/applications/tracekit/gnunet-tracekit.c
===================================================================
--- GNUnet/src/applications/tracekit/gnunet-tracekit.c 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/applications/tracekit/gnunet-tracekit.c 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -57,7 +57,7 @@
{'P', "priority", "PRIO",
gettext_noop ("use PRIO for the priority of the trace request"), 1,
&GNUNET_getopt_configure_set_option, "GNUNET-TRACEKIT:PRIORITY"},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
{'W', "wait", "DELAY",
gettext_noop ("wait DELAY seconds for replies"), 1,
&GNUNET_getopt_configure_set_option, "GNUNET-TRACEKIT:WAIT"},
Modified: GNUnet/src/applications/vpn/gnunet-vpn.c
===================================================================
--- GNUnet/src/applications/vpn/gnunet-vpn.c 2007-12-07 01:04:03 UTC (rev
5815)
+++ GNUnet/src/applications/vpn/gnunet-vpn.c 2007-12-07 01:04:29 UTC (rev
5816)
@@ -54,7 +54,7 @@
{'s', "silent", NULL,
gettext_noop ("Suppress display of asynchronous log messages"),
0, &GNUNET_getopt_configure_set_one, &silent},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/include/gnunet_fs_lib.h
===================================================================
--- GNUnet/src/include/gnunet_fs_lib.h 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/include/gnunet_fs_lib.h 2007-12-07 01:04:29 UTC (rev 5816)
@@ -122,8 +122,8 @@
* Initialize to index a file. Tries to do the symlinking.
*/
int GNUNET_FS_prepare_to_index (struct GNUNET_ClientServerConnection *sock,
- const GNUNET_HashCode * fileHc,
- const char *fn);
+ const GNUNET_HashCode * fileHc,
+ const char *fn);
/**
* Index a block. Note that while the API is VERY similar to
Modified: GNUnet/src/include/gnunet_transport.h
===================================================================
--- GNUnet/src/include/gnunet_transport.h 2007-12-07 01:04:03 UTC (rev
5815)
+++ GNUnet/src/include/gnunet_transport.h 2007-12-07 01:04:29 UTC (rev
5816)
@@ -372,7 +372,8 @@
*
* The type of inittransport_XXX is GNUNET_TransportMainMethod.
*/
-typedef GNUNET_TransportAPI *(*GNUNET_TransportMainMethod)
(GNUNET_CoreAPIForTransport *);
+typedef GNUNET_TransportAPI
+ *(*GNUNET_TransportMainMethod) (GNUNET_CoreAPIForTransport *);
#if 0 /* keep Emacsens' auto-indent happy */
{
Modified: GNUnet/src/include/gnunet_transport_service.h
===================================================================
--- GNUnet/src/include/gnunet_transport_service.h 2007-12-07 01:04:03 UTC
(rev 5815)
+++ GNUnet/src/include/gnunet_transport_service.h 2007-12-07 01:04:29 UTC
(rev 5816)
@@ -40,7 +40,8 @@
/**
* Type of the per-transport callback method.
*/
-typedef void (*GNUNET_TransportCallback) (GNUNET_TransportAPI * tapi, void
*data);
+typedef void (*GNUNET_TransportCallback) (GNUNET_TransportAPI * tapi,
+ void *data);
/**
* @brief Transport service definition.
Modified: GNUnet/src/include/plibc.h
===================================================================
--- GNUnet/src/include/plibc.h 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/include/plibc.h 2007-12-07 01:04:29 UTC (rev 5816)
@@ -29,15 +29,16 @@
#define _PLIBC_H_
#ifndef SIGALRM
- #define SIGALRM 14
+#define SIGALRM 14
#endif
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
#endif
#ifdef Q_OS_WIN32
- #define WINDOWS 1
+#define WINDOWS 1
#endif
#define HAVE_PLIBC_FD 0
@@ -45,7 +46,7 @@
#ifdef WINDOWS
#if ENABLE_NLS
- #include "langinfo.h"
+#include "langinfo.h"
#endif
#include <windows.h>
@@ -74,8 +75,8 @@
#define int64_t long long
#define int32_t long
-struct stat64
-{
+ struct stat64
+ {
_dev_t st_dev;
_ino_t st_ino;
_mode_t st_mode;
@@ -87,112 +88,112 @@
__time64_t st_atime;
__time64_t st_mtime;
__time64_t st_ctime;
-};
+ };
#ifndef pid_t
- #define pid_t int
+#define pid_t int
#endif
#ifndef WEXITSTATUS
- #define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
+#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
#endif
/* Thanks to the Cygwin project */
-#define ENOCSI 43 /* No CSI structure available */
-#define EL2HLT 44 /* Level 2 halted */
+#define ENOCSI 43 /* No CSI structure available */
+#define EL2HLT 44 /* Level 2 halted */
#ifndef EDEADLK
- #define EDEADLK 45 /* Deadlock condition */
+#define EDEADLK 45 /* Deadlock condition */
#endif
#ifndef ENOLCK
- #define ENOLCK 46 /* No record locks available */
+#define ENOLCK 46 /* No record locks available */
#endif
-#define EBADE 50 /* Invalid exchange */
-#define EBADR 51 /* Invalid request descriptor */
-#define EXFULL 52 /* Exchange full */
-#define ENOANO 53 /* No anode */
-#define EBADRQC 54 /* Invalid request code */
-#define EBADSLT 55 /* Invalid slot */
+#define EBADE 50 /* Invalid exchange */
+#define EBADR 51 /* Invalid request descriptor */
+#define EXFULL 52 /* Exchange full */
+#define ENOANO 53 /* No anode */
+#define EBADRQC 54 /* Invalid request code */
+#define EBADSLT 55 /* Invalid slot */
#ifndef EDEADLOCK
- #define EDEADLOCK EDEADLK /* File locking deadlock error */
+#define EDEADLOCK EDEADLK /* File locking deadlock error */
#endif
-#define EBFONT 57 /* Bad font file fmt */
-#define ENOSTR 60 /* Device not a stream */
-#define ENODATA 61 /* No data (for no delay io) */
-#define ETIME 62 /* Timer expired */
-#define ENOSR 63 /* Out of streams resources */
-#define ENONET 64 /* Machine is not on the network */
-#define ENOPKG 65 /* Package not installed */
-#define EREMOTE 66 /* The object is remote */
-#define ENOLINK 67 /* The link has been severed */
-#define EADV 68 /* Advertise error */
-#define ESRMNT 69 /* Srmount error */
-#define ECOMM 70 /* Communication error on send */
-#define EPROTO 71 /* Protocol error */
-#define EMULTIHOP 74 /* Multihop attempted */
-#define ELBIN 75 /* Inode is remote (not really error) */
-#define EDOTDOT 76 /* Cross mount point (not really error) */
-#define EBADMSG 77 /* Trying to read unreadable message */
-#define ENOTUNIQ 80 /* Given log. name not unique */
-#define EBADFD 81 /* f.d. invalid for this operation */
-#define EREMCHG 82 /* Remote address changed */
-#define ELIBACC 83 /* Can't access a needed shared lib */
-#define ELIBBAD 84 /* Accessing a corrupted shared lib */
-#define ELIBSCN 85 /* .lib section in a.out corrupted */
-#define ELIBMAX 86 /* Attempting to link in too many libs */
-#define ELIBEXEC 87 /* Attempting to exec a shared library */
+#define EBFONT 57 /* Bad font file fmt */
+#define ENOSTR 60 /* Device not a stream */
+#define ENODATA 61 /* No data (for no delay io) */
+#define ETIME 62 /* Timer expired */
+#define ENOSR 63 /* Out of streams resources */
+#define ENONET 64 /* Machine is not on the network */
+#define ENOPKG 65 /* Package not installed */
+#define EREMOTE 66 /* The object is remote */
+#define ENOLINK 67 /* The link has been severed */
+#define EADV 68 /* Advertise error */
+#define ESRMNT 69 /* Srmount error */
+#define ECOMM 70 /* Communication error on send */
+#define EPROTO 71 /* Protocol error */
+#define EMULTIHOP 74 /* Multihop attempted */
+#define ELBIN 75 /* Inode is remote (not really error) */
+#define EDOTDOT 76 /* Cross mount point (not really error) */
+#define EBADMSG 77 /* Trying to read unreadable message */
+#define ENOTUNIQ 80 /* Given log. name not unique */
+#define EBADFD 81 /* f.d. invalid for this operation */
+#define EREMCHG 82 /* Remote address changed */
+#define ELIBACC 83 /* Can't access a needed shared lib */
+#define ELIBBAD 84 /* Accessing a corrupted shared lib */
+#define ELIBSCN 85 /* .lib section in a.out corrupted */
+#define ELIBMAX 86 /* Attempting to link in too many libs */
+#define ELIBEXEC 87 /* Attempting to exec a shared library */
#ifndef ENOSYS
- #define ENOSYS 88 /* Function not implemented */
+#define ENOSYS 88 /* Function not implemented */
#endif
-#define ENMFILE 89 /* No more files */
+#define ENMFILE 89 /* No more files */
#ifndef ENOTEMPTY
- #define ENOTEMPTY 90 /* Directory not empty */
+#define ENOTEMPTY 90 /* Directory not empty */
#endif
#ifndef ENAMETOOLONG
- #define ENAMETOOLONG 91 /* File or path name too long */
+#define ENAMETOOLONG 91 /* File or path name too long */
#endif
-#define ELOOP 92 /* Too many symbolic links */
-#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
-#define EPFNOSUPPORT 96 /* Protocol family not supported */
-#define ECONNRESET 104 /* Connection reset by peer */
-#define ENOBUFS 105 /* No buffer space available */
-#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */
-#define EPROTOTYPE 107 /* Protocol wrong type for socket */
-#define ENOTSOCK 108 /* Socket operation on non-socket */
-#define ENOPROTOOPT 109 /* Protocol not available */
-#define ESHUTDOWN 110 /* Can't send after socket shutdown */
-#define ECONNREFUSED 111 /* Connection refused */
-#define EADDRINUSE 112 /* Address already in use */
-#define ECONNABORTED 113 /* Connection aborted */
-#define ENETUNREACH 114 /* Network is unreachable */
-#define ENETDOWN 115 /* Network interface is not configured */
+#define ELOOP 92 /* Too many symbolic links */
+#define EOPNOTSUPP 95 /* Operation not supported on transport
endpoint */
+#define EPFNOSUPPORT 96 /* Protocol family not supported */
+#define ECONNRESET 104 /* Connection reset by peer */
+#define ENOBUFS 105 /* No buffer space available */
+#define EAFNOSUPPORT 106 /* Address family not supported by protocol
family */
+#define EPROTOTYPE 107 /* Protocol wrong type for socket */
+#define ENOTSOCK 108 /* Socket operation on non-socket */
+#define ENOPROTOOPT 109 /* Protocol not available */
+#define ESHUTDOWN 110 /* Can't send after socket shutdown */
+#define ECONNREFUSED 111 /* Connection refused */
+#define EADDRINUSE 112 /* Address already in use */
+#define ECONNABORTED 113 /* Connection aborted */
+#define ENETUNREACH 114 /* Network is unreachable */
+#define ENETDOWN 115 /* Network interface is not configured */
#ifndef ETIMEDOUT
- #define ETIMEDOUT 116 /* Connection timed out */
+#define ETIMEDOUT 116 /* Connection timed out */
#endif
-#define EHOSTDOWN 117 /* Host is down */
-#define EHOSTUNREACH 118 /* Host is unreachable */
-#define EINPROGRESS 119 /* Connection already in progress */
-#define EALREADY 120 /* Socket already connected */
-#define EDESTADDRREQ 121 /* Destination address required */
-#define EMSGSIZE 122 /* Message too long */
-#define EPROTONOSUPPORT 123 /* Unknown protocol */
-#define ESOCKTNOSUPPORT 124 /* Socket type not supported */
-#define EADDRNOTAVAIL 125 /* Address not available */
-#define ENETRESET 126 /* Connection aborted by network */
-#define EISCONN 127 /* Socket is already connected */
-#define ENOTCONN 128 /* Socket is not connected */
-#define ETOOMANYREFS 129 /* Too many references: cannot splice */
-#define EPROCLIM 130 /* Too many processes */
-#define EUSERS 131 /* Too many users */
-#define EDQUOT 132 /* Disk quota exceeded */
-#define ESTALE 133 /* Unknown error */
+#define EHOSTDOWN 117 /* Host is down */
+#define EHOSTUNREACH 118 /* Host is unreachable */
+#define EINPROGRESS 119 /* Connection already in progress */
+#define EALREADY 120 /* Socket already connected */
+#define EDESTADDRREQ 121 /* Destination address required */
+#define EMSGSIZE 122 /* Message too long */
+#define EPROTONOSUPPORT 123 /* Unknown protocol */
+#define ESOCKTNOSUPPORT 124 /* Socket type not supported */
+#define EADDRNOTAVAIL 125 /* Address not available */
+#define ENETRESET 126 /* Connection aborted by network */
+#define EISCONN 127 /* Socket is already connected */
+#define ENOTCONN 128 /* Socket is not connected */
+#define ETOOMANYREFS 129 /* Too many references: cannot splice */
+#define EPROCLIM 130 /* Too many processes */
+#define EUSERS 131 /* Too many users */
+#define EDQUOT 132 /* Disk quota exceeded */
+#define ESTALE 133 /* Unknown error */
#ifndef ENOTSUP
- #define ENOTSUP 134 /* Not supported */
+#define ENOTSUP 134 /* Not supported */
#endif
-#define ENOMEDIUM 135 /* No medium (in tape drive) */
-#define ENOSHARE 136 /* No such host or network path */
-#define ECASECLASH 137 /* Filename exists with different case */
-#define EWOULDBLOCK EAGAIN /* Operation would block */
-#define EOVERFLOW 139 /* Value too large for defined data type */
+#define ENOMEDIUM 135 /* No medium (in tape drive) */
+#define ENOSHARE 136 /* No such host or network path */
+#define ECASECLASH 137 /* Filename exists with different case */
+#define EWOULDBLOCK EAGAIN /* Operation would block */
+#define EOVERFLOW 139 /* Value too large for defined data type */
#undef HOST_NOT_FOUND
#define HOST_NOT_FOUND 1
@@ -206,65 +207,65 @@
#define PROT_READ 0x1
#define PROT_WRITE 0x2
#define MAP_SHARED 0x1
-#define MAP_PRIVATE 0x2 /* unsupported */
+#define MAP_PRIVATE 0x2 /* unsupported */
#define MAP_FIXED 0x10
#define MAP_FAILED ((void *)-1)
-struct statfs
-{
- long f_type; /* type of filesystem (see below) */
- long f_bsize; /* optimal transfer block size */
- long f_blocks; /* total data blocks in file system */
- long f_bfree; /* free blocks in fs */
- long f_bavail; /* free blocks avail to non-superuser */
- long f_files; /* total file nodes in file system */
- long f_ffree; /* free file nodes in fs */
- long f_fsid; /* file system id */
- long f_namelen; /* maximum length of filenames */
- long f_spare[6]; /* spare for later */
-};
+ struct statfs
+ {
+ long f_type; /* type of filesystem (see below) */
+ long f_bsize; /* optimal transfer block size */
+ long f_blocks; /* total data blocks in file system */
+ long f_bfree; /* free blocks in fs */
+ long f_bavail; /* free blocks avail to non-superuser */
+ long f_files; /* total file nodes in file system */
+ long f_ffree; /* free file nodes in fs */
+ long f_fsid; /* file system id */
+ long f_namelen; /* maximum length of filenames */
+ long f_spare[6]; /* spare for later */
+ };
/* Taken from the Wine project <http://www.winehq.org>
/wine/include/winternl.h */
-enum SYSTEM_INFORMATION_CLASS
-{
- SystemBasicInformation = 0,
- Unknown1,
- SystemPerformanceInformation = 2,
- SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
- Unknown4,
- SystemProcessInformation = 5,
- Unknown6,
- Unknown7,
- SystemProcessorPerformanceInformation = 8,
- Unknown9,
- Unknown10,
- SystemDriverInformation,
- Unknown12,
- Unknown13,
- Unknown14,
- Unknown15,
- SystemHandleList,
- Unknown17,
- Unknown18,
- Unknown19,
- Unknown20,
- SystemCacheInformation,
- Unknown22,
- SystemInterruptInformation = 23,
- SystemExceptionInformation = 33,
- SystemRegistryQuotaInformation = 37,
- SystemLookasideInformation = 45
-};
+ enum SYSTEM_INFORMATION_CLASS
+ {
+ SystemBasicInformation = 0,
+ Unknown1,
+ SystemPerformanceInformation = 2,
+ SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */
+ Unknown4,
+ SystemProcessInformation = 5,
+ Unknown6,
+ Unknown7,
+ SystemProcessorPerformanceInformation = 8,
+ Unknown9,
+ Unknown10,
+ SystemDriverInformation,
+ Unknown12,
+ Unknown13,
+ Unknown14,
+ Unknown15,
+ SystemHandleList,
+ Unknown17,
+ Unknown18,
+ Unknown19,
+ Unknown20,
+ SystemCacheInformation,
+ Unknown22,
+ SystemInterruptInformation = 23,
+ SystemExceptionInformation = 33,
+ SystemRegistryQuotaInformation = 37,
+ SystemLookasideInformation = 45
+ };
-typedef struct
-{
+ typedef struct
+ {
LARGE_INTEGER IdleTime;
LARGE_INTEGER KernelTime;
LARGE_INTEGER UserTime;
LARGE_INTEGER Reserved1[2];
ULONG Reserved2;
-} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
+ } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
#define sleep(secs) (Sleep(secs * 1000))
@@ -281,11 +282,11 @@
#define SHUT_RDWR SD_BOTH
/* Operations for flock() */
-#define LOCK_SH 1 /* shared lock */
-#define LOCK_EX 2 /* exclusive lock */
-#define LOCK_NB 4 /* or'd with one of the above to prevent
- blocking */
-#define LOCK_UN 8 /* remove lock */
+#define LOCK_SH 1 /* shared lock */
+#define LOCK_EX 2 /* exclusive lock */
+#define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+#define LOCK_UN 8 /* remove lock */
/* Not supported under MinGW */
#define S_IRGRP 0
@@ -311,279 +312,280 @@
*/
#define index(s, c) strchr(s, c)
-BOOL _plibc_CreateShortcut(const char *pszSrc, const char *pszDest);
-BOOL _plibc_DereferenceShortcut(char *pszShortcut);
-char *plibc_ChooseDir(char *pszTitle, unsigned long ulFlags);
-char *plibc_ChooseFile(char *pszTitle, unsigned long ulFlags);
-long QueryRegistry(HKEY hMainKey, char *pszKey, char *pszSubKey,
- char *pszBuffer, long *pdLength);
+ BOOL _plibc_CreateShortcut (const char *pszSrc, const char *pszDest);
+ BOOL _plibc_DereferenceShortcut (char *pszShortcut);
+ char *plibc_ChooseDir (char *pszTitle, unsigned long ulFlags);
+ char *plibc_ChooseFile (char *pszTitle, unsigned long ulFlags);
+ long QueryRegistry (HKEY hMainKey, char *pszKey, char *pszSubKey,
+ char *pszBuffer, long *pdLength);
-BOOL __win_IsHandleMarkedAsBlocking(SOCKET hHandle);
-void __win_SetHandleBlockingMode(SOCKET s, BOOL bBlocking);
-void __win_DiscardHandleBlockingMode(SOCKET s);
-int _win_isSocketValid(int s);
-int plibc_conv_to_win_path(const char *pszUnix, char *pszWindows);
-unsigned plibc_get_handle_count();
+ BOOL __win_IsHandleMarkedAsBlocking (SOCKET hHandle);
+ void __win_SetHandleBlockingMode (SOCKET s, BOOL bBlocking);
+ void __win_DiscardHandleBlockingMode (SOCKET s);
+ int _win_isSocketValid (int s);
+ int plibc_conv_to_win_path (const char *pszUnix, char *pszWindows);
+ unsigned plibc_get_handle_count ();
-typedef void (*TPanicProc) (int, char *);
-void plibc_set_panic_proc(TPanicProc proc);
+ typedef void (*TPanicProc) (int, char *);
+ void plibc_set_panic_proc (TPanicProc proc);
-int flock(int fd, int operation);
-int fsync(int fildes);
-int inet_pton(int af, const char *src, void *dst);
-int inet_pton4(const char *src, u_char *dst, int pton);
+ int flock (int fd, int operation);
+ int fsync (int fildes);
+ int inet_pton (int af, const char *src, void *dst);
+ int inet_pton4 (const char *src, u_char * dst, int pton);
#if USE_IPV6
-int inet_pton6(const char *src, u_char *dst);
+ int inet_pton6 (const char *src, u_char * dst);
#endif
-int truncate(const char *fname, int distance);
-int statfs(const char *path, struct statfs *buf);
-const char *hstrerror(int err);
-void gettimeofday(struct timeval *tp, void *tzp);
-int mkstemp(char *tmplate);
-char *strptime (const char *buf, const char *format, struct tm *tm);
-char *ctime(const time_t *clock);
-char *ctime_r(const time_t *clock, char *buf);
-const char *inet_ntop(int af, const void *src, char *dst, size_t size);
-int plibc_init(char *pszOrg, char *pszApp);
-void plibc_shutdown();
-int plibc_initialized();
-int plibc_conv_to_win_path_ex(const char *pszUnix, char *pszWindows, int
derefLinks);
-void _SetErrnoFromWinError(long lWinError, char *pszCaller, int iLine);
-void SetErrnoFromWinsockError(long lWinError);
-void SetHErrnoFromWinError(long lWinError);
-void SetErrnoFromHRESULT(HRESULT hRes);
-FILE *_win_fopen(const char *filename, const char *mode);
-DIR *_win_opendir(const char *dirname);
-int _win_open(const char *filename, int oflag, ...);
+ int truncate (const char *fname, int distance);
+ int statfs (const char *path, struct statfs *buf);
+ const char *hstrerror (int err);
+ void gettimeofday (struct timeval *tp, void *tzp);
+ int mkstemp (char *tmplate);
+ char *strptime (const char *buf, const char *format, struct tm *tm);
+ char *ctime (const time_t * clock);
+ char *ctime_r (const time_t * clock, char *buf);
+ const char *inet_ntop (int af, const void *src, char *dst, size_t size);
+ int plibc_init (char *pszOrg, char *pszApp);
+ void plibc_shutdown ();
+ int plibc_initialized ();
+ int plibc_conv_to_win_path_ex (const char *pszUnix, char *pszWindows,
+ int derefLinks);
+ void _SetErrnoFromWinError (long lWinError, char *pszCaller, int iLine);
+ void SetErrnoFromWinsockError (long lWinError);
+ void SetHErrnoFromWinError (long lWinError);
+ void SetErrnoFromHRESULT (HRESULT hRes);
+ FILE *_win_fopen (const char *filename, const char *mode);
+ DIR *_win_opendir (const char *dirname);
+ int _win_open (const char *filename, int oflag, ...);
#ifdef ENABLE_NLS
-char *_win_bindtextdomain(const char *domainname, const char *dirname);
+ char *_win_bindtextdomain (const char *domainname, const char *dirname);
#endif
-int _win_chdir(const char *path);
-int _win_close(int fd);
-int _win_creat(const char *path, mode_t mode);
-int _win_fstat(int handle, struct stat *buffer);
-int _win_ftruncate(int fildes, off_t length);
-int _win_pipe(int *phandles);
-int _win_rmdir(const char *path);
-int _win_access( const char *path, int mode );
-int _win_chmod(const char *filename, int pmode);
-char *realpath(const char *file_name, char *resolved_name);
-long _win_random(void);
-int _win_remove(const char *path);
-int _win_rename(const char *oldname, const char *newname);
-int _win_stat(const char *path, struct stat *buffer);
-int _win_stat64(const char *path, struct stat64 *buffer);
-int _win_unlink(const char *filename);
-int _win_write(int fildes, const void *buf, size_t nbyte);
-int _win_read(int fildes, void *buf, size_t nbyte);
-size_t _win_fwrite(const void *buffer, size_t size, size_t count, FILE
*stream);
-size_t _win_fread( void *buffer, size_t size, size_t count, FILE *stream );
-int _win_symlink(const char *path1, const char *path2);
-void *_win_mmap(void *start, size_t len, int access, int flags, int fd,
- unsigned long long offset);
-int _win_munmap(void *start, size_t length);
-int _win_lstat(const char *path, struct stat *buf);
-int _win_lstat64(const char *path, struct stat64 *buf);
-int _win_readlink(const char *path, char *buf, size_t bufsize);
-int _win_accept(SOCKET s, struct sockaddr *addr, int *addrlen);
-int _win_printf(const char *format,...);
-int _win_fprintf(FILE *f,const char *format,...);
-int _win_vprintf(const char *format, va_list ap);
-int _win_vfprintf(FILE *stream, const char *format, va_list arg_ptr);
-int _win_vsprintf(char *dest,const char *format, va_list arg_ptr);
-int _win_vsnprintf(char* str, size_t size, const char *format, va_list
arg_ptr);
-int _win_snprintf(char *str,size_t size,const char *format,...);
-int _win_sprintf(char *dest,const char *format,...);
-int _win_vsscanf(const char* str, const char* format, va_list arg_ptr);
-int _win_sscanf(const char *str, const char *format, ...);
-int _win_vfscanf(FILE *stream, const char *format, va_list arg_ptr);
-int _win_vscanf(const char *format, va_list arg_ptr);
-int _win_scanf(const char *format, ...);
-int _win_fscanf(FILE *stream, const char *format, ...);
-pid_t _win_waitpid(pid_t pid, int *stat_loc, int options);
-int _win_bind(SOCKET s, const struct sockaddr *name, int namelen);
-int _win_connect(SOCKET s,const struct sockaddr *name, int namelen);
-int _win_getpeername(SOCKET s, struct sockaddr *name,
- int *namelen);
-int _win_getsockname(SOCKET s, struct sockaddr *name,
- int *namelen);
-int _win_getsockopt(SOCKET s, int level, int optname, char *optval,
- int *optlen);
-int _win_listen(SOCKET s, int backlog);
-int _win_recv(SOCKET s, char *buf, int len, int flags);
-int _win_recvfrom(SOCKET s, void *buf, int len, int flags,
- struct sockaddr *from, int *fromlen);
-int _win_select(int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds,
- const struct timeval *tv);
-int _win_send(SOCKET s, const char *buf, int len, int flags);
-int _win_sendto(SOCKET s, const char *buf, int len, int flags,
- const struct sockaddr *to, int tolen);
-int _win_setsockopt(SOCKET s, int level, int optname, const void *optval,
- int optlen);
-int _win_shutdown(SOCKET s, int how);
-SOCKET _win_socket(int af, int type, int protocol);
-struct hostent *_win_gethostbyaddr(const char *addr, int len, int type);
-struct hostent *_win_gethostbyname(const char *name);
-char *_win_strerror(int errnum);
-int IsWinNT();
+ int _win_chdir (const char *path);
+ int _win_close (int fd);
+ int _win_creat (const char *path, mode_t mode);
+ int _win_fstat (int handle, struct stat *buffer);
+ int _win_ftruncate (int fildes, off_t length);
+ int _win_pipe (int *phandles);
+ int _win_rmdir (const char *path);
+ int _win_access (const char *path, int mode);
+ int _win_chmod (const char *filename, int pmode);
+ char *realpath (const char *file_name, char *resolved_name);
+ long _win_random (void);
+ int _win_remove (const char *path);
+ int _win_rename (const char *oldname, const char *newname);
+ int _win_stat (const char *path, struct stat *buffer);
+ int _win_stat64 (const char *path, struct stat64 *buffer);
+ int _win_unlink (const char *filename);
+ int _win_write (int fildes, const void *buf, size_t nbyte);
+ int _win_read (int fildes, void *buf, size_t nbyte);
+ size_t _win_fwrite (const void *buffer, size_t size, size_t count,
+ FILE * stream);
+ size_t _win_fread (void *buffer, size_t size, size_t count, FILE * stream);
+ int _win_symlink (const char *path1, const char *path2);
+ void *_win_mmap (void *start, size_t len, int access, int flags, int fd,
+ unsigned long long offset);
+ int _win_munmap (void *start, size_t length);
+ int _win_lstat (const char *path, struct stat *buf);
+ int _win_lstat64 (const char *path, struct stat64 *buf);
+ int _win_readlink (const char *path, char *buf, size_t bufsize);
+ int _win_accept (SOCKET s, struct sockaddr *addr, int *addrlen);
+ int _win_printf (const char *format, ...);
+ int _win_fprintf (FILE * f, const char *format, ...);
+ int _win_vprintf (const char *format, va_list ap);
+ int _win_vfprintf (FILE * stream, const char *format, va_list arg_ptr);
+ int _win_vsprintf (char *dest, const char *format, va_list arg_ptr);
+ int _win_vsnprintf (char *str, size_t size, const char *format,
+ va_list arg_ptr);
+ int _win_snprintf (char *str, size_t size, const char *format, ...);
+ int _win_sprintf (char *dest, const char *format, ...);
+ int _win_vsscanf (const char *str, const char *format, va_list arg_ptr);
+ int _win_sscanf (const char *str, const char *format, ...);
+ int _win_vfscanf (FILE * stream, const char *format, va_list arg_ptr);
+ int _win_vscanf (const char *format, va_list arg_ptr);
+ int _win_scanf (const char *format, ...);
+ int _win_fscanf (FILE * stream, const char *format, ...);
+ pid_t _win_waitpid (pid_t pid, int *stat_loc, int options);
+ int _win_bind (SOCKET s, const struct sockaddr *name, int namelen);
+ int _win_connect (SOCKET s, const struct sockaddr *name, int namelen);
+ int _win_getpeername (SOCKET s, struct sockaddr *name, int *namelen);
+ int _win_getsockname (SOCKET s, struct sockaddr *name, int *namelen);
+ int _win_getsockopt (SOCKET s, int level, int optname, char *optval,
+ int *optlen);
+ int _win_listen (SOCKET s, int backlog);
+ int _win_recv (SOCKET s, char *buf, int len, int flags);
+ int _win_recvfrom (SOCKET s, void *buf, int len, int flags,
+ struct sockaddr *from, int *fromlen);
+ int _win_select (int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds,
+ const struct timeval *tv);
+ int _win_send (SOCKET s, const char *buf, int len, int flags);
+ int _win_sendto (SOCKET s, const char *buf, int len, int flags,
+ const struct sockaddr *to, int tolen);
+ int _win_setsockopt (SOCKET s, int level, int optname, const void *optval,
+ int optlen);
+ int _win_shutdown (SOCKET s, int how);
+ SOCKET _win_socket (int af, int type, int protocol);
+ struct hostent *_win_gethostbyaddr (const char *addr, int len, int type);
+ struct hostent *_win_gethostbyname (const char *name);
+ char *_win_strerror (int errnum);
+ int IsWinNT ();
#if !HAVE_STRNDUP
-char *strndup (const char *s, size_t n);
+ char *strndup (const char *s, size_t n);
#endif
#if !HAVE_STRNLEN
-size_t strnlen (const char *str, size_t maxlen);
+ size_t strnlen (const char *str, size_t maxlen);
#endif
#define strcasecmp(a, b) stricmp(a, b)
#define strncasecmp(a, b, c) strnicmp(a, b, c)
-#endif /* WINDOWS */
+#endif /* WINDOWS */
#ifndef WINDOWS
- #define DIR_SEPARATOR '/'
- #define DIR_SEPARATOR_STR "/"
- #define PATH_SEPARATOR ';'
- #define PATH_SEPARATOR_STR ";"
- #define NEWLINE "\n"
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_STR "/"
+#define PATH_SEPARATOR ';'
+#define PATH_SEPARATOR_STR ";"
+#define NEWLINE "\n"
#ifdef ENABLE_NLS
- #define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n)
+#define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n)
#endif
- #define CREAT(p, m) creat(p, m)
- #undef FOPEN
- #define FOPEN(f, m) fopen(f, m)
- #define FTRUNCATE(f, l) ftruncate(f, l)
- #define OPENDIR(d) opendir(d)
- #define OPEN open
- #define CHDIR(d) chdir(d)
- #define CLOSE(f) close(f)
- #define LSEEK(f, o, w) lseek(f, o, w)
- #define RMDIR(f) rmdir(f)
- #define ACCESS(p, m) access(p, m)
- #define CHMOD(f, p) chmod(f, p)
- #define FSTAT(h, b) fstat(h, b)
- #define PIPE(h) pipe(h)
- #define REMOVE(p) remove(p)
- #define RENAME(o, n) rename(o, n)
- #define STAT(p, b) stat(p, b)
- #define STAT64(p, b) stat64(p, b)
- #define UNLINK(f) unlink(f)
- #define WRITE(f, b, n) write(f, b, n)
- #define READ(f, b, n) read(f, b, n)
- #define GN_FREAD(b, s, c, f) fread(b, s, c, f)
- #define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f)
- #define SYMLINK(a, b) symlink(a, b)
- #define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o)
- #define MUNMAP(s, l) munmap(s, l)
- #define STRERROR(i) strerror(i)
- #define RANDOM() random()
- #define READLINK(p, b, s) readlink(p, b, s)
- #define LSTAT(p, b) lstat(p, b)
- #define LSTAT64(p, b) lstat64(p, b)
- #define PRINTF printf
- #define FPRINTF fprintf
- #define VPRINTF(f, a) vprintf(f, a)
- #define VFPRINTF(s, f, a) vfprintf(s, f, a)
- #define VSPRINTF(d, f, a) vsprintf(d, f, a)
- #define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a)
- #define _REAL_SNPRINTF snprintf
- #define SPRINTF sprintf
- #define VSSCANF(s, f, a) vsscanf(s, f, a)
- #define SSCANF sscanf
- #define VFSCANF(s, f, a) vfscanf(s, f, a)
- #define VSCANF(f, a) vscanf(f, a)
- #define SCANF scanf
- #define FSCANF fscanf
- #define WAITPID(p, s, o) waitpid(p, s, o)
- #define ACCEPT(s, a, l) accept(s, a, l)
- #define BIND(s, n, l) bind(s, n, l)
- #define CONNECT(s, n, l) connect(s, n, l)
- #define GETPEERNAME(s, n, l) getpeername(s, n, l)
- #define GETSOCKNAME(s, n, l) getsockname(s, n, l)
- #define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p)
- #define LISTEN(s, b) listen(s, b)
- #define RECV(s, b, l, f) recv(s, b, l, f)
- #define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o)
- #define SELECT(n, r, w, e, t) select(n, r, w, e, t)
- #define SEND(s, b, l, f) send(s, b, l, f)
- #define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n)
- #define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n)
- #define SHUTDOWN(s, h) shutdown(s, h)
- #define SOCKET(a, t, p) socket(a, t, p)
- #define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t)
- #define GETHOSTBYNAME(n) gethostbyname(n)
+#define CREAT(p, m) creat(p, m)
+#undef FOPEN
+#define FOPEN(f, m) fopen(f, m)
+#define FTRUNCATE(f, l) ftruncate(f, l)
+#define OPENDIR(d) opendir(d)
+#define OPEN open
+#define CHDIR(d) chdir(d)
+#define CLOSE(f) close(f)
+#define LSEEK(f, o, w) lseek(f, o, w)
+#define RMDIR(f) rmdir(f)
+#define ACCESS(p, m) access(p, m)
+#define CHMOD(f, p) chmod(f, p)
+#define FSTAT(h, b) fstat(h, b)
+#define PIPE(h) pipe(h)
+#define REMOVE(p) remove(p)
+#define RENAME(o, n) rename(o, n)
+#define STAT(p, b) stat(p, b)
+#define STAT64(p, b) stat64(p, b)
+#define UNLINK(f) unlink(f)
+#define WRITE(f, b, n) write(f, b, n)
+#define READ(f, b, n) read(f, b, n)
+#define GN_FREAD(b, s, c, f) fread(b, s, c, f)
+#define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f)
+#define SYMLINK(a, b) symlink(a, b)
+#define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o)
+#define MUNMAP(s, l) munmap(s, l)
+#define STRERROR(i) strerror(i)
+#define RANDOM() random()
+#define READLINK(p, b, s) readlink(p, b, s)
+#define LSTAT(p, b) lstat(p, b)
+#define LSTAT64(p, b) lstat64(p, b)
+#define PRINTF printf
+#define FPRINTF fprintf
+#define VPRINTF(f, a) vprintf(f, a)
+#define VFPRINTF(s, f, a) vfprintf(s, f, a)
+#define VSPRINTF(d, f, a) vsprintf(d, f, a)
+#define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a)
+#define _REAL_SNPRINTF snprintf
+#define SPRINTF sprintf
+#define VSSCANF(s, f, a) vsscanf(s, f, a)
+#define SSCANF sscanf
+#define VFSCANF(s, f, a) vfscanf(s, f, a)
+#define VSCANF(f, a) vscanf(f, a)
+#define SCANF scanf
+#define FSCANF fscanf
+#define WAITPID(p, s, o) waitpid(p, s, o)
+#define ACCEPT(s, a, l) accept(s, a, l)
+#define BIND(s, n, l) bind(s, n, l)
+#define CONNECT(s, n, l) connect(s, n, l)
+#define GETPEERNAME(s, n, l) getpeername(s, n, l)
+#define GETSOCKNAME(s, n, l) getsockname(s, n, l)
+#define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p)
+#define LISTEN(s, b) listen(s, b)
+#define RECV(s, b, l, f) recv(s, b, l, f)
+#define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o)
+#define SELECT(n, r, w, e, t) select(n, r, w, e, t)
+#define SEND(s, b, l, f) send(s, b, l, f)
+#define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n)
+#define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n)
+#define SHUTDOWN(s, h) shutdown(s, h)
+#define SOCKET(a, t, p) socket(a, t, p)
+#define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t)
+#define GETHOSTBYNAME(n) gethostbyname(n)
#else
- #define DIR_SEPARATOR '\\'
- #define DIR_SEPARATOR_STR "\\"
- #define PATH_SEPARATOR ':'
- #define PATH_SEPARATOR_STR ":"
- #define NEWLINE "\r\n"
+#define DIR_SEPARATOR '\\'
+#define DIR_SEPARATOR_STR "\\"
+#define PATH_SEPARATOR ':'
+#define PATH_SEPARATOR_STR ":"
+#define NEWLINE "\r\n"
#ifdef ENABLE_NLS
- #define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n)
+#define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n)
#endif
- #define CREAT(p, m) _win_creat(p, m)
- #define FOPEN(f, m) _win_fopen(f, m)
- #define FTRUNCATE(f, l) _win_ftruncate(f, l)
- #define OPENDIR(d) _win_opendir(d)
- #define OPEN _win_open
- #define CHDIR(d) _win_chdir(d)
- #define CLOSE(f) _win_close(f)
- #define LSEEK(f, o, w) _win_lseek(f, o, w)
- #define FSTAT(h, b) _win_fstat(h, b)
- #define RMDIR(f) _win_rmdir(f)
- #define ACCESS(p, m) _win_access(p, m)
- #define CHMOD(f, p) _win_chmod(f, p)
- #define PIPE(h) _win_pipe(h)
- #define RANDOM() _win_random()
- #define REMOVE(p) _win_remove(p)
- #define RENAME(o, n) _win_rename(o, n)
- #define STAT(p, b) _win_stat(p, b)
- #define STAT64(p, b) _win_stat64(p, b)
- #define UNLINK(f) _win_unlink(f)
- #define WRITE(f, b, n) _win_write(f, b, n)
- #define READ(f, b, n) _win_read(f, b, n)
- #define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f)
- #define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f)
- #define SYMLINK(a, b) _win_symlink(a, b)
- #define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o)
- #define MUNMAP(s, l) _win_munmap(s, l)
- #define STRERROR(i) _win_strerror(i)
- #define READLINK(p, b, s) _win_readlink(p, b, s)
- #define LSTAT(p, b) _win_lstat(p, b)
- #define LSTAT64(p, b) _win_lstat64(p, b)
- #define PRINTF(f, ...) _win_printf(f , __VA_ARGS__)
- #define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__)
- #define VPRINTF(f, a) _win_vprintf(f, a)
- #define VFPRINTF(s, f, a) _win_vfprintf(s, f, a)
- #define VSPRINTF(d, f, a) _win_vsprintf(d, f, a)
- #define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a)
- #define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt,
__VA_ARGS__)
- #define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__)
- #define VSSCANF(s, f, a) _win_vsscanf(s, f, a)
- #define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__)
- #define VFSCANF(s, f, a) _win_vfscanf(s, f, a)
- #define VSCANF(f, a) _win_vscanf(f, a)
- #define SCANF(f, ...) _win_scanf(f, __VA_ARGS__)
- #define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__)
- #define WAITPID(p, s, o) _win_waitpid(p, s, o)
- #define ACCEPT(s, a, l) _win_accept(s, a, l)
- #define BIND(s, n, l) _win_bind(s, n, l)
- #define CONNECT(s, n, l) _win_connect(s, n, l)
- #define GETPEERNAME(s, n, l) _win_getpeername(s, n, l)
- #define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l)
- #define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p)
- #define LISTEN(s, b) _win_listen(s, b)
- #define RECV(s, b, l, f) _win_recv(s, b, l, f)
- #define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o)
- #define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t)
- #define SEND(s, b, l, f) _win_send(s, b, l, f)
- #define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n)
- #define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n)
- #define SHUTDOWN(s, h) _win_shutdown(s, h)
- #define SOCKET(a, t, p) _win_socket(a, t, p)
- #define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t)
- #define GETHOSTBYNAME(n) _win_gethostbyname(n)
+#define CREAT(p, m) _win_creat(p, m)
+#define FOPEN(f, m) _win_fopen(f, m)
+#define FTRUNCATE(f, l) _win_ftruncate(f, l)
+#define OPENDIR(d) _win_opendir(d)
+#define OPEN _win_open
+#define CHDIR(d) _win_chdir(d)
+#define CLOSE(f) _win_close(f)
+#define LSEEK(f, o, w) _win_lseek(f, o, w)
+#define FSTAT(h, b) _win_fstat(h, b)
+#define RMDIR(f) _win_rmdir(f)
+#define ACCESS(p, m) _win_access(p, m)
+#define CHMOD(f, p) _win_chmod(f, p)
+#define PIPE(h) _win_pipe(h)
+#define RANDOM() _win_random()
+#define REMOVE(p) _win_remove(p)
+#define RENAME(o, n) _win_rename(o, n)
+#define STAT(p, b) _win_stat(p, b)
+#define STAT64(p, b) _win_stat64(p, b)
+#define UNLINK(f) _win_unlink(f)
+#define WRITE(f, b, n) _win_write(f, b, n)
+#define READ(f, b, n) _win_read(f, b, n)
+#define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f)
+#define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f)
+#define SYMLINK(a, b) _win_symlink(a, b)
+#define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o)
+#define MUNMAP(s, l) _win_munmap(s, l)
+#define STRERROR(i) _win_strerror(i)
+#define READLINK(p, b, s) _win_readlink(p, b, s)
+#define LSTAT(p, b) _win_lstat(p, b)
+#define LSTAT64(p, b) _win_lstat64(p, b)
+#define PRINTF(f, ...) _win_printf(f , __VA_ARGS__)
+#define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__)
+#define VPRINTF(f, a) _win_vprintf(f, a)
+#define VFPRINTF(s, f, a) _win_vfprintf(s, f, a)
+#define VSPRINTF(d, f, a) _win_vsprintf(d, f, a)
+#define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a)
+#define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt,
__VA_ARGS__)
+#define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__)
+#define VSSCANF(s, f, a) _win_vsscanf(s, f, a)
+#define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__)
+#define VFSCANF(s, f, a) _win_vfscanf(s, f, a)
+#define VSCANF(f, a) _win_vscanf(f, a)
+#define SCANF(f, ...) _win_scanf(f, __VA_ARGS__)
+#define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__)
+#define WAITPID(p, s, o) _win_waitpid(p, s, o)
+#define ACCEPT(s, a, l) _win_accept(s, a, l)
+#define BIND(s, n, l) _win_bind(s, n, l)
+#define CONNECT(s, n, l) _win_connect(s, n, l)
+#define GETPEERNAME(s, n, l) _win_getpeername(s, n, l)
+#define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l)
+#define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p)
+#define LISTEN(s, b) _win_listen(s, b)
+#define RECV(s, b, l, f) _win_recv(s, b, l, f)
+#define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o)
+#define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t)
+#define SEND(s, b, l, f) _win_send(s, b, l, f)
+#define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n)
+#define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n)
+#define SHUTDOWN(s, h) _win_shutdown(s, h)
+#define SOCKET(a, t, p) _win_socket(a, t, p)
+#define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t)
+#define GETHOSTBYNAME(n) _win_gethostbyname(n)
#endif
@@ -592,6 +594,6 @@
#endif
-#endif //_PLIBC_H_
+#endif //_PLIBC_H_
/* end of plibc.h */
Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/server/connection.c 2007-12-07 01:04:29 UTC (rev 5816)
@@ -1136,9 +1136,9 @@
}
if ((totalMessageSize == sizeof (GNUNET_TransportPacket_HEADER)) ||
(((*priority) < GNUNET_EXTREME_PRIORITY) &&
- ((totalMessageSize / sizeof (GNUNET_TransportPacket_HEADER)) < 4) &&
- (deadline > GNUNET_get_time () + 500 * GNUNET_CRON_MILLISECONDS) &&
- (GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 16) != 0)))
+ ((totalMessageSize / sizeof (GNUNET_TransportPacket_HEADER)) < 4)
+ && (deadline > GNUNET_get_time () + 500 * GNUNET_CRON_MILLISECONDS)
+ && (GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 16) != 0)))
{
/* randomization necessary to ensure we eventually send
a small message if there is nothing else to do! */
@@ -1163,7 +1163,8 @@
{
(*priority) = approximateKnapsack (be,
be->session.mtu -
- sizeof
(GNUNET_TransportPacket_HEADER));
+ sizeof
+
(GNUNET_TransportPacket_HEADER));
#if DEBUG_COLLECT_PRIO
FPRINTF (prioFile, "%llu 0 %u\n", GNUNET_get_time (),
*priority);
@@ -1173,7 +1174,8 @@
{
(*priority) = solveKnapsack (be,
be->session.mtu -
- sizeof
(GNUNET_TransportPacket_HEADER));
+ sizeof
+ (GNUNET_TransportPacket_HEADER));
#if DEBUG_COLLECT_PRIO
FPRINTF (prioFile, "%llu 1 %u\n", GNUNET_get_time (),
*priority);
@@ -1184,7 +1186,8 @@
{ /* never approximate < 50% CPU load */
(*priority) = solveKnapsack (be,
be->session.mtu -
- sizeof (GNUNET_TransportPacket_HEADER));
+ sizeof
+ (GNUNET_TransportPacket_HEADER));
#if DEBUG_COLLECT_PRIO
FPRINTF (prioFile, "%llu 2 %u\n", GNUNET_get_time (), *priority);
#endif
@@ -1200,7 +1203,8 @@
}
}
if ((j == 0) ||
- (totalMessageSize > be->session.mtu - sizeof
(GNUNET_TransportPacket_HEADER)))
+ (totalMessageSize >
+ be->session.mtu - sizeof (GNUNET_TransportPacket_HEADER)))
{
GNUNET_GE_BREAK (ectx, 0);
GNUNET_GE_LOG (ectx,
@@ -1209,7 +1213,8 @@
_
("`%s' selected %d out of %d messages (MTU: %d).\n"),
__FUNCTION__, j, be->sendBufferSize,
- be->session.mtu - sizeof
(GNUNET_TransportPacket_HEADER));
+ be->session.mtu -
+ sizeof (GNUNET_TransportPacket_HEADER));
for (j = 0; j < be->sendBufferSize; j++)
GNUNET_GE_LOG (ectx,
@@ -1521,7 +1526,8 @@
for (i = 0; i < ret; i++)
{
entry = entries[i];
- if (entry->len <= be->session.mtu - sizeof
(GNUNET_TransportPacket_HEADER))
+ if (entry->len <=
+ be->session.mtu - sizeof (GNUNET_TransportPacket_HEADER))
continue;
ret--;
for (j = i; j < ret; j++)
@@ -1532,9 +1538,10 @@
be->consider_transport_switch = GNUNET_YES;
fragmentation->fragment (&be->session.sender,
be->session.mtu -
- sizeof (GNUNET_TransportPacket_HEADER),
entry->pri,
- entry->transmissionTime, entry->len,
- entry->callback, entry->closure);
+ sizeof (GNUNET_TransportPacket_HEADER),
+ entry->pri, entry->transmissionTime,
+ entry->len, entry->callback,
+ entry->closure);
GNUNET_free (entry);
changed = GNUNET_YES;
break; /* "entries" changed as side-effect of
fragment call */
@@ -1629,7 +1636,9 @@
}
if (totalMessageSize == 0)
totalMessageSize = EXPECTED_MTU + sizeof (GNUNET_TransportPacket_HEADER);
- GNUNET_GE_ASSERT (ectx, totalMessageSize > sizeof
(GNUNET_TransportPacket_HEADER));
+ GNUNET_GE_ASSERT (ectx,
+ totalMessageSize >
+ sizeof (GNUNET_TransportPacket_HEADER));
if ((be->session.mtu != 0) && (totalMessageSize > be->session.mtu))
{
GNUNET_GE_BREAK (ectx, 0);
@@ -1813,8 +1822,8 @@
p - sizeof (GNUNET_HashCode),
(GNUNET_HashCode *) encryptedMsg);
ret = GNUNET_AES_encrypt (&p2pHdr->sequenceNumber, p - sizeof
(GNUNET_HashCode), &be->skey_local, (const GNUNET_AES_InitializationVector *)
encryptedMsg, /* IV */
- &((GNUNET_TransportPacket_HEADER *) encryptedMsg)->
- sequenceNumber);
+ &((GNUNET_TransportPacket_HEADER *)
+ encryptedMsg)->sequenceNumber);
if (stats != NULL)
stats->change (stat_encrypted, p - sizeof (GNUNET_HashCode));
GNUNET_GE_ASSERT (ectx, be->session.tsession != NULL);
@@ -1924,10 +1933,10 @@
be->consider_transport_switch = GNUNET_YES;
/* this message is so big that it must be fragmented! */
fragmentation->fragment (&be->session.sender,
- be->session.mtu - sizeof
(GNUNET_TransportPacket_HEADER),
- se->pri,
- se->transmissionTime,
- se->len, se->callback, se->closure);
+ be->session.mtu -
+ sizeof (GNUNET_TransportPacket_HEADER),
+ se->pri, se->transmissionTime, se->len,
+ se->callback, se->closure);
GNUNET_free (se);
return;
}
@@ -3892,10 +3901,11 @@
hdr->bandwidth = 0;
memcpy (&buf[sizeof (GNUNET_TransportPacket_HEADER)], msg, size);
GNUNET_hash (&hdr->sequenceNumber,
- size + sizeof (GNUNET_TransportPacket_HEADER) - sizeof
(GNUNET_HashCode),
- &hdr->hash);
+ size + sizeof (GNUNET_TransportPacket_HEADER) -
+ sizeof (GNUNET_HashCode), &hdr->hash);
ret =
- transport->send (tsession, buf, size + sizeof
(GNUNET_TransportPacket_HEADER),
+ transport->send (tsession, buf,
+ size + sizeof (GNUNET_TransportPacket_HEADER),
GNUNET_YES);
GNUNET_free (buf);
EXIT ();
Modified: GNUnet/src/server/connection.h
===================================================================
--- GNUnet/src/server/connection.h 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/server/connection.h 2007-12-07 01:04:29 UTC (rev 5816)
@@ -50,7 +50,7 @@
GNUNET_Int32Time timeStamp;
/* desired bandwidth, 0 for plaintext messages! */
unsigned int bandwidth;
-} GNUNET_TransportPacket_HEADER; /* 76 bytes */
+} GNUNET_TransportPacket_HEADER; /* 76 bytes */
/* ***************** GNUnet core internals ************ */
Modified: GNUnet/src/server/gnunet-peer-info.c
===================================================================
--- GNUnet/src/server/gnunet-peer-info.c 2007-12-07 01:04:03 UTC (rev
5815)
+++ GNUnet/src/server/gnunet-peer-info.c 2007-12-07 01:04:29 UTC (rev
5816)
@@ -54,7 +54,7 @@
{'n', "numeric", NULL,
gettext_noop ("don't resolve host names"),
0, &GNUNET_getopt_configure_set_one, &no_resolve},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/server/gnunet-transport-check.c
===================================================================
--- GNUnet/src/server/gnunet-transport-check.c 2007-12-07 01:04:03 UTC (rev
5815)
+++ GNUnet/src/server/gnunet-transport-check.c 2007-12-07 01:04:29 UTC (rev
5816)
@@ -370,7 +370,7 @@
{'u', "user", "LOGIN",
gettext_noop ("run as user LOGIN"),
1, &GNUNET_getopt_configure_set_option, "GNUNETD:USER"},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
{'X', "Xrepeat", "X",
gettext_noop ("repeat each test X times"),
Modified: GNUnet/src/server/gnunet-update.c
===================================================================
--- GNUnet/src/server/gnunet-update.c 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/server/gnunet-update.c 2007-12-07 01:04:29 UTC (rev 5816)
@@ -249,7 +249,7 @@
gettext_noop
("run in client mode (for getting client configuration values)"),
0, &set_client_config, NULL},
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/server/gnunetd.c
===================================================================
--- GNUnet/src/server/gnunetd.c 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/server/gnunetd.c 2007-12-07 01:04:29 UTC (rev 5816)
@@ -191,7 +191,7 @@
gettext_noop ("specify username as which gnunetd should run"), 1,
&GNUNET_getopt_configure_set_option, "GNUNETD:USERNAME"},
#endif
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/server/handler.c
===================================================================
--- GNUnet/src/server/handler.c 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/server/handler.c 2007-12-07 01:04:29 UTC (rev 5816)
@@ -604,7 +604,8 @@
considerTakeover (sender, tsession);
injectMessage (sender,
&msg[sizeof (GNUNET_TransportPacket_HEADER)],
- size - sizeof (GNUNET_TransportPacket_HEADER), ret, tsession);
+ size - sizeof (GNUNET_TransportPacket_HEADER), ret,
+ tsession);
}
/**
Modified: GNUnet/src/setup/gnunet-setup.c
===================================================================
--- GNUnet/src/setup/gnunet-setup.c 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/setup/gnunet-setup.c 2007-12-07 01:04:29 UTC (rev 5816)
@@ -57,7 +57,7 @@
gettext_noop ("generate configuration for gnunetd, the GNUnet daemon"),
0, &GNUNET_getopt_configure_set_one, &config_daemon},
GNUNET_COMMAND_LINE_OPTION_HELP (gettext_noop ("Tool to setup GNUnet.")),
/* -h */
- GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
+ GNUNET_COMMAND_LINE_OPTION_VERSION (PACKAGE_VERSION), /* -v */
GNUNET_COMMAND_LINE_OPTION_VERBOSE,
GNUNET_COMMAND_LINE_OPTION_END,
};
Modified: GNUnet/src/transports/http.c
===================================================================
--- GNUnet/src/transports/http.c 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/transports/http.c 2007-12-07 01:04:29 UTC (rev 5816)
@@ -2031,19 +2031,19 @@
{
timeout = ms;
have_tv = MHD_YES;
- }
- else
- {
- /* curl_multi_timeout is buggy, don't believe
- it --- otherwise we may sit here forever on
- connect...; this is a bug which can be
- demonstrated using the daemontest_post_loop
- testcase from MHD. Once fixed in CURL, this
- else-clause should be removed.
- */
- timeout = 500;
- have_tv = MHD_YES;
- }
+ }
+ else
+ {
+ /* curl_multi_timeout is buggy, don't believe
+ it --- otherwise we may sit here forever on
+ connect...; this is a bug which can be
+ demonstrated using the daemontest_post_loop
+ testcase from MHD. Once fixed in CURL, this
+ else-clause should be removed.
+ */
+ timeout = 500;
+ have_tv = MHD_YES;
+ }
GNUNET_mutex_unlock (curllock);
STEP ();
FD_SET (signal_pipe[0], &rs);
Modified: GNUnet/src/transports/smtp.c
===================================================================
--- GNUnet/src/transports/smtp.c 2007-12-07 01:04:03 UTC (rev 5815)
+++ GNUnet/src/transports/smtp.c 2007-12-07 01:04:29 UTC (rev 5816)
@@ -113,12 +113,12 @@
/**
* Set to the SMTP server hostname (and port) for outgoing messages.
*/
-static char * smtp_server_name;
+static char *smtp_server_name;
/**
* Lock for uses of libesmtp (not thread-safe).
- */
-static struct GNUNET_Mutex * lock;
+ */
+static struct GNUNET_Mutex *lock;
/**
* Old handler for SIGPIPE (kept to be able to restore).
@@ -291,7 +291,7 @@
char *line;
unsigned int linesize;
SMTPMessage *mp;
- FILE * fdes;
+ FILE *fdes;
char *retl;
char *boundary;
char *out;
@@ -299,11 +299,11 @@
GNUNET_TransportPacket *coreMP;
int fd;
- GNUNET_GC_get_configuration_value_filename(coreAPI->cfg,
- "SMTP",
- "PIPE",
-
GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY "/smtp-pipe",
- &pipename);
+ GNUNET_GC_get_configuration_value_filename (coreAPI->cfg,
+ "SMTP",
+ "PIPE",
+
GNUNET_DEFAULT_DAEMON_VAR_DIRECTORY
+ "/smtp-pipe", &pipename);
UNLINK (pipename);
if (0 != mkfifo (pipename, S_IWUSR | S_IRUSR))
GNUNET_GE_DIE_STRERROR (ectx,
@@ -376,7 +376,7 @@
goto END;
}
- mp = (SMTPMessage *) &out[size - sizeof(SMTPMessage)];
+ mp = (SMTPMessage *) & out[size - sizeof (SMTPMessage)];
if (ntohs (mp->header.size) != size)
{
GNUNET_GE_LOG (ectx,
@@ -391,7 +391,7 @@
"Size returned by base64=%d, in the msg=%d.\n",
size, ntohl (mp->size));
#endif
- GNUNET_free(out);
+ GNUNET_free (out);
goto END;
}
coreMP = GNUNET_malloc (sizeof (GNUNET_TransportPacket));
@@ -439,7 +439,7 @@
{
const EmailAddress *maddr;
- maddr = (const EmailAddress *) & hello[1];
+ maddr = (const EmailAddress *) &hello[1];
if ((ntohs (hello->header.size) !=
sizeof (GNUNET_MessageHello) + ntohs (hello->senderAddressSize)) ||
(maddr->
@@ -449,7 +449,7 @@
GNUNET_GE_BREAK (ectx, 0);
return GNUNET_SYSERR; /* obviously invalid */
}
- return GNUNET_OK;
+ return GNUNET_OK;
}
/**
@@ -468,9 +468,7 @@
EmailAddress *haddr;
int i;
- if (! GNUNET_GC_have_configuration_value(coreAPI->cfg,
- "SMTP",
- "EMAIL") )
+ if (!GNUNET_GC_have_configuration_value (coreAPI->cfg, "SMTP", "EMAIL"))
{
static int once;
if (once == 0)
@@ -482,30 +480,23 @@
}
return NULL;
}
- if (! GNUNET_GC_have_configuration_value(coreAPI->cfg,
- "SMTP",
- "FILTER") )
+ if (!GNUNET_GC_have_configuration_value (coreAPI->cfg, "SMTP", "FILTER"))
{
static int once;
if (once == 0)
{
- GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK |
GNUNET_GE_USER,
- _
- ("No filter for E-mail specified, cannot create SMTP
advertisement.\n"));
- once = 1;
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
+ _
+ ("No filter for E-mail specified, cannot create SMTP
advertisement.\n"));
+ once = 1;
}
return NULL;
}
- GNUNET_GC_get_configuration_value_string(coreAPI->cfg,
- "SMTP",
- "EMAIL",
- NULL,
- &email);
- GNUNET_GC_get_configuration_value_string(coreAPI->cfg,
- "SMTP",
- "FILTER",
- NULL,
- &filter);
+ GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
+ "SMTP", "EMAIL", NULL, &email);
+ GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
+ "SMTP", "FILTER", NULL, &filter);
if (strlen (filter) > FILTER_STRING_SIZE)
{
filter[FILTER_STRING_SIZE] = '\0';
@@ -532,26 +523,29 @@
return msg;
}
-struct GetMessageClosure {
+struct GetMessageClosure
+{
unsigned int esize;
unsigned int pos;
- char * ebody;
+ char *ebody;
};
-static const char *
-get_message(void ** buf, int * len, void * cls) {
- struct GetMessageClosure * gmc = cls;
+static const char *
+get_message (void **buf, int *len, void *cls)
+{
+ struct GetMessageClosure *gmc = cls;
*buf = NULL;
- if (len == NULL) {
- gmc->pos = 0;
- return NULL;
- }
+ if (len == NULL)
+ {
+ gmc->pos = 0;
+ return NULL;
+ }
if (gmc->pos == gmc->esize)
- return NULL; /* done */
+ return NULL; /* done */
*len = gmc->esize;
gmc->pos = gmc->esize;
- return gmc->ebody;
+ return gmc->ebody;
}
/**
@@ -566,10 +560,10 @@
api_send (GNUNET_TSession * tsession,
const void *msg, const unsigned int size, int important)
{
- const GNUNET_MessageHello * hello;
- const EmailAddress * haddr;
- char * m;
- SMTPMessage * mp;
+ const GNUNET_MessageHello *hello;
+ const EmailAddress *haddr;
+ char *m;
+ SMTPMessage *mp;
struct GetMessageClosure gm_cls;
smtp_session_t session;
smtp_message_t message;
@@ -587,7 +581,7 @@
hello = (const GNUNET_MessageHello *) tsession->internal;
if (hello == NULL)
return GNUNET_SYSERR;
- GNUNET_mutex_lock(lock);
+ GNUNET_mutex_lock (lock);
session = smtp_create_session ();
if (session == NULL)
{
@@ -595,21 +589,21 @@
GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER |
GNUNET_GE_IMMEDIATE,
_("SMTP: `%s' failed: %s.\n"),
- "smtp_create_session",
+ "smtp_create_session",
smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
- GNUNET_mutex_unlock(lock);
+ GNUNET_mutex_unlock (lock);
return GNUNET_SYSERR;
}
- if (0 == smtp_set_server (session, smtp_server_name))
+ if (0 == smtp_set_server (session, smtp_server_name))
{
GNUNET_GE_LOG (ectx,
GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER |
GNUNET_GE_IMMEDIATE,
_("SMTP: `%s' failed: %s.\n"),
- "smtp_set_server",
+ "smtp_set_server",
smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
- smtp_destroy_session(session);
- GNUNET_mutex_unlock(lock);
+ smtp_destroy_session (session);
+ GNUNET_mutex_unlock (lock);
return GNUNET_SYSERR;
}
message = smtp_add_message (session);
@@ -617,12 +611,12 @@
{
GNUNET_GE_LOG (ectx,
GNUNET_GE_WARNING | GNUNET_GE_ADMIN | GNUNET_GE_USER |
- GNUNET_GE_BULK,
+ GNUNET_GE_BULK,
_("SMTP: `%s' failed: %s.\n"),
- "smtp_add_message",
+ "smtp_add_message",
smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
- smtp_destroy_session(session);
- GNUNET_mutex_unlock(lock);
+ smtp_destroy_session (session);
+ GNUNET_mutex_unlock (lock);
return GNUNET_SYSERR;
}
haddr = (const EmailAddress *) &hello[1];
@@ -631,75 +625,76 @@
{
GNUNET_GE_LOG (ectx,
GNUNET_GE_WARNING | GNUNET_GE_ADMIN | GNUNET_GE_USER |
- GNUNET_GE_BULK,
+ GNUNET_GE_BULK,
_("SMTP: `%s' failed: %s.\n"),
- "smtp_add_recipient",
+ "smtp_add_recipient",
smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
- smtp_destroy_session(session);
- GNUNET_mutex_unlock(lock);
+ smtp_destroy_session (session);
+ GNUNET_mutex_unlock (lock);
return GNUNET_SYSERR;
}
- if (0 == smtp_set_header(message,
- haddr->filter))
+ if (0 == smtp_set_header (message, haddr->filter))
{
GNUNET_GE_LOG (ectx,
GNUNET_GE_WARNING | GNUNET_GE_ADMIN | GNUNET_GE_USER |
- GNUNET_GE_BULK,
+ GNUNET_GE_BULK,
_("SMTP: `%s' failed: %s.\n"),
- "smtp_set_header",
+ "smtp_set_header",
smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
- smtp_destroy_session(session);
- GNUNET_mutex_unlock(lock);
+ smtp_destroy_session (session);
+ GNUNET_mutex_unlock (lock);
return GNUNET_SYSERR;
- }
- m = GNUNET_malloc (size + sizeof(SMTPMessage));
+ }
+ m = GNUNET_malloc (size + sizeof (SMTPMessage));
memcpy (m, msg, size);
- mp = (SMTPMessage*) &m[size];
- mp->header.size = htons (size + sizeof(SMTPMessage));
+ mp = (SMTPMessage *) & m[size];
+ mp->header.size = htons (size + sizeof (SMTPMessage));
mp->header.type = htons (0);
mp->sender = *coreAPI->myIdentity;
gm_cls.ebody = NULL;
gm_cls.pos = 0;
- gm_cls.esize = base64_encode (m, size + sizeof(SMTPMessage), &gm_cls.ebody);
+ gm_cls.esize =
+ base64_encode (m, size + sizeof (SMTPMessage), &gm_cls.ebody);
GNUNET_free (m);
- if (0 == smtp_size_set_estimate (message, gm_cls.esize))
+ if (0 == smtp_size_set_estimate (message, gm_cls.esize))
{
- GNUNET_GE_LOG (ectx,
- GNUNET_GE_WARNING | GNUNET_GE_ADMIN | GNUNET_GE_USER |
- GNUNET_GE_BULK,
- _("SMTP: `%s' failed: %s.\n"),
- "smtp_size_set_estimate",
- smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_WARNING | GNUNET_GE_ADMIN | GNUNET_GE_USER |
+ GNUNET_GE_BULK,
+ _("SMTP: `%s' failed: %s.\n"),
+ "smtp_size_set_estimate",
+ smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
}
- if (0 == smtp_set_messagecb (message, &get_message, &gm_cls))
+ if (0 == smtp_set_messagecb (message, &get_message, &gm_cls))
{
GNUNET_GE_LOG (ectx,
GNUNET_GE_WARNING | GNUNET_GE_ADMIN | GNUNET_GE_USER |
- GNUNET_GE_BULK,
+ GNUNET_GE_BULK,
_("SMTP: `%s' failed: %s.\n"),
- "smtp_set_messagecb",
+ "smtp_set_messagecb",
smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
- smtp_destroy_session(session);
- GNUNET_mutex_unlock(lock);
+ smtp_destroy_session (session);
+ GNUNET_mutex_unlock (lock);
GNUNET_free (gm_cls.ebody);
return GNUNET_SYSERR;
}
- if (0 == smtp_start_session(session))
+ if (0 == smtp_start_session (session))
{
GNUNET_GE_LOG (ectx,
GNUNET_GE_WARNING | GNUNET_GE_ADMIN | GNUNET_GE_USER |
- GNUNET_GE_BULK,
+ GNUNET_GE_BULK,
_("SMTP: `%s' failed: %s.\n"),
- "smtp_start_session",
+ "smtp_start_session",
smtp_strerror (smtp_errno (), ebuf, EBUF_LEN));
- smtp_destroy_session(session);
- GNUNET_mutex_unlock(lock);
+ smtp_destroy_session (session);
+ GNUNET_mutex_unlock (lock);
GNUNET_free (gm_cls.ebody);
return GNUNET_SYSERR;
}
- GNUNET_network_monitor_notify_transmission(coreAPI->load_monitor,
GNUNET_ND_UPLOAD, gm_cls.esize);
+ GNUNET_network_monitor_notify_transmission (coreAPI->load_monitor,
+ GNUNET_ND_UPLOAD, gm_cls.esize);
smtp_destroy_session (session);
- GNUNET_mutex_unlock(lock);
+ GNUNET_mutex_unlock (lock);
GNUNET_free (gm_cls.ebody);
return GNUNET_OK;
}
@@ -712,8 +707,7 @@
*/
static int
api_connect (const GNUNET_MessageHello * hello,
- GNUNET_TSession ** tsessionPtr,
- int may_reuse)
+ GNUNET_TSession ** tsessionPtr, int may_reuse)
{
GNUNET_TSession *tsession;
@@ -755,12 +749,13 @@
/* initialize SMTP network */
dispatchThread =
GNUNET_thread_create (&listenAndDistribute, NULL, 1024 * 4);
- if (dispatchThread == NULL) {
- GNUNET_GE_DIE_STRERROR (ectx,
- GNUNET_GE_ADMIN | GNUNET_GE_BULK |
- GNUNET_GE_FATAL, "pthread_create");
- return GNUNET_SYSERR;
- }
+ if (dispatchThread == NULL)
+ {
+ GNUNET_GE_DIE_STRERROR (ectx,
+ GNUNET_GE_ADMIN | GNUNET_GE_BULK |
+ GNUNET_GE_FATAL, "pthread_create");
+ return GNUNET_SYSERR;
+ }
return GNUNET_OK;
}
@@ -784,8 +779,7 @@
*/
static int
api_hello_to_address (const GNUNET_MessageHello * hello,
- void ** sa,
- unsigned int * sa_len)
+ void **sa, unsigned int *sa_len)
{
return GNUNET_SYSERR;
}
@@ -805,9 +799,9 @@
*/
static int
api_test_would_try (GNUNET_TSession * tsession, const unsigned int size,
- int important)
+ int important)
{
- return GNUNET_OK; /* we always try... */
+ return GNUNET_OK; /* we always try... */
}
/**
@@ -824,13 +818,12 @@
coreAPI = core;
ectx = core->ectx;
- GNUNET_GC_get_configuration_value_number(coreAPI->cfg,
- "SMTP",
- "MTU",
- 1200,
- SMTP_MESSAGE_SIZE,
- SMTP_MESSAGE_SIZE,
- &mtu);
+ GNUNET_GC_get_configuration_value_number (coreAPI->cfg,
+ "SMTP",
+ "MTU",
+ 1200,
+ SMTP_MESSAGE_SIZE,
+ SMTP_MESSAGE_SIZE, &mtu);
stats = coreAPI->requestService ("stats");
if (stats != NULL)
{
@@ -840,16 +833,16 @@
stat_bytesDropped
= stats->create (gettext_noop ("# bytes dropped by TCP (outgoing)"));
}
- lock = GNUNET_mutex_create(GNUNET_NO);
- GNUNET_GC_get_configuration_value_string(coreAPI->cfg,
- "SMTP",
- "SERVER",
- "localhost:25",
- &smtp_server_name);
+ lock = GNUNET_mutex_create (GNUNET_NO);
+ GNUNET_GC_get_configuration_value_string (coreAPI->cfg,
+ "SMTP",
+ "SERVER",
+ "localhost:25",
+ &smtp_server_name);
sa.sa_handler = SIG_IGN;
sigemptyset (&sa.sa_mask);
sa.sa_flags = 0;
- sigaction (SIGPIPE, &sa, &old_handler);
+ sigaction (SIGPIPE, &sa, &old_handler);
smtpAPI.protocolNumber = GNUNET_TRANSPORT_PROTOCOL_NUMBER_SMTP;
smtpAPI.mtu = mtu - sizeof (SMTPMessage);
smtpAPI.cost = 50;
@@ -869,14 +862,14 @@
void
donetransport_smtp ()
{
- sigaction (SIGPIPE, &old_handler, NULL);
- GNUNET_free(smtp_server_name);
+ sigaction (SIGPIPE, &old_handler, NULL);
+ GNUNET_free (smtp_server_name);
if (stats != NULL)
{
coreAPI->releaseService (stats);
stats = NULL;
}
- GNUNET_mutex_destroy(lock);
+ GNUNET_mutex_destroy (lock);
lock = NULL;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r5816 - in GNUnet/src: applications/chat applications/dht/tools applications/fs/lib applications/fs/tools applications/stats applications/tbench applications/template applications/tracekit applications/vpn include server setup transports,
gnunet <=