gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29916 - in gnunet/src: dht nse transport


From: gnunet
Subject: [GNUnet-SVN] r29916 - in gnunet/src: dht nse transport
Date: Mon, 7 Oct 2013 10:48:43 +0200

Author: grothoff
Date: 2013-10-07 10:48:43 +0200 (Mon, 07 Oct 2013)
New Revision: 29916

Modified:
   gnunet/src/dht/gnunet-service-dht_neighbours.c
   gnunet/src/nse/gnunet-service-nse.c
   gnunet/src/transport/plugin_transport_smtp.c
Log:
rename coreAPI to core_api to follow naming conventions better

Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c      2013-10-07 08:47:44 UTC 
(rev 29915)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c      2013-10-07 08:48:43 UTC 
(rev 29916)
@@ -438,7 +438,7 @@
 /**
  * Handle to CORE.
  */
-static struct GNUNET_CORE_Handle *coreAPI;
+static struct GNUNET_CORE_Handle *core_api;
 
 /**
  * Handle to ATS.
@@ -801,7 +801,7 @@
   if (buf == NULL)
   {
     peer->th =
-        GNUNET_CORE_notify_transmit_ready (coreAPI, GNUNET_NO,
+        GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO,
                                            pending->importance,
                                            GNUNET_TIME_absolute_get_remaining
                                            (pending->timeout), &peer->id,
@@ -827,7 +827,7 @@
   if (peer->head != NULL)
   {
     peer->th =
-        GNUNET_CORE_notify_transmit_ready (coreAPI, GNUNET_NO,
+        GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO,
                                            pending->importance,
                                            GNUNET_TIME_absolute_get_remaining
                                            (pending->timeout), &peer->id, 
msize,
@@ -857,7 +857,7 @@
                             ("# Bytes of bandwidth requested from core"),
                             ntohs (pending->msg->size), GNUNET_NO);
   peer->th =
-      GNUNET_CORE_notify_transmit_ready (coreAPI, GNUNET_NO,
+      GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO,
                                          pending->importance,
                                          GNUNET_TIME_absolute_get_remaining
                                          (pending->timeout), &peer->id,
@@ -2179,11 +2179,11 @@
   log_route_details_stderr =
     (NULL != getenv("GNUNET_DHT_ROUTE_DEBUG")) ? GNUNET_YES : GNUNET_NO;
   atsAPI = GNUNET_ATS_performance_init (GDS_cfg, NULL, NULL);
-  coreAPI =
+  core_api =
       GNUNET_CORE_connect (GDS_cfg, NULL, &core_init, &handle_core_connect,
                            &handle_core_disconnect, NULL, GNUNET_NO, NULL,
                            GNUNET_NO, core_handlers);
-  if (coreAPI == NULL)
+  if (core_api == NULL)
     return GNUNET_SYSERR;
   all_known_peers = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO);
   return GNUNET_OK;
@@ -2196,10 +2196,10 @@
 void
 GDS_NEIGHBOURS_done ()
 {
-  if (NULL == coreAPI)
+  if (NULL == core_api)
     return;
-  GNUNET_CORE_disconnect (coreAPI);
-  coreAPI = NULL;
+  GNUNET_CORE_disconnect (core_api);
+  core_api = NULL;
   GNUNET_ATS_performance_done (atsAPI);
   atsAPI = NULL;
   GNUNET_assert (0 == GNUNET_CONTAINER_multipeermap_size (all_known_peers));

Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2013-10-07 08:47:44 UTC (rev 29915)
+++ gnunet/src/nse/gnunet-service-nse.c 2013-10-07 08:48:43 UTC (rev 29916)
@@ -216,7 +216,7 @@
 /**
  * Handle to the core service.
  */
