diff options
author | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
commit | d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch) | |
tree | 9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/template | |
parent | a0fce305c565c0937d917a92712f15e9c5736260 (diff) | |
download | gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip |
uncrustify as demanded.
Diffstat (limited to 'src/template')
-rw-r--r-- | src/template/gnunet-service-template.c | 40 | ||||
-rw-r--r-- | src/template/gnunet-template.c | 38 | ||||
-rw-r--r-- | src/template/test_template_api.c | 8 |
3 files changed, 44 insertions, 42 deletions
diff --git a/src/template/gnunet-service-template.c b/src/template/gnunet-service-template.c index 92fd9754f..6db030d16 100644 --- a/src/template/gnunet-service-template.c +++ b/src/template/gnunet-service-template.c | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file template/gnunet-service-template.c | 22 | * @file template/gnunet-service-template.c |
@@ -33,7 +33,7 @@ | |||
33 | * @param cls unused | 33 | * @param cls unused |
34 | */ | 34 | */ |
35 | static void | 35 | static void |
36 | cleanup_task (void *cls) | 36 | cleanup_task(void *cls) |
37 | { | 37 | { |
38 | /* FIXME: do clean up here */ | 38 | /* FIXME: do clean up here */ |
39 | } | 39 | } |
@@ -48,9 +48,9 @@ cleanup_task (void *cls) | |||
48 | * @return @a c | 48 | * @return @a c |
49 | */ | 49 | */ |
50 | static void * | 50 | static void * |
51 | client_connect_cb (void *cls, | 51 | client_connect_cb(void *cls, |
52 | struct GNUNET_SERVICE_Client *c, | 52 | struct GNUNET_SERVICE_Client *c, |
53 | struct GNUNET_MQ_Handle *mq) | 53 | struct GNUNET_MQ_Handle *mq) |
54 | { | 54 | { |
55 | return c; | 55 | return c; |
56 | } | 56 | } |
@@ -64,11 +64,11 @@ client_connect_cb (void *cls, | |||
64 | * @param internal_cls should be equal to @a c | 64 | * @param internal_cls should be equal to @a c |
65 | */ | 65 | */ |
66 | static void | 66 | static void |
67 | client_disconnect_cb (void *cls, | 67 | client_disconnect_cb(void *cls, |
68 | struct GNUNET_SERVICE_Client *c, | 68 | struct GNUNET_SERVICE_Client *c, |
69 | void *internal_cls) | 69 | void *internal_cls) |
70 | { | 70 | { |
71 | GNUNET_assert (c == internal_cls); | 71 | GNUNET_assert(c == internal_cls); |
72 | } | 72 | } |
73 | 73 | ||
74 | 74 | ||
@@ -80,25 +80,25 @@ client_disconnect_cb (void *cls, | |||
80 | * @param service the initialized service | 80 | * @param service the initialized service |
81 | */ | 81 | */ |
82 | static void | 82 | static void |
83 | run (void *cls, | 83 | run(void *cls, |
84 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 84 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
85 | struct GNUNET_SERVICE_Handle *service) | 85 | struct GNUNET_SERVICE_Handle *service) |
86 | { | 86 | { |
87 | /* FIXME: do setup here */ | 87 | /* FIXME: do setup here */ |
88 | GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); | 88 | GNUNET_SCHEDULER_add_shutdown(&cleanup_task, NULL); |
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /** |
93 | * Define "main" method using service macro. | 93 | * Define "main" method using service macro. |
94 | */ | 94 | */ |
95 | GNUNET_SERVICE_MAIN ("template", | 95 | GNUNET_SERVICE_MAIN("template", |
96 | GNUNET_SERVICE_OPTION_NONE, | 96 | GNUNET_SERVICE_OPTION_NONE, |
97 | &run, | 97 | &run, |
98 | &client_connect_cb, | 98 | &client_connect_cb, |
99 | &client_disconnect_cb, | 99 | &client_disconnect_cb, |
100 | NULL, | 100 | NULL, |
101 | GNUNET_MQ_handler_end ()); | 101 | GNUNET_MQ_handler_end()); |
102 | 102 | ||
103 | 103 | ||
104 | /* end of gnunet-service-template.c */ | 104 | /* end of gnunet-service-template.c */ |
diff --git a/src/template/gnunet-template.c b/src/template/gnunet-template.c index 44dec992b..1ebb1b512 100644 --- a/src/template/gnunet-template.c +++ b/src/template/gnunet-template.c | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file template/gnunet-template.c | 22 | * @file template/gnunet-template.c |
@@ -42,10 +42,10 @@ static int ret; | |||
42 | * @param cfg configuration | 42 | * @param cfg configuration |
43 | */ | 43 | */ |
44 | static void | 44 | static void |
45 | run (void *cls, | 45 | run(void *cls, |
46 | char *const *args, | 46 | char *const *args, |
47 | const char *cfgfile, | 47 | const char *cfgfile, |
48 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 48 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
49 | { | 49 | { |
50 | /* main code here */ | 50 | /* main code here */ |
51 | } | 51 | } |
@@ -59,24 +59,26 @@ run (void *cls, | |||
59 | * @return 0 ok, 1 on error | 59 | * @return 0 ok, 1 on error |
60 | */ | 60 | */ |
61 | int | 61 | int |
62 | main (int argc, char *const *argv) | 62 | main(int argc, char *const *argv) |
63 | { | 63 | { |
64 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 64 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
65 | /* FIMXE: add options here */ | 65 | /* FIMXE: add options here */ |
66 | GNUNET_GETOPT_OPTION_END}; | 66 | GNUNET_GETOPT_OPTION_END |
67 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 67 | }; |
68 | |||
69 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args(argc, argv, &argc, &argv)) | ||
68 | return 2; | 70 | return 2; |
69 | 71 | ||
70 | ret = (GNUNET_OK == GNUNET_PROGRAM_run (argc, | 72 | ret = (GNUNET_OK == GNUNET_PROGRAM_run(argc, |
71 | argv, | 73 | argv, |
72 | "gnunet-template", | 74 | "gnunet-template", |
73 | gettext_noop ("help text"), | 75 | gettext_noop("help text"), |
74 | options, | 76 | options, |
75 | &run, | 77 | &run, |
76 | NULL)) | 78 | NULL)) |
77 | ? ret | 79 | ? ret |
78 | : 1; | 80 | : 1; |
79 | GNUNET_free ((void *) argv); | 81 | GNUNET_free((void *)argv); |
80 | return ret; | 82 | return ret; |
81 | } | 83 | } |
82 | 84 | ||
diff --git a/src/template/test_template_api.c b/src/template/test_template_api.c index 7956a4d29..9f845d975 100644 --- a/src/template/test_template_api.c +++ b/src/template/test_template_api.c | |||
@@ -16,7 +16,7 @@ | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file template/test_template_api.c | 21 | * @file template/test_template_api.c |
22 | * @brief testcase for template.c | 22 | * @brief testcase for template.c |
@@ -24,17 +24,17 @@ | |||
24 | #include "platform.h" | 24 | #include "platform.h" |
25 | 25 | ||
26 | static int | 26 | static int |
27 | check () | 27 | check() |
28 | { | 28 | { |
29 | return 0; | 29 | return 0; |
30 | } | 30 | } |
31 | 31 | ||
32 | int | 32 | int |
33 | main (int argc, char *argv[]) | 33 | main(int argc, char *argv[]) |
34 | { | 34 | { |
35 | int ret; | 35 | int ret; |
36 | 36 | ||
37 | ret = check (); | 37 | ret = check(); |
38 | 38 | ||
39 | return ret; | 39 | return ret; |
40 | } | 40 | } |