From 200aaa0dd6813f19eb7ed67a0fdc301d091fc2d7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 18 Jun 2010 14:09:55 +0000 Subject: localization of scopes --- src/statistics/gnunet-service-statistics.c | 16 +++++----------- src/statistics/gnunet-statistics.c | 29 ++++++++++++----------------- 2 files changed, 17 insertions(+), 28 deletions(-) (limited to 'src/statistics') diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c index 428ce932f..efc6ce128 100644 --- a/src/statistics/gnunet-service-statistics.c +++ b/src/statistics/gnunet-service-statistics.c @@ -419,17 +419,6 @@ handle_set (void *cls, } -/** - * List of handlers for the messages understood by this - * service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_set, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_SET, 0}, - {&handle_get, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_GET, 0}, - {NULL, NULL, 0, 0} -}; - - /** * Task run during shutdown. * @@ -458,6 +447,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *c) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_set, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_SET, 0}, + {&handle_get, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_GET, 0}, + {NULL, NULL, 0, 0} + }; cfg = c; GNUNET_SERVER_add_handlers (server, handlers); load (server); diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c index 4fc8d8435..159a7548d 100644 --- a/src/statistics/gnunet-statistics.c +++ b/src/statistics/gnunet-statistics.c @@ -149,23 +149,6 @@ run (void *cls, cleanup (h, GNUNET_SYSERR); } -/** - * gnunet-statistics command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'n', "name", "NAME", - gettext_noop ("limit output to statistcs for the given NAME"), 1, - &GNUNET_GETOPT_set_string, &name}, - {'p', "persistent", NULL, - gettext_noop ("make the value being set persistent"), 0, - &GNUNET_GETOPT_set_one, &persistent}, - {'s', "subsystem", "SUBSYSTEM", - gettext_noop ("limit output to the given SUBSYSTEM"), 1, - &GNUNET_GETOPT_set_string, &subsystem}, - GNUNET_GETOPT_OPTION_END -}; - - /** * The main function to obtain statistics in GNUnet. * @@ -176,6 +159,18 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'n', "name", "NAME", + gettext_noop ("limit output to statistcs for the given NAME"), 1, + &GNUNET_GETOPT_set_string, &name}, + {'p', "persistent", NULL, + gettext_noop ("make the value being set persistent"), 0, + &GNUNET_GETOPT_set_one, &persistent}, + {'s', "subsystem", "SUBSYSTEM", + gettext_noop ("limit output to the given SUBSYSTEM"), 1, + &GNUNET_GETOPT_set_string, &subsystem}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, -- cgit v1.2.3