-static struct GNUNET_CORE_Handle *coreAPI;
+static struct GNUNET_CORE_Handle *core_api;
 
 /**
  * Map of all connected peers.
@@ -660,7 +660,7 @@
 
   GNUNET_assert (NULL == peer_entry->th);
   peer_entry->th =
-      GNUNET_CORE_notify_transmit_ready (coreAPI, GNUNET_NO, NSE_PRIORITY,
+      GNUNET_CORE_notify_transmit_ready (core_api, GNUNET_NO, NSE_PRIORITY,
                                          GNUNET_TIME_UNIT_FOREVER_REL,
                                          &peer_entry->id,
                                          sizeof (struct
@@ -1324,10 +1324,10 @@
     GNUNET_SERVER_notification_context_destroy (nc);
     nc = NULL;
   }
-  if (NULL != coreAPI)
+  if (NULL != core_api)
   {
-    GNUNET_CORE_disconnect (coreAPI);
-    coreAPI = NULL;
+    GNUNET_CORE_disconnect (core_api);
+    core_api = NULL;
   }
   if (NULL != stats)
   {
@@ -1503,7 +1503,7 @@
   GNUNET_SERVER_add_handlers (srv, handlers);
   nc = GNUNET_SERVER_notification_context_create (srv, 1);
   /* Connect to core service and register core handlers */
-  coreAPI = GNUNET_CORE_connect (cfg,   /* Main configuration */
+  core_api = GNUNET_CORE_connect (cfg,   /* Main configuration */
                                  NULL,       /* Closure passed to functions */
                                  &core_init,    /* Call core_init once 
connected */
                                  &handle_core_connect,  /* Handle connects */
@@ -1513,7 +1513,7 @@
                                  NULL,  /* Don't want notified about all 
outbound messages */
                                  GNUNET_NO,     /* For header only outbound 
notification */
                                  core_handlers);        /* Register these 
handlers */
-  if (NULL == coreAPI)
+  if (NULL == core_api)
   {
     GNUNET_SCHEDULER_shutdown ();
     return;

Modified: gnunet/src/transport/plugin_transport_smtp.c
===================================================================
--- gnunet/src/transport/plugin_transport_smtp.c        2013-10-07 08:47:44 UTC 
(rev 29915)
+++ gnunet/src/transport/plugin_transport_smtp.c        2013-10-07 08:48:43 UTC 
(rev 29916)
@@ -95,7 +95,7 @@
 /**
  * apis (our advertised API and the core api )
  */
-static GNUNET_CoreAPIForTransport *coreAPI;
+static GNUNET_CoreAPIForTransport *core_api;
 
 static struct GNUNET_GE_Context *ectx;
 
@@ -322,8 +322,8 @@
     if ( (retl == NULL) || (smtp_shutdown == GNUNET_YES)) {\
       goto END; \
     }\
-    if (coreAPI->load_monitor != NULL) \
-     GNUNET_network_monitor_notify_transmission(coreAPI->load_monitor, 
GNUNET_ND_DOWNLOAD, strlen(retl)); \
+    if (core_api->load_monitor != NULL) \
+     GNUNET_network_monitor_notify_transmission(core_api->load_monitor, 
GNUNET_ND_DOWNLOAD, strlen(retl)); \
   } while (0)
 
 
@@ -390,7 +390,7 @@
                      "SMTP message passed to the core.\n");
 #endif
 
-      coreAPI->receive (coreMP);
+      core_api->receive (coreMP);
     }
 END:
 #if DEBUG_SMTP
@@ -449,7 +449,7 @@
   EmailAddress *haddr;
   int i;
 
