aboutsummaryrefslogtreecommitdiff
path: root/src/template
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-04-25 22:29:55 +0000
committerng0 <ng0@n0.is>2019-04-25 22:29:55 +0000
commitd039e80999f8df49d7b683e60af4145aacd18f83 (patch)
treee7f8accac09e8715c5df7004951daa7d01f449ae /src/template
parent87ec5f76b97d15794a1c17706305080c089d5afd (diff)
downloadgnunet-d039e80999f8df49d7b683e60af4145aacd18f83.tar.gz
gnunet-d039e80999f8df49d7b683e60af4145aacd18f83.zip
src/template: format
Diffstat (limited to 'src/template')
-rw-r--r--src/template/gnunet-service-template.c28
-rw-r--r--src/template/gnunet-template.c27
-rw-r--r--src/template/test_template_api.c2
3 files changed, 27 insertions, 30 deletions
diff --git a/src/template/gnunet-service-template.c b/src/template/gnunet-service-template.c
index 7c6575163..92fd9754f 100644
--- a/src/template/gnunet-service-template.c
+++ b/src/template/gnunet-service-template.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
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
@@ -49,8 +49,8 @@ cleanup_task (void *cls)
49 */ 49 */
50static void * 50static void *
51client_connect_cb (void *cls, 51client_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}
@@ -65,8 +65,8 @@ client_connect_cb (void *cls,
65 */ 65 */
66static void 66static void
67client_disconnect_cb (void *cls, 67client_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}
@@ -85,22 +85,20 @@ run (void *cls,
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, 88 GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL);
89 NULL);
90} 89}
91 90
92 91
93/** 92/**
94 * Define "main" method using service macro. 93 * Define "main" method using service macro.
95 */ 94 */
96GNUNET_SERVICE_MAIN 95GNUNET_SERVICE_MAIN ("template",
97("template", 96 GNUNET_SERVICE_OPTION_NONE,
98 GNUNET_SERVICE_OPTION_NONE, 97 &run,
99 &run, 98 &client_connect_cb,
100 &client_connect_cb, 99 &client_disconnect_cb,
101 &client_disconnect_cb, 100 NULL,
102 NULL, 101 GNUNET_MQ_handler_end ());
103 GNUNET_MQ_handler_end ());
104 102
105 103
106/* 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 ec2c8f624..44dec992b 100644
--- a/src/template/gnunet-template.c
+++ b/src/template/gnunet-template.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
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
@@ -63,21 +63,20 @@ 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 }; 67 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
68 if (GNUNET_OK !=
69 GNUNET_STRINGS_get_utf8_args (argc, argv,
70 &argc, &argv))
71 return 2; 68 return 2;
72 69
73 ret = (GNUNET_OK == 70 ret = (GNUNET_OK == GNUNET_PROGRAM_run (argc,
74 GNUNET_PROGRAM_run (argc, argv, 71 argv,
75 "gnunet-template", 72 "gnunet-template",
76 gettext_noop ("help text"), 73 gettext_noop ("help text"),
77 options, 74 options,
78 &run, 75 &run,
79 NULL)) ? ret : 1; 76 NULL))
80 GNUNET_free ((void*) argv); 77 ? ret
78 : 1;
79 GNUNET_free ((void *) argv);
81 return ret; 80 return ret;
82} 81}
83 82
diff --git a/src/template/test_template_api.c b/src/template/test_template_api.c
index 9a588cf8f..7956a4d29 100644
--- a/src/template/test_template_api.c
+++ b/src/template/test_template_api.c
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
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