[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r7419 - in GNUnet: libltdl src/applications/datastore src/a
From: |
gnunet |
Subject: |
[GNUnet-SVN] r7419 - in GNUnet: libltdl src/applications/datastore src/applications/dht/tools src/applications/fs/collection src/applications/fs/ecrs src/applications/fs/fsui src/applications/fs/gap src/applications/fs/lib src/applications/fs/tools src/applications/sqstore_mysql src/applications/testing src/include src/server src/setup/gtk src/setup/lib src/setup/ncurses src/transports src/util/error src/util/os |
Date: |
Sun, 13 Jul 2008 14:53:55 -0600 (MDT) |
Author: grothoff
Date: 2008-07-13 14:53:55 -0600 (Sun, 13 Jul 2008)
New Revision: 7419
Modified:
GNUnet/libltdl/ltdl.c
GNUnet/src/applications/datastore/datastore.c
GNUnet/src/applications/dht/tools/dht-query.c
GNUnet/src/applications/dht/tools/dht_api.c
GNUnet/src/applications/dht/tools/dht_multipeer_test.c
GNUnet/src/applications/dht/tools/dht_twopeer_test.c
GNUnet/src/applications/fs/collection/collection.c
GNUnet/src/applications/fs/ecrs/namespace.c
GNUnet/src/applications/fs/ecrs/search.c
GNUnet/src/applications/fs/fsui/fsui.c
GNUnet/src/applications/fs/gap/fs.c
GNUnet/src/applications/fs/gap/gap.c
GNUnet/src/applications/fs/gap/migration.c
GNUnet/src/applications/fs/lib/fslib.c
GNUnet/src/applications/fs/tools/gnunet-auto-share.c
GNUnet/src/applications/fs/tools/gnunet-insert.c
GNUnet/src/applications/fs/tools/gnunet-unindex.c
GNUnet/src/applications/sqstore_mysql/mysql.c
GNUnet/src/applications/testing/remote.c
GNUnet/src/applications/testing/remotetopologies.c
GNUnet/src/applications/testing/testing.c
GNUnet/src/include/plibc.h
GNUnet/src/server/connection.c
GNUnet/src/server/gnunet-transport-check.c
GNUnet/src/server/gnunet-update.c
GNUnet/src/setup/gtk/ngconf.c
GNUnet/src/setup/lib/gns.c
GNUnet/src/setup/ncurses/mconf.c
GNUnet/src/transports/http.c
GNUnet/src/util/error/error.c
GNUnet/src/util/error/error_test.c
GNUnet/src/util/os/osconfig.c
Log:
indent
Modified: GNUnet/libltdl/ltdl.c
===================================================================
--- GNUnet/libltdl/ltdl.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/libltdl/ltdl.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -1770,9 +1770,9 @@
*) (((struct
dylib_command
*)
- lc)->dylib.
- name.offset
- +
+ lc)->
+ dylib.name.
+ offset +
(unsigned
long)
lc));
Modified: GNUnet/src/applications/datastore/datastore.c
===================================================================
--- GNUnet/src/applications/datastore/datastore.c 2008-07-13 20:53:18 UTC
(rev 7418)
+++ GNUnet/src/applications/datastore/datastore.c 2008-07-13 20:53:55 UTC
(rev 7419)
@@ -130,10 +130,10 @@
#if 0
/* this is just an extra check to validate that
- the bloomfilter was corret; doing this check
- is very costly -- do not do in production! */
+ the bloomfilter was corret; doing this check
+ is very costly -- do not do in production! */
ret = sq->get (query, NULL, type, iter, closure);
- GNUNET_GE_BREAK(NULL, ret == 0);
+ GNUNET_GE_BREAK (NULL, ret == 0);
#endif
return ret;
}
@@ -353,10 +353,9 @@
{
available = quota - sq->getSize ();
sq->iterateExpirationTime (GNUNET_ECRS_BLOCKTYPE_ANY,
- &freeSpaceExpired, NULL);
+ &freeSpaceExpired, NULL);
if ((available < 0) || (available < MIN_GNUNET_free))
- sq->iterateLowPriority (GNUNET_ECRS_BLOCKTYPE_ANY,
- &freeSpaceLow, NULL);
+ sq->iterateLowPriority (GNUNET_ECRS_BLOCKTYPE_ANY, &freeSpaceLow, NULL);
}
/**
@@ -392,9 +391,9 @@
stat_filter_failed =
stats->create (gettext_noop ("# bloom filter false positives"));
- stats->
- set (stats->create (gettext_noop ("# bytes allowed in datastore")),
- quota);
+ stats->set (stats->
+ create (gettext_noop ("# bytes allowed in datastore")),
+ quota);
}
state = capi->service_request ("state");
if (state != NULL)
@@ -506,19 +505,18 @@
const GNUNET_DatastoreValue * value, void *closure,
unsigned long long uid)
{
- struct FAAProgressInfo * pi = closure;
+ struct FAAProgressInfo *pi = closure;
unsigned int pct_old;
unsigned int pct;
makeAvailable (key);
- pct_old = (100 * pi->pos) / pi->total;
- pi->pos += ntohl(value->size);
- pct = (100 * pi->pos) / pi->total;
+ pct_old = (100 * pi->pos) / pi->total;
+ pi->pos += ntohl (value->size);
+ pct = (100 * pi->pos) / pi->total;
if (pct != pct_old)
{
- fprintf(stdout,
- _("Datastore conversion at approximately %u%%\n"),
- pct);
+ fprintf (stdout,
+ _("Datastore conversion at approximately %u%%\n"), pct);
}
return GNUNET_OK;
@@ -565,17 +563,16 @@
sq = uapi->service_request ("sqstore");
if (sq != NULL)
{
- fprintf(stdout,
- _("Starting datastore conversion (this may take a while).\n"));
- pi.start = GNUNET_get_time();
+ fprintf (stdout,
+ _("Starting datastore conversion (this may take a while).\n"));
+ pi.start = GNUNET_get_time ();
pi.pos = 0;
- pi.total = GNUNET_ntohll(*lq);
+ pi.total = GNUNET_ntohll (*lq);
if (pi.total == 0)
- pi.total = 1;
+ pi.total = 1;
sq->iterateAllNow (&filterAddAll, &pi);
uapi->service_release (sq);
- fprintf(stdout,
- _("Completed datastore conversion.\n"));
+ fprintf (stdout, _("Completed datastore conversion.\n"));
}
else
{
Modified: GNUnet/src/applications/dht/tools/dht-query.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht-query.c 2008-07-13 20:53:18 UTC
(rev 7418)
+++ GNUnet/src/applications/dht/tools/dht-query.c 2008-07-13 20:53:55 UTC
(rev 7419)
@@ -87,11 +87,10 @@
&hc);
if (ret == GNUNET_SYSERR)
printf ("`%s(%s)' failed.\n", "get", key);
- GNUNET_thread_sleep(timeout);
- ret = GNUNET_DHT_get_stop(ctx,
- GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
- &hc);
- GNUNET_GE_ASSERT(NULL, ret == GNUNET_OK);
+ GNUNET_thread_sleep (timeout);
+ ret = GNUNET_DHT_get_stop (ctx,
+ GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING, &hc);
+ GNUNET_GE_ASSERT (NULL, ret == GNUNET_OK);
}
static void
Modified: GNUnet/src/applications/dht/tools/dht_api.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_api.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/dht/tools/dht_api.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -46,22 +46,21 @@
{
reply = NULL;
if (GNUNET_OK != GNUNET_client_connection_read (info->sock, &reply))
- {
- /* FIXME: we need to handle this better,
- if we were not aborted, we need to try
- to reconnect! -- this assertion failure
- is more like a warning to the end-user/developer
- that the code is not yet perfect... */
- GNUNET_GE_BREAK(NULL, info->aborted != GNUNET_NO);
- break;
- }
+ {
+ /* FIXME: we need to handle this better,
+ if we were not aborted, we need to try
+ to reconnect! -- this assertion failure
+ is more like a warning to the end-user/developer
+ that the code is not yet perfect... */
+ GNUNET_GE_BREAK (NULL, info->aborted != GNUNET_NO);
+ break;
+ }
if ((sizeof (CS_dht_request_put_MESSAGE) > ntohs (reply->size)) ||
(GNUNET_CS_PROTO_DHT_REQUEST_PUT != ntohs (reply->type)))
{
- fprintf(stderr,
- "Received message of type %u and size %u\n",
- ntohs(reply->type),
- ntohs(reply->size));
+ fprintf (stderr,
+ "Received message of type %u and size %u\n",
+ ntohs (reply->type), ntohs (reply->size));
GNUNET_GE_BREAK (NULL, 0);
GNUNET_free (reply);
break; /* invalid reply */
@@ -136,7 +135,7 @@
req.type = htonl (type);
req.key = *key;
if (GNUNET_OK != GNUNET_client_connection_write (ctx->sock, &req.header))
- return GNUNET_SYSERR;
+ return GNUNET_SYSERR;
return GNUNET_OK;
}
Modified: GNUnet/src/applications/dht/tools/dht_multipeer_test.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_multipeer_test.c 2008-07-13
20:53:18 UTC (rev 7418)
+++ GNUnet/src/applications/dht/tools/dht_multipeer_test.c 2008-07-13
20:53:55 UTC (rev 7419)
@@ -58,12 +58,13 @@
memset (expect, (*i), sizeof (expect));
#if 0
- fprintf (stderr, "Got %u %u `%.*s' (want `%.*s')\n", type, size, size, data,
sizeof(expect), expect);
+ fprintf (stderr, "Got %u %u `%.*s' (want `%.*s')\n", type, size, size, data,
+ sizeof (expect), expect);
#endif
if ((8 != size) ||
(0 != memcmp (expect, data, size)) ||
(type != GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING))
- return GNUNET_SYSERR;
+ return GNUNET_SYSERR;
found++;
return GNUNET_OK;
}
@@ -165,7 +166,7 @@
GNUNET_GC_free (cfg);
return -1;
}
- GNUNET_hash (buf, strlen(buf), &key);
+ GNUNET_hash (buf, strlen (buf), &key);
value = GNUNET_malloc (8);
memset (value, 'A' + i, 8);
CHECK (GNUNET_OK == GNUNET_DHT_put (cfg,
@@ -186,31 +187,30 @@
ctx_array[i] =
GNUNET_DHT_context_create (cfg, ectx, &result_callback, &c);
for (j = 0; j < NUM_PEERS; j++)
- {
- c = 'A' + j;
- GNUNET_snprintf (buf, 128, "localhost:%u", 2087 + j * 10);
- GNUNET_hash (buf, strlen(buf), &key);
+ {
+ c = 'A' + j;
+ GNUNET_snprintf (buf, 128, "localhost:%u", 2087 + j * 10);
+ GNUNET_hash (buf, strlen (buf), &key);
printf ("Peer %d gets key %d", i, j);
- last = found;
- GNUNET_DHT_get_start (ctx_array[i],
- GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
- &key);
- for (k = 0; k < NUM_ROUNDS; k++)
+ last = found;
+ GNUNET_DHT_get_start (ctx_array[i],
+ GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
+ &key);
+ for (k = 0; k < NUM_ROUNDS; k++)
{
- if (0 == (k %10))
- printf (".");
- fflush (stdout);
- GNUNET_thread_sleep(50 * GNUNET_CRON_MILLISECONDS);
- if (last < found)
- break;
+ if (0 == (k % 10))
+ printf (".");
+ fflush (stdout);
+ GNUNET_thread_sleep (50 * GNUNET_CRON_MILLISECONDS);
+ if (last < found)
+ break;
}
- GNUNET_DHT_get_stop (ctx_array[i],
- GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
- &key);
+ GNUNET_DHT_get_stop (ctx_array[i],
+ GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING, &key);
if (k < NUM_ROUNDS)
- printf (" OK!\n");
+ printf (" OK!\n");
else
- printf ("?\n");
+ printf ("?\n");
}
}
@@ -222,7 +222,8 @@
printf ("Found %u out of %u attempts.\n", found, NUM_PEERS * NUM_PEERS);
if (found < NUM_PEERS * NUM_PEERS / 2)
{
- printf ("Not enough results (not even 50%%), marking test as failed!\n");
+ printf
+ ("Not enough results (not even 50%%), marking test as failed!\n");
ret = 1;
}
FAILURE:
Modified: GNUnet/src/applications/dht/tools/dht_twopeer_test.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht_twopeer_test.c 2008-07-13
20:53:18 UTC (rev 7418)
+++ GNUnet/src/applications/dht/tools/dht_twopeer_test.c 2008-07-13
20:53:55 UTC (rev 7419)
@@ -67,7 +67,7 @@
if ((8 != size) ||
(0 != memcmp (expect, data, size)) ||
(type != GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING))
- return GNUNET_SYSERR;
+ return GNUNET_SYSERR;
peer1count--;
return GNUNET_OK;
}
@@ -86,8 +86,8 @@
memset (expect, (*i), sizeof (expect));
if ((8 != size) ||
(0 != memcmp (expect, data, size)) ||
- (type != GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING))
- return GNUNET_SYSERR;
+ (type != GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING))
+ return GNUNET_SYSERR;
peer2count--;
return GNUNET_OK;
}
@@ -147,8 +147,7 @@
sock = GNUNET_client_connection_create (NULL, cfg);
printf ("Waiting for peers to DHT-connect (1->2)");
while (GNUNET_OK ==
- GNUNET_STATS_get_statistics (NULL, sock, &waitForConnect,
- NULL))
+ GNUNET_STATS_get_statistics (NULL, sock, &waitForConnect, NULL))
{
printf (".");
fflush (stdout);
@@ -181,8 +180,7 @@
printf ("Waiting for peers to DHT-connect (2->1)");
sock = GNUNET_client_connection_create (NULL, cfg);
while (GNUNET_OK ==
- GNUNET_STATS_get_statistics (NULL, sock, &waitForConnect,
- NULL))
+ GNUNET_STATS_get_statistics (NULL, sock, &waitForConnect, NULL))
{
printf (".");
fflush (stdout);
@@ -233,20 +231,20 @@
printf ("Getting key 1 from peer 2 (stored at peer 1)");
want = 'A';
CHECK (GNUNET_OK == GNUNET_DHT_get_start (ctx_peer2,
-
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
- &key));
+
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
+ &key));
for (k = 0; k < NUM_ROUNDS; k++)
{
- if (0 == (k %10))
- printf (".");
+ if (0 == (k % 10))
+ printf (".");
fflush (stdout);
- GNUNET_thread_sleep(50 * GNUNET_CRON_MILLISECONDS);
+ GNUNET_thread_sleep (50 * GNUNET_CRON_MILLISECONDS);
if (peer2count < 10)
- break;
- }
+ break;
+ }
CHECK (GNUNET_OK == GNUNET_DHT_get_stop (ctx_peer2,
-
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
- &key));
+
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
+ &key));
printf (peer2count < 10 ? " OK!\n" : "?\n");
CHECK (peer2count < 10);
@@ -255,20 +253,20 @@
peer1count = 10;
want = 'B';
CHECK (GNUNET_OK == GNUNET_DHT_get_start (ctx_peer1,
-
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
- &key));
+
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
+ &key));
for (k = 0; k < NUM_ROUNDS; k++)
{
- if (0 == (k %10))
- printf (".");
+ if (0 == (k % 10))
+ printf (".");
fflush (stdout);
- GNUNET_thread_sleep(50 * GNUNET_CRON_MILLISECONDS);
+ GNUNET_thread_sleep (50 * GNUNET_CRON_MILLISECONDS);
if (peer2count < 10)
- break;
+ break;
}
CHECK (GNUNET_OK == GNUNET_DHT_get_stop (ctx_peer1,
-
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
- &key));
+
GNUNET_ECRS_BLOCKTYPE_DHT_STRING2STRING,
+ &key));
printf (peer1count < 10 ? " OK!\n" : "?\n");
CHECK (peer1count < 10);
Modified: GNUnet/src/applications/fs/collection/collection.c
===================================================================
--- GNUnet/src/applications/fs/collection/collection.c 2008-07-13 20:53:18 UTC
(rev 7418)
+++ GNUnet/src/applications/fs/collection/collection.c 2008-07-13 20:53:55 UTC
(rev 7419)
@@ -511,9 +511,12 @@
GNUNET_OK == GNUNET_ECRS_directory_create (ectx,
&dirData,
&dirLen,
-
collectionData->file_count,
-
collectionData->files,
-
collectionData->meta));
+ collectionData->
+ file_count,
+ collectionData->
+ files,
+ collectionData->
+ meta));
if (-1 == WRITE (fd, dirData, dirLen))
{
GNUNET_GE_LOG_STRERROR (ectx,
@@ -527,10 +530,10 @@
GNUNET_free (dirData);
CLOSE (fd);
if (GNUNET_OK != GNUNET_ECRS_file_upload (ectx, cfg, tmpName, GNUNET_NO,
/* indexing */
- ntohl (collectionData->
- data.anonymityLevel),
- ntohl (collectionData->
- data.priority),
+ ntohl (collectionData->data.
+ anonymityLevel),
+ ntohl (collectionData->data.
+ priority),
GNUNET_get_time () +
COLLECTION_ADV_LIFETIME, NULL,
NULL, NULL, NULL, &directoryURI))
@@ -555,10 +558,10 @@
uri = GNUNET_ECRS_namespace_add_content (ectx,
cfg,
&collectionData->data.pid,
- ntohl (collectionData->
- data.anonymityLevel),
- ntohl (collectionData->
- data.priority),
+ ntohl (collectionData->data.
+ anonymityLevel),
+ ntohl (collectionData->data.
+ priority),
GNUNET_get_time () +
COLLECTION_ADV_LIFETIME,
this_revision_string,
Modified: GNUnet/src/applications/fs/ecrs/namespace.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/namespace.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/fs/ecrs/namespace.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -309,8 +309,8 @@
sizeof (unsigned
int),
&ksb->sblock,
- &ksb->
- kblock.signature));
+ &ksb->kblock.
+ signature));
/* extra check: verify sig */
GNUNET_RSA_free_key (pk);
if (GNUNET_OK != GNUNET_FS_insert (sock, knvalue))
Modified: GNUnet/src/applications/fs/ecrs/search.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/search.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/fs/ecrs/search.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -253,21 +253,20 @@
}
isRoot = 0 == memcmp (&sb->identifier, &allZeros, sizeof (GNUNET_HashCode));
fi.uri = GNUNET_ECRS_string_to_uri (ectx, uris);
- if ( (isRoot) &&
- (fi.uri == NULL) )
+ if ((isRoot) && (fi.uri == NULL))
{
- fi.uri = GNUNET_malloc(sizeof(URI));
+ fi.uri = GNUNET_malloc (sizeof (URI));
fi.uri->type = sks;
GNUNET_hash (&sb->subspace,
- sizeof(GNUNET_RSA_PublicKey),
- &fi.uri->data.sks.namespace);
- fi.uri->data.sks.identifier = GNUNET_strdup(id);
+ sizeof (GNUNET_RSA_PublicKey),
+ &fi.uri->data.sks.namespace);
+ fi.uri->data.sks.identifier = GNUNET_strdup (id);
}
if (fi.uri == NULL)
{
GNUNET_GE_BREAK_OP (ectx, 0); /* sblock malformed */
GNUNET_meta_data_destroy (fi.meta);
- return GNUNET_SYSERR;
+ return GNUNET_SYSERR;
}
if (sqc->spcb != NULL)
{
@@ -277,8 +276,7 @@
}
else
ret = GNUNET_OK;
- if ( (strlen (id) > 0) &&
- (strlen (uris) > 0) )
+ if ((strlen (id) > 0) && (strlen (uris) > 0))
{
updateURI.type = sks;
GNUNET_hash (&sb->subspace,
@@ -315,9 +313,9 @@
GNUNET_HashCode query;
GNUNET_CronTime expiration;
- expiration = GNUNET_ntohll(value->expiration_time);
- if (expiration < GNUNET_get_time() )
- return GNUNET_OK; /* expired, ignore! */
+ expiration = GNUNET_ntohll (value->expiration_time);
+ if (expiration < GNUNET_get_time ())
+ return GNUNET_OK; /* expired, ignore! */
type = ntohl (value->type);
size = ntohl (value->size) - sizeof (GNUNET_DatastoreValue);
#if DEBUG_SEARCH
Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/fs/fsui/fsui.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -177,8 +177,7 @@
srl->test_download
= GNUNET_ECRS_file_download_partial_start (ctx->ectx,
ctx->cfg,
- sl->
- probe_context,
+
sl->probe_context,
srl->fi.uri,
NULL, off, len,
1, GNUNET_YES,
@@ -651,15 +650,15 @@
}
static void
-suspend_active_upload(struct GNUNET_FSUI_UploadList * ul)
+suspend_active_upload (struct GNUNET_FSUI_UploadList *ul)
{
while (ul != NULL)
{
if (ul->state == GNUNET_FSUI_ACTIVE)
- {
- ul->state = GNUNET_FSUI_PENDING;
- suspend_active_upload(ul->child);
- }
+ {
+ ul->state = GNUNET_FSUI_PENDING;
+ suspend_active_upload (ul->child);
+ }
ul = ul->next;
}
}
@@ -767,9 +766,9 @@
(upos->state == GNUNET_FSUI_ERROR)
|| (upos->state == GNUNET_FSUI_COMPLETED))
{
- if (upos->state == GNUNET_FSUI_ACTIVE)
- upos->state = GNUNET_FSUI_PENDING;
- suspend_active_upload(upos->child);
+ if (upos->state == GNUNET_FSUI_ACTIVE)
+ upos->state = GNUNET_FSUI_PENDING;
+ suspend_active_upload (upos->child);
GNUNET_thread_stop_sleep (upos->shared->handle);
GNUNET_thread_join (upos->shared->handle, &unused);
if (upos->state != GNUNET_FSUI_PENDING)
Modified: GNUnet/src/applications/fs/gap/fs.c
===================================================================
--- GNUnet/src/applications/fs/gap/fs.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/applications/fs/gap/fs.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -735,9 +735,9 @@
dblock = (const GNUNET_EC_DBlock *) &msg[1];
expiration = GNUNET_ntohll (msg->expiration);
- if ( (expiration > GNUNET_GAP_MAX_MIGRATION_EXP) &&
- (ntohl(dblock->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD) )
- return GNUNET_OK; /* expired KSK block -- ignore! */
+ if ((expiration > GNUNET_GAP_MAX_MIGRATION_EXP) &&
+ (ntohl (dblock->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD))
+ return GNUNET_OK; /* expired KSK block -- ignore! */
if (GNUNET_OK !=
GNUNET_EC_file_block_check_and_get_query (data_size,
dblock, GNUNET_YES, &query))
@@ -752,9 +752,9 @@
&query,
expiration, data_size, dblock);
/* convert expiration to absolute time and bound properly for
- storage in local datastore */
- now = GNUNET_get_time();
- if (expiration > GNUNET_GAP_MAX_MIGRATION_EXP)
+ storage in local datastore */
+ now = GNUNET_get_time ();
+ if (expiration > GNUNET_GAP_MAX_MIGRATION_EXP)
{
/* expired, sometime in the past */
expiration = now - 1;
@@ -762,10 +762,10 @@
else
{
/* expires in future, apply bounding! */
- if (ntohl(dblock->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD)
- expiration %= GNUNET_GAP_MAX_MIGRATION_EXP_KSK;
+ if (ntohl (dblock->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD)
+ expiration %= GNUNET_GAP_MAX_MIGRATION_EXP_KSK;
else
- expiration %= GNUNET_GAP_MAX_MIGRATION_EXP;
+ expiration %= GNUNET_GAP_MAX_MIGRATION_EXP;
expiration += now;
}
/* forward to local clients */
@@ -1002,7 +1002,7 @@
void
update_module_fs (GNUNET_UpdateAPI * uapi)
{
- uapi->service_update("datastore");
+ uapi->service_update ("datastore");
}
Modified: GNUnet/src/applications/fs/gap/gap.c
===================================================================
--- GNUnet/src/applications/fs/gap/gap.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/fs/gap/gap.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -184,15 +184,15 @@
if (now > et)
{
et -= now;
- if (ntohl(value->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD)
- et %= GNUNET_GAP_MAX_MIGRATION_EXP_KSK;
+ if (ntohl (value->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD)
+ et %= GNUNET_GAP_MAX_MIGRATION_EXP_KSK;
else
- et %= GNUNET_GAP_MAX_MIGRATION_EXP;
+ et %= GNUNET_GAP_MAX_MIGRATION_EXP;
}
else
{
- if (ntohl(value->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD)
- return want_more; /* expired KSK -- ignore! */
+ if (ntohl (value->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD)
+ return want_more; /* expired KSK -- ignore! */
/* indicate entry has expired */
et = -1;
}
Modified: GNUnet/src/applications/fs/gap/migration.c
===================================================================
--- GNUnet/src/applications/fs/gap/migration.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/fs/gap/migration.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -299,7 +299,7 @@
et -= now;
else
et = 0;
- if (ntohl(value->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD)
+ if (ntohl (value->type) == GNUNET_ECRS_BLOCKTYPE_KEYWORD)
et %= GNUNET_GAP_MAX_MIGRATION_EXP_KSK;
else
et %= GNUNET_GAP_MAX_MIGRATION_EXP;
Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/fs/lib/fslib.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -497,8 +497,8 @@
return GNUNET_SYSERR;
}
if (GNUNET_OK != GNUNET_client_connection_read_result (sock, &ret))
- {
- GNUNET_GE_BREAK (NULL, GNUNET_shutdown_test());
+ {
+ GNUNET_GE_BREAK (NULL, GNUNET_shutdown_test ());
GNUNET_free (ri);
return GNUNET_SYSERR;
}
Modified: GNUnet/src/applications/fs/tools/gnunet-auto-share.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-auto-share.c 2008-07-13
20:53:18 UTC (rev 7418)
+++ GNUnet/src/applications/fs/tools/gnunet-auto-share.c 2008-07-13
20:53:55 UTC (rev 7419)
@@ -72,7 +72,7 @@
static struct GNUNET_FSUI_Context *ctx;
static char *cfgFilename =
-#ifndef MINGW
+#ifndef MINGW
GNUNET_DEFAULT_CLIENT_CONFIG_FILE
#else
GNUNET_DEFAULT_CLIENT_SITE_CONFIG_FILE
@@ -111,14 +111,13 @@
switch (event->type)
{
case GNUNET_FSUI_upload_progress:
- if ( (*verboselevel > 2) &&
- (event->data.UploadProgress.uc.pos != ul) )
+ if ((*verboselevel > 2) && (event->data.UploadProgress.uc.pos != ul))
{
fprintf (myout,
_("Upload of `%s' at %llu out of %llu bytes.\n"),
event->data.UploadProgress.filename,
- event->data.UploadProgress.completed,
- event->data.UploadProgress.total);
+ event->data.UploadProgress.completed,
+ event->data.UploadProgress.total);
fflush (myout);
}
break;
@@ -149,8 +148,7 @@
upload_done = GNUNET_YES;
break;
case GNUNET_FSUI_upload_started:
- if ( (*verboselevel > 1) &&
- (ul == NULL) )
+ if ((*verboselevel > 1) && (ul == NULL))
{
fprintf (myout,
_("Starting upload of `%s'.\n"),
@@ -161,29 +159,28 @@
case GNUNET_FSUI_upload_stopped:
break;
case GNUNET_FSUI_upload_suspended:
- if ( (ul != NULL) &&
- (event->data.UploadSuspended.uc.pos == ul) )
- {
- fprintf (myout, _("Uploading suspended.\n"));
+ if ((ul != NULL) && (event->data.UploadSuspended.uc.pos == ul))
+ {
+ fprintf (myout, _("Uploading suspended.\n"));
fflush (myout);
- ul = NULL;
- }
+ ul = NULL;
+ }
break;
case GNUNET_FSUI_upload_resumed:
if (ul == NULL)
- {
- ul = event->data.UploadResumed.uc.pos;
- if (GNUNET_FSUI_ACTIVE != event->data.UploadResumed.state)
- {
- upload_done = GNUNET_YES;
- }
- else
- {
- fprintf (myout, _("Uploading `%s' resumed.\n"),
- event->data.UploadResumed.filename);
- fflush (myout);
- }
- }
+ {
+ ul = event->data.UploadResumed.uc.pos;
+ if (GNUNET_FSUI_ACTIVE != event->data.UploadResumed.state)
+ {
+ upload_done = GNUNET_YES;
+ }
+ else
+ {
+ fprintf (myout, _("Uploading `%s' resumed.\n"),
+ event->data.UploadResumed.filename);
+ fflush (myout);
+ }
+ }
break;
default:
fprintf (myout, _("Unexpected event: %d\n"), event->type);
@@ -236,8 +233,7 @@
GNUNET_hash (dirname, strlen (dirname), &hc);
GNUNET_hash_to_enc (&hc, &enc);
- return GNUNET_get_home_filename (ectx,
- cfg,
+ return GNUNET_get_home_filename (ectx, cfg,
#ifndef MINGW
GNUNET_NO,
#else
@@ -712,7 +708,7 @@
if ((*dirs_idx2 == ';') || (*dirs_idx2 == '\0'))
{
int end;
-
+
end = *dirs_idx2 == '\0';
*dirs_idx2 = 0;
@@ -723,7 +719,7 @@
pos->run = 0;
pos->next = head;
head = pos;
-
+
if (end)
break;
@@ -739,37 +735,36 @@
work_done = GNUNET_NO;
GNUNET_thread_sleep (250 * GNUNET_CRON_MILLISECONDS);
if (ul == NULL)
- {
- pos = head;
- while ((pos != NULL) && (GNUNET_NO == GNUNET_shutdown_test ()))
- {
- GNUNET_disk_directory_scan (ectx, pos->dirname, &probe_directory,
- pos);
- if (GNUNET_YES == upload_done)
- {
- work_done = GNUNET_YES;
- GNUNET_FSUI_upload_abort (ul);
- GNUNET_FSUI_upload_stop (ul);
- upload_done = GNUNET_NO;
- ul = NULL;
- }
- pos = pos->next;
- }
- }
+ {
+ pos = head;
+ while ((pos != NULL) && (GNUNET_NO == GNUNET_shutdown_test ()))
+ {
+ GNUNET_disk_directory_scan (ectx, pos->dirname,
+ &probe_directory, pos);
+ if (GNUNET_YES == upload_done)
+ {
+ work_done = GNUNET_YES;
+ GNUNET_FSUI_upload_abort (ul);
+ GNUNET_FSUI_upload_stop (ul);
+ upload_done = GNUNET_NO;
+ ul = NULL;
+ }
+ pos = pos->next;
+ }
+ }
else
- {
- if (GNUNET_YES == upload_done)
- {
- work_done = GNUNET_YES;
- GNUNET_FSUI_upload_abort (ul);
- GNUNET_FSUI_upload_stop (ul);
- upload_done = GNUNET_NO;
- ul = NULL;
- }
- }
+ {
+ if (GNUNET_YES == upload_done)
+ {
+ work_done = GNUNET_YES;
+ GNUNET_FSUI_upload_abort (ul);
+ GNUNET_FSUI_upload_stop (ul);
+ upload_done = GNUNET_NO;
+ ul = NULL;
+ }
+ }
if ((ul == NULL) &&
- (work_done == GNUNET_NO) &&
- (GNUNET_NO == GNUNET_shutdown_test ()))
+ (work_done == GNUNET_NO) && (GNUNET_NO == GNUNET_shutdown_test ()))
{
GNUNET_thread_sleep (delay);
delay *= 2;
@@ -813,7 +808,7 @@
void
auto_share_shutdown_initiate ()
{
- GNUNET_shutdown_initiate();
+ GNUNET_shutdown_initiate ();
}
/**
@@ -957,7 +952,7 @@
{
if ((*dirs_idx2 == ';') || (*dirs_idx2 == '\0'))
{
- do_break = ('\0' == *dirs_idx2);
+ do_break = ('\0' == *dirs_idx2);
*dirs_idx2 = '\0';
if (0 == strcmp (dirs_idx1, fullname))
{
@@ -968,8 +963,8 @@
fullname);
break;
}
- if (do_break)
- break;
+ if (do_break)
+ break;
dirs_idx1 = ++dirs_idx2;
}
else
Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c 2008-07-13 20:53:18 UTC
(rev 7418)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c 2008-07-13 20:53:55 UTC
(rev 7419)
@@ -423,7 +423,7 @@
"-t", "-P");
errorCode = -1;
goto quit;
- }
+ }
}
else
{ /* ordinary insertion checks */
@@ -461,16 +461,14 @@
gloKeywords,
anonymity,
priority,
- start_time + expiration,
- us, meta);
+ start_time + expiration, us, meta);
if (topKeywords != NULL)
GNUNET_ECRS_publish_under_keyword (ectx,
cfg,
topKeywords,
anonymity,
priority,
- start_time + expiration,
- us, meta);
+ start_time + expiration, us, meta);
GNUNET_ECRS_uri_destroy (us);
goto quit;
}
Modified: GNUnet/src/applications/fs/tools/gnunet-unindex.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-unindex.c 2008-07-13 20:53:18 UTC
(rev 7418)
+++ GNUnet/src/applications/fs/tools/gnunet-unindex.c 2008-07-13 20:53:55 UTC
(rev 7419)
@@ -75,9 +75,9 @@
event->data.UnindexCompleted.total,
delta / GNUNET_CRON_SECONDS,
(delta ==
- 0) ? (double) (-1.0) : (double) (event->
- data.UnindexCompleted.
- total / 1024.0 *
+ 0) ? (double) (-1.0) : (double) (event->data.
+ UnindexCompleted.total /
+ 1024.0 *
GNUNET_CRON_SECONDS /
delta));
}
Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c 2008-07-13 20:53:18 UTC
(rev 7418)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c 2008-07-13 20:53:55 UTC
(rev 7419)
@@ -1273,8 +1273,8 @@
if (type != 0)
stmt =
(vhash !=
- NULL) ? dbh->
- count_entry_by_hash_vhash_and_type : dbh->count_entry_by_hash_and_type;
+ NULL) ? dbh->count_entry_by_hash_vhash_and_type : dbh->
+ count_entry_by_hash_and_type;
else
stmt =
(vhash !=
@@ -1416,8 +1416,8 @@
else
stmt =
(vhash !=
- NULL) ? dbh->
- select_entry_by_hash_and_vhash : dbh->select_entry_by_hash;
+ NULL) ? dbh->select_entry_by_hash_and_vhash : dbh->
+ select_entry_by_hash;
if (count == 0)
limit_off = off;
else
Modified: GNUnet/src/applications/testing/remote.c
===================================================================
--- GNUnet/src/applications/testing/remote.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/testing/remote.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -421,7 +421,8 @@
GNUNET_REMOTE_start_daemon (remote_gnunetd_path, "/tmp/",
temp, remote_config_path,
curr_host, ssh_username,
-
temp_pos->remote_friend_file_path);
+ temp_pos->
+ remote_friend_file_path);
GNUNET_GC_get_configuration_value_number (basecfg,
"NETWORK",
Modified: GNUnet/src/applications/testing/remotetopologies.c
===================================================================
--- GNUnet/src/applications/testing/remotetopologies.c 2008-07-13 20:53:18 UTC
(rev 7418)
+++ GNUnet/src/applications/testing/remotetopologies.c 2008-07-13 20:53:55 UTC
(rev 7419)
@@ -370,13 +370,15 @@
{
fprintf (stderr, ".");
if (GNUNET_YES == GNUNET_IDENTITY_request_connect (sock1,
-
&h2->senderIdentity))
+ &h2->
+
senderIdentity))
{
ret = GNUNET_OK;
break;
}
if (GNUNET_YES == GNUNET_IDENTITY_request_connect (sock2,
-
&h1->senderIdentity))
+ &h1->
+
senderIdentity))
{
ret = GNUNET_OK;
break;
Modified: GNUnet/src/applications/testing/testing.c
===================================================================
--- GNUnet/src/applications/testing/testing.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/applications/testing/testing.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -277,7 +277,8 @@
{
fprintf (stderr, ".");
if (GNUNET_YES == GNUNET_IDENTITY_request_connect (sock1,
-
&h2->senderIdentity))
+ &h2->
+
senderIdentity))
{
ret = GNUNET_OK;
GNUNET_free_non_null (h1);
@@ -285,7 +286,8 @@
break;
}
if (GNUNET_YES == GNUNET_IDENTITY_request_connect (sock2,
-
&h1->senderIdentity))
+ &h1->
+
senderIdentity))
{
ret = GNUNET_OK;
GNUNET_free_non_null (h1);
Modified: GNUnet/src/include/plibc.h
===================================================================
--- GNUnet/src/include/plibc.h 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/include/plibc.h 2008-07-13 20:53:55 UTC (rev 7419)
@@ -15,39 +15,46 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
-*/
-
+*/
+
+
/**
* @file include/plibc.h
* @brief PlibC header
* @attention This file is usually not installed under Unix,
* so ship it with your application
* @version $Revision: 1.46 $
- */
-
+ */
+
#ifndef _PLIBC_H_
#define _PLIBC_H_
-
+
#ifndef SIGALRM
- #define SIGALRM 14
-#endif
-
+#define SIGALRM 14
+#endif /*
+ */
+
#ifdef __cplusplus
-extern "C" {
-#endif
-
+extern "C"
+{
+
+#endif /*
+ */
+
#ifdef Q_OS_WIN32
- #define WINDOWS 1
-#endif
-
+#define WINDOWS 1
+#endif /*
+ */
+
#define HAVE_PLIBC_FD 0
-
+
#ifdef WINDOWS
-
+
#if ENABLE_NLS
- #include "langinfo.h"
-#endif
-
+#include "langinfo.h"
+#endif /*
+ */
+
#include <windows.h>
#include <Ws2tcpip.h>
#include <time.h>
@@ -57,55 +64,72 @@
#include <dirent.h>
#include <errno.h>
#include <stdarg.h>
-
+
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
-
-/* Conflicts with our definitions */
+
+/* Conflicts with our definitions */
#define __G_WIN32_H__
-
-/* Convert LARGE_INTEGER to double */
+
+/* Convert LARGE_INTEGER to double */
#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \
- (double)((x).LowPart))
-
+ (double) ((x).LowPart))
+
#define socklen_t int
#define ssize_t int
#define off_t int
#define int64_t long long
#define int32_t long
+
+struct stat64
+ {
+
+_dev_t st_dev;
+
+_ino_t st_ino;
+
+_mode_t st_mode;
+
+short st_nlink;
+
+short st_uid;
+
+short st_gid;
+
+ _dev_t st_rdev;
+
+ __int64 st_size;
+
+ __time64_t st_atime;
+
+ __time64_t st_mtime;
+
+ __time64_t st_ctime;
+
+};
+
-struct stat64
-{
- _dev_t st_dev;
- _ino_t st_ino;
- _mode_t st_mode;
- short st_nlink;
- short st_uid;
- short st_gid;
- _dev_t st_rdev;
- __int64 st_size;
- __time64_t st_atime;
- __time64_t st_mtime;
- __time64_t st_ctime;
-};
-
#ifndef pid_t
- #define pid_t int
-#endif
-
+#define pid_t int
+#endif /*
+ */
+
#ifndef WEXITSTATUS
- #define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
-#endif
-
-/* Thanks to the Cygwin project */
+#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 */
#ifndef EDEADLK
- #define EDEADLK 45 /* Deadlock condition */
-#endif
+#define EDEADLK 45 /* Deadlock condition */
+#endif /*
+ */
#ifndef ENOLCK
- #define ENOLCK 46 /* No record locks available */
-#endif
+#define ENOLCK 46 /* No record locks available */
+#endif /*
+ */
#define EBADE 50 /* Invalid exchange */
#define EBADR 51 /* Invalid request descriptor */
#define EXFULL 52 /* Exchange full */
@@ -113,8 +137,9 @@
#define EBADRQC 54 /* Invalid request code */
#define EBADSLT 55 /* Invalid slot */
#ifndef EDEADLOCK
- #define EDEADLOCK EDEADLK /* File locking deadlock error */
-#endif
+#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) */
@@ -141,15 +166,18 @@
#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 */
-#endif
+#define ENOSYS 88 /* Function not implemented */
+#endif /*
+ */
#define ENMFILE 89 /* No more files */
#ifndef ENOTEMPTY
- #define ENOTEMPTY 90 /* Directory not empty */
-#endif
+#define ENOTEMPTY 90 /* Directory not empty */
+#endif /*
+ */
#ifndef ENAMETOOLONG
- #define ENAMETOOLONG 91 /* File or path name too long */
-#endif
+#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 */
@@ -166,8 +194,9 @@
#define ENETUNREACH 114 /* Network is unreachable */
#define ENETDOWN 115 /* Network interface is not configured */
#ifndef ETIMEDOUT
- #define ETIMEDOUT 116 /* Connection timed out */
-#endif
+#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 */
@@ -186,14 +215,15 @@
#define EDQUOT 132 /* Disk quota exceeded */
#define ESTALE 133 /* Unknown error */
#ifndef ENOTSUP
- #define ENOTSUP 134 /* Not supported */
-#endif
+#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 */
-
+
#undef HOST_NOT_FOUND
#define HOST_NOT_FOUND 1
#undef TRY_AGAIN
@@ -202,95 +232,126 @@
#define NO_RECOVERY 3
#undef NO_ADDRESS
#define NO_ADDRESS 4
-
+
#define PROT_READ 0x1
#define PROT_WRITE 0x2
#define MAP_SHARED 0x1
#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 */
+
+};
+
+
+extern const struct in6_addr in6addr_any; /* :: */
+
+extern const struct in6_addr in6addr_loopback; /* ::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 */
-};
-
-extern const struct in6_addr in6addr_any; /* :: */
-extern const struct in6_addr in6addr_loopback; /* ::1 */
-
/* 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
-};
+ /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
+ };
+
+
+typedef struct
+ {
+
+LARGE_INTEGER IdleTime;
+
+LARGE_INTEGER KernelTime;
+
+LARGE_INTEGER UserTime;
+
+LARGE_INTEGER Reserved1[2];
+
+ULONG Reserved2;
+
+} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
+
-typedef struct
-{
- LARGE_INTEGER IdleTime;
- LARGE_INTEGER KernelTime;
- LARGE_INTEGER UserTime;
- LARGE_INTEGER Reserved1[2];
- ULONG Reserved2;
-} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
-
#define sleep(secs) (Sleep(secs * 1000))
-
-/*********************** statfs *****************************/
-/* fake block size */
+
+/*********************** statfs *****************************/
+/* fake block size */
#define FAKED_BLOCK_SIZE 512
-
-/* linux-compatible values for fs type */
+
+/* linux-compatible values for fs type */
#define MSDOS_SUPER_MAGIC 0x4d44
#define NTFS_SUPER_MAGIC 0x5346544E
-
-/*********************** End of statfs ***********************/
-
+
+/*********************** End of statfs ***********************/
+
#define SHUT_RDWR SD_BOTH
-
-/* Operations for flock() */
+
+/* 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 */
-
-/* Not supported under MinGW */
+
+/* Not supported under MinGW */
#define S_IRGRP 0
#define S_IWGRP 0
#define S_IROTH 0
@@ -302,302 +363,425 @@
#define S_ISVTX 0
#define S_IRWXG 0
#define S_IRWXO 0
-
+
#define SHUT_WR SD_SEND
#define SHUT_RD SD_RECEIVE
#define SHUT_RDWR SD_BOTH
-
+
#define SIGKILL 9
#define SIGTERM 15
-
+
#define SetErrnoFromWinError(e) _SetErrnoFromWinError(e, __FILE__, __LINE__)
-
-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();
-
-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);
+
+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 ();
+
+
+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);
+
#if USE_IPV6
-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 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, ...);
+
#ifdef ENABLE_NLS
-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_kill(pid_t pid, int sig);
-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);
-struct hostent *gethostbyname2(const char *name, int af);
-char *_win_strerror(int errnum);
-int IsWinNT();
-char *index(const char *s, int c);
+ 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_kill (pid_t pid, int sig);
+
+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);
+
+struct hostent *gethostbyname2 (const char *name, int af);
+
+char *_win_strerror (int errnum);
+
+int IsWinNT ();
+
+char *index (const char *s, int c);
+
#if !HAVE_STRNDUP
-char *strndup (const char *s, size_t n);
-#endif
+ char *strndup (const char *s, size_t n);
+
+#endif /*
+ */
#if !HAVE_STRNLEN
-size_t strnlen (const char *str, size_t maxlen);
-#endif
-
+ 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)
-#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 PLIBC_KILL(p, s) kill(p, s)
- #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 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 PLIBC_KILL(p, s) kill(p, s)
+#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"
+
#ifdef ENABLE_NLS
- #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 PLIBC_KILL(p, s) _win_kill(p, s)
- #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
+#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 PLIBC_KILL(p, s) _win_kill(p, s)
+#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 /*
+ */
+
-
#ifdef __cplusplus
-}
-#endif
+}
+#endif /*
+ */
+
-
#endif //_PLIBC_H_
-
-/* end of plibc.h */
+
+/* end of plibc.h */
Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/server/connection.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -721,8 +721,8 @@
if (root->session.tsession != NULL)
GNUNET_GE_ASSERT (NULL,
GNUNET_OK ==
- transport->assert_associated (root->
- session.tsession,
+ transport->assert_associated (root->session.
+ tsession,
__FILE__));
root = root->overflowChain;
}
@@ -1903,8 +1903,8 @@
stats->change (stat_transmitted, p);
be->available_send_window -= p;
be->lastSequenceNumberSend++;
- GNUNET_CORE_connection_reserve_downstream_bandwidth (&be->
- session.sender, 0);
+ GNUNET_CORE_connection_reserve_downstream_bandwidth (&be->session.
+ sender, 0);
if (be->idealized_limit > be->max_transmitted_limit)
be->max_transmitted_limit = be->idealized_limit;
else /* age */
@@ -2484,8 +2484,8 @@
{
IF_GELOG (ectx,
GNUNET_GE_INFO | GNUNET_GE_BULK | GNUNET_GE_USER,
- GNUNET_hash_to_enc (&entries[u]->session.
- sender.hashPubKey, &enc));
+ GNUNET_hash_to_enc (&entries[u]->session.sender.
+ hashPubKey, &enc));
GNUNET_GE_LOG (ectx,
GNUNET_GE_INFO | GNUNET_GE_BULK | GNUNET_GE_USER,
"peer `%s' transmitted above limit: %llu bpm > %u
bpm\n",
@@ -2508,8 +2508,8 @@
#if DEBUG_CONNECTION
IF_GELOG (ectx,
GNUNET_GE_INFO | GNUNET_GE_BULK | GNUNET_GE_DEVELOPER,
- GNUNET_hash_to_enc (&entries[u]->session.
- sender.hashPubKey, &enc));
+ GNUNET_hash_to_enc (&entries[u]->session.sender.
+ hashPubKey, &enc));
GNUNET_GE_LOG (ectx,
GNUNET_GE_INFO | GNUNET_GE_BULK |
GNUNET_GE_DEVELOPER,
@@ -2570,8 +2570,8 @@
for (u = 0; u < activePeerCount; u++)
{
GNUNET_CORE_connection_reserve_downstream_bandwidth (&entries
- [u]->session.
- sender, 0);
+ [u]->
+ session.sender, 0);
entries[u]->idealized_limit = 0;
}
while ((schedulableBandwidth > activePeerCount * 100) &&
@@ -2905,8 +2905,8 @@
IF_GELOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_REQUEST |
GNUNET_GE_DEVELOPER,
- GNUNET_hash_to_enc (&root->session.
- sender.hashPubKey, &enc));
+ GNUNET_hash_to_enc (&root->session.sender.
+ hashPubKey, &enc));
GNUNET_GE_LOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_REQUEST |
GNUNET_GE_DEVELOPER,
@@ -3009,8 +3009,8 @@
IF_GELOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_REQUEST |
GNUNET_GE_DEVELOPER,
- GNUNET_hash_to_enc (&root->session.
- sender.hashPubKey, &enc));
+ GNUNET_hash_to_enc (&root->session.sender.
+ hashPubKey, &enc));
GNUNET_GE_LOG (ectx,
GNUNET_GE_DEBUG | GNUNET_GE_REQUEST |
GNUNET_GE_DEVELOPER,
Modified: GNUnet/src/server/gnunet-transport-check.c
===================================================================
--- GNUnet/src/server/gnunet-transport-check.c 2008-07-13 20:53:18 UTC (rev
7418)
+++ GNUnet/src/server/gnunet-transport-check.c 2008-07-13 20:53:55 UTC (rev
7419)
@@ -426,10 +426,8 @@
}
/* have no client disturb us! */
GNUNET_GC_set_configuration_value_string (cfg,
- NULL,
- "TCPSERVER",
- "DISABLE",
- "YES");
+ NULL,
+ "TCPSERVER", "DISABLE", "YES");
expectedValue = GNUNET_malloc (expectedSize);
pos = expectedSize;
expectedValue[--pos] = '\0';
Modified: GNUnet/src/server/gnunet-update.c
===================================================================
--- GNUnet/src/server/gnunet-update.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/server/gnunet-update.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -193,10 +193,8 @@
uapi.cfg = cfg;
/* have no client disturb us! */
GNUNET_GC_set_configuration_value_string (cfg,
- NULL,
- "TCPSERVER",
- "DISABLE",
- "YES");
+ NULL,
+ "TCPSERVER", "DISABLE", "YES");
GNUNET_GC_get_configuration_value_string (cfg,
"MODULES",
"topology",
Modified: GNUnet/src/setup/gtk/ngconf.c
===================================================================
--- GNUnet/src/setup/gtk/ngconf.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/setup/gtk/ngconf.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -331,7 +331,7 @@
have = have | addNodeToTree (notebook, child);
break;
case GNUNET_GNS_KIND_LEAF:
- gtk_container_set_border_width (GTK_CONTAINER(vbox), 10);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
have = have | addLeafToTree (vbox, child);
break;
case GNUNET_GNS_KIND_ROOT:
Modified: GNUnet/src/setup/lib/gns.c
===================================================================
--- GNUnet/src/setup/lib/gns.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/setup/lib/gns.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -122,8 +122,8 @@
val = GNUNET_GC_get_configuration_value_yesno (cfg,
section,
option,
- pos->value.
- Boolean.def);
+ pos->value.Boolean.
+ def);
if (val == GNUNET_SYSERR)
{
return GNUNET_SYSERR;
@@ -138,9 +138,18 @@
if (GNUNET_SYSERR == GNUNET_GC_get_configuration_value_number (cfg,
section,
option,
-
pos->value.UInt64.min,
-
pos->value.UInt64.max,
-
pos->value.UInt64.def,
+ pos->
+ value.
+ UInt64.
+ min,
+ pos->
+ value.
+ UInt64.
+ max,
+ pos->
+ value.
+ UInt64.
+ def,
&val))
{
return GNUNET_SYSERR;
@@ -185,7 +194,10 @@
if (GNUNET_SYSERR == GNUNET_GC_get_configuration_value_string (cfg,
section,
option,
-
pos->value.String.def,
+ pos->
+ value.
+ String.
+ def,
&val))
return GNUNET_SYSERR;
GNUNET_free (pos->value.String.val);
@@ -202,8 +214,14 @@
(const
char
**)
-
pos->value.String.legalRange,
-
pos->value.String.def,
+ pos->
+ value.
+ String.
+
legalRange,
+ pos->
+ value.
+ String.
+ def,
&ival))
return GNUNET_SYSERR;
GNUNET_free (pos->value.String.val);
Modified: GNUnet/src/setup/ncurses/mconf.c
===================================================================
--- GNUnet/src/setup/ncurses/mconf.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/setup/ncurses/mconf.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -179,8 +179,10 @@
case DLG_EXIT_CANCEL:
if (0 != GNUNET_GC_set_configuration_value_string (cfg,
ectx,
-
pos->section,
-
pos->option,
+ pos->
+ section,
+ pos->
+ option,
st ==
DLG_EXIT_OK
? "YES" :
@@ -215,9 +217,12 @@
case DLG_EXIT_OK:
if (0 != GNUNET_GC_set_configuration_value_string (cfg,
ectx,
-
pos->section,
-
pos->option,
-
fitem.text))
+ pos->
+ section,
+ pos->
+ option,
+ fitem.
+ text))
{
show_help (pos->option,
gettext_noop
@@ -279,9 +284,13 @@
case DLG_EXIT_OK:
if (0 != GNUNET_GC_set_configuration_value_choice (cfg,
ectx,
-
pos->section,
-
pos->option,
-
val->String.legalRange
+ pos->
+ section,
+ pos->
+ option,
+ val->
+ String.
+ legalRange
[msel]))
{
show_help (pos->option,
@@ -360,8 +369,10 @@
tmp[strlen (tmp) - 1] = '\0';
if (0 != GNUNET_GC_set_configuration_value_choice (cfg,
ectx,
-
pos->section,
-
pos->option,
+ pos->
+ section,
+ pos->
+ option,
tmp))
{
GNUNET_free (tmp);
@@ -405,9 +416,12 @@
}
if (0 != GNUNET_GC_set_configuration_value_string (cfg,
ectx,
-
pos->section,
-
pos->option,
-
fitem.text))
+ pos->
+ section,
+ pos->
+ option,
+ fitem.
+ text))
{
show_help (pos->option,
gettext_noop
@@ -456,8 +470,10 @@
}
if (0 != GNUNET_GC_set_configuration_value_number (cfg,
ectx,
-
pos->section,
-
pos->option,
+ pos->
+
section,
+ pos->
+
option,
lval))
{
show_help (pos->option,
Modified: GNUnet/src/transports/http.c
===================================================================
--- GNUnet/src/transports/http.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/transports/http.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -1006,9 +1006,8 @@
cpy = sizeof (GNUNET_MessageHeader) - httpSession->cs.client.rpos1;
if (cpy > have)
cpy = have;
- memcpy (&httpSession->cs.
- client.rbuff1[httpSession->cs.client.rpos1], &inbuf[poff],
- cpy);
+ memcpy (&httpSession->cs.client.
+ rbuff1[httpSession->cs.client.rpos1], &inbuf[poff], cpy);
httpSession->cs.client.rpos1 += cpy;
have -= cpy;
poff += cpy;
@@ -1028,9 +1027,8 @@
httpSession->cs.client.rpos2;
if (cpy > have)
cpy = have;
- memcpy (&httpSession->cs.
- client.rbuff2[httpSession->cs.client.rpos2], &inbuf[poff],
- cpy);
+ memcpy (&httpSession->cs.client.
+ rbuff2[httpSession->cs.client.rpos2], &inbuf[poff], cpy);
have -= cpy;
poff += cpy;
httpSession->cs.client.rpos2 += cpy;
Modified: GNUnet/src/util/error/error.c
===================================================================
--- GNUnet/src/util/error/error.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/util/error/error.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -52,7 +52,7 @@
/**
* How many characters can a date/time string
* be at most?
- */
+ */
#define DATE_STR_SIZE 64
@@ -125,36 +125,34 @@
}
static void
-flush_bulk(struct GNUNET_GE_Context*ctx,
- const char * datestr)
+flush_bulk (struct GNUNET_GE_Context *ctx, const char *datestr)
{
char msg[DATE_STR_SIZE + BULK_TRACK_SIZE + 256];
GNUNET_CronTime now;
int rev;
char *last;
- if ( (ctx->last_bulk_time == 0) ||
- (ctx->last_bulk_repeat == 0) )
+ if ((ctx->last_bulk_time == 0) || (ctx->last_bulk_repeat == 0))
return;
- now = GNUNET_get_time();
+ now = GNUNET_get_time ();
rev = 0;
- last = memchr(ctx->last_bulk, '\0', BULK_TRACK_SIZE);
- if(last == NULL)
- last = &ctx->last_bulk[BULK_TRACK_SIZE-1];
- else if(last != ctx->last_bulk)
+ last = memchr (ctx->last_bulk, '\0', BULK_TRACK_SIZE);
+ if (last == NULL)
+ last = &ctx->last_bulk[BULK_TRACK_SIZE - 1];
+ else if (last != ctx->last_bulk)
last--;
- if (last[0] == '\n')
+ if (last[0] == '\n')
{
rev = 1;
last[0] = '\0';
}
- snprintf(msg,
- sizeof(msg),
- _("Message `%.*s' repeated %u times in the last %llus\n"),
- BULK_TRACK_SIZE,
- ctx->last_bulk,
- ctx->last_bulk_repeat,
- (now - ctx->last_bulk_time) / GNUNET_CRON_SECONDS);
+ snprintf (msg,
+ sizeof (msg),
+ _("Message `%.*s' repeated %u times in the last %llus\n"),
+ BULK_TRACK_SIZE,
+ ctx->last_bulk,
+ ctx->last_bulk_repeat,
+ (now - ctx->last_bulk_time) / GNUNET_CRON_SECONDS);
if (rev == 1)
last[0] = '\n';
if (ctx != NULL)
@@ -200,36 +198,32 @@
memset (date, 0, DATE_STR_SIZE);
tmptr = localtime (&timetmp);
strftime (date, DATE_STR_SIZE, "%b %d %H:%M:%S", tmptr);
- now = GNUNET_get_time();
- if ( (kind & GNUNET_GE_BULK) != 0)
+ now = GNUNET_get_time ();
+ if ((kind & GNUNET_GE_BULK) != 0)
{
- if ( (ctx->last_bulk_time != 0) &&
- (0 == strncmp(buf,
- ctx->last_bulk,
- sizeof(ctx->last_bulk))) )
- {
- ctx->last_bulk_repeat++;
- if ( (now - ctx->last_bulk_time > BULK_DELAY_THRESHOLD) ||
- (ctx->last_bulk_repeat > BULK_REPEAT_THRESHOLD) )
- flush_bulk(ctx, date);
- return;
- }
+ if ((ctx->last_bulk_time != 0) &&
+ (0 == strncmp (buf, ctx->last_bulk, sizeof (ctx->last_bulk))))
+ {
+ ctx->last_bulk_repeat++;
+ if ((now - ctx->last_bulk_time > BULK_DELAY_THRESHOLD) ||
+ (ctx->last_bulk_repeat > BULK_REPEAT_THRESHOLD))
+ flush_bulk (ctx, date);
+ return;
+ }
else
- {
- if (ctx->last_bulk_time != 0)
- flush_bulk(ctx, date);
- strncpy(ctx->last_bulk,
- buf,
- sizeof(ctx->last_bulk));
- ctx->last_bulk_repeat = 0;
- ctx->last_bulk_time = now;
- ctx->last_bulk_kind = kind;
- }
+ {
+ if (ctx->last_bulk_time != 0)
+ flush_bulk (ctx, date);
+ strncpy (ctx->last_bulk, buf, sizeof (ctx->last_bulk));
+ ctx->last_bulk_repeat = 0;
+ ctx->last_bulk_time = now;
+ ctx->last_bulk_kind = kind;
+ }
}
- if ( (now - ctx->last_bulk_time > BULK_DELAY_THRESHOLD) ||
- (ctx->last_bulk_repeat > BULK_REPEAT_THRESHOLD) )
+ if ((now - ctx->last_bulk_time > BULK_DELAY_THRESHOLD) ||
+ (ctx->last_bulk_repeat > BULK_REPEAT_THRESHOLD))
{
- flush_bulk(ctx, date);
+ flush_bulk (ctx, date);
ctx->last_bulk_time = 0;
}
if (ctx != NULL)
@@ -301,14 +295,14 @@
char date[DATE_STR_SIZE];
time_t timetmp;
struct tm *tmptr;
-
+
if (ctx == NULL)
return;
time (&timetmp);
memset (date, 0, DATE_STR_SIZE);
tmptr = localtime (&timetmp);
strftime (date, DATE_STR_SIZE, "%b %d %H:%M:%S", tmptr);
- flush_bulk(ctx, date);
+ flush_bulk (ctx, date);
if (ctx->destruct != NULL)
ctx->destruct (ctx->cls);
free (ctx);
Modified: GNUnet/src/util/error/error_test.c
===================================================================
--- GNUnet/src/util/error/error_test.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/util/error/error_test.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -28,12 +28,9 @@
#include "platform.h"
static void
-my_log (void *ctx,
- GNUNET_GE_KIND kind,
- const char *date,
- const char *msg)
+my_log (void *ctx, GNUNET_GE_KIND kind, const char *date, const char *msg)
{
- unsigned int * c = ctx;
+ unsigned int *c = ctx;
(*c)++;
}
@@ -42,36 +39,28 @@
int
main (int argc, char *argv[])
{
- struct GNUNET_GE_Context * ectx;
+ struct GNUNET_GE_Context *ectx;
unsigned int failureCount = 0;
unsigned int logs = 0;
- ectx = GNUNET_GE_create_context_callback(GNUNET_GE_ALL,
- &my_log,
- &logs,
- NULL,
- NULL);
- GNUNET_GE_LOG(ectx,
- GNUNET_GE_USER | GNUNET_GE_WARNING |
- GNUNET_GE_BULK,
- "Testing...\n");
- GNUNET_GE_LOG(ectx,
- GNUNET_GE_USER | GNUNET_GE_WARNING |
- GNUNET_GE_BULK,
- "Testing...\n");
- GNUNET_GE_LOG(ectx,
- GNUNET_GE_USER | GNUNET_GE_WARNING |
- GNUNET_GE_BULK,
- "Testing...\n");
+ ectx = GNUNET_GE_create_context_callback (GNUNET_GE_ALL,
+ &my_log, &logs, NULL, NULL);
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_USER | GNUNET_GE_WARNING |
+ GNUNET_GE_BULK, "Testing...\n");
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_USER | GNUNET_GE_WARNING |
+ GNUNET_GE_BULK, "Testing...\n");
+ GNUNET_GE_LOG (ectx,
+ GNUNET_GE_USER | GNUNET_GE_WARNING |
+ GNUNET_GE_BULK, "Testing...\n");
/* the last 2 calls should be merged (repated bulk messages!) */
- GNUNET_GE_free_context(ectx);
+ GNUNET_GE_free_context (ectx);
if (logs != 2)
failureCount++;
if (failureCount != 0)
{
- fprintf (stderr,
- "\n\n%d TESTS FAILED!\n\n",
- failureCount);
+ fprintf (stderr, "\n\n%d TESTS FAILED!\n\n", failureCount);
return -1;
}
return 0;
Modified: GNUnet/src/util/os/osconfig.c
===================================================================
--- GNUnet/src/util/os/osconfig.c 2008-07-13 20:53:18 UTC (rev 7418)
+++ GNUnet/src/util/os/osconfig.c 2008-07-13 20:53:55 UTC (rev 7419)
@@ -315,8 +315,7 @@
i = strlen (application) - 1;
if (i <= 0)
return GNUNET_SYSERR;
- while ( (i > 0) &&
- (application[i] != DIR_SEPARATOR) )
+ while ((i > 0) && (application[i] != DIR_SEPARATOR))
i--;
initscript = GNUNET_malloc (strlen (&application[i]) + 13);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r7419 - in GNUnet: libltdl src/applications/datastore src/applications/dht/tools src/applications/fs/collection src/applications/fs/ecrs src/applications/fs/fsui src/applications/fs/gap src/applications/fs/lib src/applications/fs/tools src/applications/sqstore_mysql src/applications/testing src/include src/server src/setup/gtk src/setup/lib src/setup/ncurses src/transports src/util/error src/util/os,
gnunet <=