-  GNUNET_GC_get_configuration_value_string (coreAPI->cfg, "SMTP", "FILTER",
+  GNUNET_GC_get_configuration_value_string (core_api->cfg, "SMTP", "FILTER",
                                             "X-mailer: GNUnet", &filter);
   if (NULL == strstr (filter, ": "))
   {
@@ -614,7 +614,7 @@
   mp = (SMTPMessage *) &m[size];
   mp->header.size = htons (size + sizeof (SMTPMessage));
   mp->header.type = htons (0);
-  mp->sender = *coreAPI->my_identity;
+  mp->sender = *core_api->my_identity;
   gm_cls.ebody = NULL;
   gm_cls.pos = 0;
   gm_cls.esize = base64_encode (m, size + sizeof (SMTPMessage), &gm_cls.ebody);
@@ -665,8 +665,8 @@
   }
   if (stats != NULL)
     stats->change (stat_bytesSent, size);
-  if (coreAPI->load_monitor != NULL)
-    GNUNET_network_monitor_notify_transmission (coreAPI->load_monitor,
+  if (core_api->load_monitor != NULL)
+    GNUNET_network_monitor_notify_transmission (core_api->load_monitor,
                                                 GNUNET_ND_UPLOAD, 
gm_cls.esize);
   smtp_message_reset_status (message);  /* this is needed to plug a 
28-byte/message memory leak in libesmtp */
   smtp_destroy_session (session);
@@ -790,21 +790,21 @@
   unsigned long long mtu;
   struct sigaction sa;
 
-  coreAPI = core;
+  core_api = core;
   ectx = core->ectx;
-  if (!GNUNET_GC_have_configuration_value (coreAPI->cfg, "SMTP", "EMAIL"))
+  if (!GNUNET_GC_have_configuration_value (core_api->cfg, "SMTP", "EMAIL"))
   {
     GNUNET_GE_LOG (ectx, GNUNET_GE_ERROR | GNUNET_GE_BULK | GNUNET_GE_USER,
                    _
                    ("No email-address specified, can not start SMTP 
transport.\n"));
     return NULL;
   }
-  GNUNET_GC_get_configuration_value_number (coreAPI->cfg, "SMTP", "MTU", 1200,
+  GNUNET_GC_get_configuration_value_number (core_api->cfg, "SMTP", "MTU", 1200,
                                             SMTP_MESSAGE_SIZE,
                                             SMTP_MESSAGE_SIZE, &mtu);
-  GNUNET_GC_get_configuration_value_number (coreAPI->cfg, "SMTP", "RATELIMIT",
+  GNUNET_GC_get_configuration_value_number (core_api->cfg, "SMTP", "RATELIMIT",
                                             0, 0, 1024 * 1024, &rate_limit);
-  stats = coreAPI->service_request ("stats");
+  stats = core_api->service_request ("stats");
   if (stats != NULL)
   {
     stat_bytesReceived =
@@ -813,7 +813,7 @@
     stat_bytesDropped =
         stats->create (gettext_noop ("# bytes dropped by SMTP (outgoing)"));
   }
-  GNUNET_GC_get_configuration_value_filename (coreAPI->cfg, "SMTP", "PIPE", 
&pipename);
+  GNUNET_GC_get_configuration_value_filename (core_api->cfg, "SMTP", "PIPE", 
&pipename);
   UNLINK (pipename);
   if (0 != mkfifo (pipename, S_IWUSR | S_IRUSR | S_IWGRP | S_IWOTH))
   {
@@ -821,7 +821,7 @@
                             GNUNET_GE_ADMIN | GNUNET_GE_BULK | GNUNET_GE_FATAL,
                             "mkfifo");
     GNUNET_free (pipename);
-    coreAPI->service_release (stats);
+    core_api->service_release (stats);
     stats = NULL;
     return NULL;
   }
@@ -831,10 +831,10 @@
     GNUNET_GE_LOG_STRERROR (ectx,
                             GNUNET_GE_ADMIN | GNUNET_GE_BULK |
                             GNUNET_GE_WARNING, "chmod");
-  GNUNET_GC_get_configuration_value_string (coreAPI->cfg, "SMTP", "EMAIL", 
NULL,
+  GNUNET_GC_get_configuration_value_string (core_api->cfg, "SMTP", "EMAIL", 
NULL,
                                             &email);
   lock = GNUNET_mutex_create (GNUNET_NO);
-  GNUNET_GC_get_configuration_value_string (coreAPI->cfg, "SMTP", "SERVER",
+  GNUNET_GC_get_configuration_value_string (core_api->cfg, "SMTP", "SERVER",
                                             "localhost:25", &smtp_server_name);
   sa.sa_handler = SIG_IGN;
   sigemptyset (&sa.sa_mask);
@@ -864,7 +864,7 @@
   GNUNET_free (smtp_server_name);
   if (stats != NULL)
   {
-    coreAPI->service_release (stats);
+    core_api->service_release (stats);
     stats = NULL;
   }
   GNUNET_mutex_destroy (lock);




reply via email to

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