summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-07 08:48:43 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-07 08:48:43 +0000
commit3853037fa5690e42397cb6e171f8bfc010f405a5 (patch)
treeb497bd14eb5cf2ee4cd1f39cbef2d393f3276cae /src
parent87da62e2d7df26addf33263ef2b6ba4c27faa44b (diff)
rename coreAPI to core_api to follow naming conventions better
Diffstat (limited to 'src')
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c18
-rw-r--r--src/nse/gnunet-service-nse.c14
-rw-r--r--src/transport/plugin_transport_smtp.c36
3 files changed, 34 insertions, 34 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 889ef25ba..1d7eb560c 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -438,7 +438,7 @@ static struct GNUNET_HashCode my_identity_hash;
/**
* Handle to CORE.
*/
-static struct GNUNET_CORE_Handle *coreAPI;
+static struct GNUNET_CORE_Handle *core_api;
/**
* Handle to ATS.
@@ -801,7 +801,7 @@ core_transmit_notify (void *cls, size_t size, void *buf)
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 @@ core_transmit_notify (void *cls, size_t size, void *buf)
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 @@ process_peer_queue (struct PeerInfo *peer)
("# 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 @@ GDS_NEIGHBOURS_init ()
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 @@ GDS_NEIGHBOURS_init ()
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));
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index 6dff5b8c5..b69a4a7fe 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -216,7 +216,7 @@ static struct GNUNET_STATISTICS_Handle *stats;
/**
* 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 @@ transmit_task_cb (void *cls,
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 @@ shutdown_task (void *cls,
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 @@ run (void *cls,
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 @@ run (void *cls,
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;
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c
index c305578e0..fa0c787d1 100644
--- a/src/transport/plugin_transport_smtp.c
+++ b/src/transport/plugin_transport_smtp.c
@@ -95,7 +95,7 @@ GNUNET_NETWORK_STRUCT_END
/**
* 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 @@ listenAndDistribute (void *unused)
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 @@ listenAndDistribute (void *unused)
"SMTP message passed to the core.\n");
#endif
- coreAPI->receive (coreMP);
+ core_api->receive (coreMP);
}
END:
#if DEBUG_SMTP
@@ -449,7 +449,7 @@ api_create_hello ()
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 @@ api_send (GNUNET_TSession * tsession, const void *msg, const unsigned int size,
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 @@ api_send (GNUNET_TSession * tsession, const void *msg, const unsigned int size,
}
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 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core)
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 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core)
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 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core)
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 @@ inittransport_smtp (struct GNUNET_CoreAPIForTransport * core)
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 @@ donetransport_smtp ()
GNUNET_free (smtp_server_name);
if (stats != NULL)
{
- coreAPI->service_release (stats);
+ core_api->service_release (stats);
stats = NULL;
}
GNUNET_mutex_destroy (lock);