aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/gnunet-conversation-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/gnunet-conversation-test.c')
-rw-r--r--src/conversation/gnunet-conversation-test.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/conversation/gnunet-conversation-test.c b/src/conversation/gnunet-conversation-test.c
index 75605384f..ac99e4d14 100644
--- a/src/conversation/gnunet-conversation-test.c
+++ b/src/conversation/gnunet-conversation-test.c
@@ -97,6 +97,7 @@ do_shutdown (void *cls)
97{ 97{
98 struct Recording *rec; 98 struct Recording *rec;
99 99
100 (void) cls;
100 if (NULL != switch_task) 101 if (NULL != switch_task)
101 GNUNET_SCHEDULER_cancel (switch_task); 102 GNUNET_SCHEDULER_cancel (switch_task);
102 if (NULL != microphone) 103 if (NULL != microphone)
@@ -123,8 +124,7 @@ do_shutdown (void *cls)
123static void 124static void
124switch_to_speaker (void *cls) 125switch_to_speaker (void *cls)
125{ 126{
126 struct Recording *rec; 127 (void) cls;
127
128 switch_task = NULL; 128 switch_task = NULL;
129 microphone->disable_microphone (microphone->cls); 129 microphone->disable_microphone (microphone->cls);
130 if (GNUNET_OK != 130 if (GNUNET_OK !=
@@ -138,7 +138,7 @@ switch_to_speaker (void *cls)
138 } 138 }
139 fprintf (stderr, 139 fprintf (stderr,
140 _("\nWe are now playing your recording back. If you can hear it, your audio settings are working...")); 140 _("\nWe are now playing your recording back. If you can hear it, your audio settings are working..."));
141 for (rec=rec_head; NULL != rec; rec = rec->next) 141 for (struct Recording *rec=rec_head; NULL != rec; rec = rec->next)
142 { 142 {
143 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 143 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
144 "Replaying %u bytes\n", 144 "Replaying %u bytes\n",
@@ -168,6 +168,7 @@ record (void *cls,
168{ 168{
169 struct Recording *rec; 169 struct Recording *rec;
170 170
171 (void) cls;
171 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 172 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
172 "Recorded %u bytes\n", 173 "Recorded %u bytes\n",
173 (unsigned int) data_size); 174 (unsigned int) data_size);
@@ -189,9 +190,14 @@ record (void *cls,
189 * @param cfg configuration 190 * @param cfg configuration
190 */ 191 */
191static void 192static void
192run (void *cls, char *const *args, const char *cfgfile, 193run (void *cls,
194 char *const *args,
195 const char *cfgfile,
193 const struct GNUNET_CONFIGURATION_Handle *cfg) 196 const struct GNUNET_CONFIGURATION_Handle *cfg)
194{ 197{
198 (void) cls;
199 (void) args;
200 (void) cfgfile;
195 microphone = GNUNET_MICROPHONE_create_from_hardware (cfg); 201 microphone = GNUNET_MICROPHONE_create_from_hardware (cfg);
196 GNUNET_assert (NULL != microphone); 202 GNUNET_assert (NULL != microphone);
197 speaker = GNUNET_SPEAKER_create_from_hardware (cfg); 203 speaker = GNUNET_SPEAKER_create_from_hardware (cfg);
@@ -225,17 +231,24 @@ run (void *cls, char *const *args, const char *cfgfile,
225 * @return 0 ok, 1 on error 231 * @return 0 ok, 1 on error
226 */ 232 */
227int 233int
228main (int argc, char *const *argv) 234main (int argc,
235 char *const *argv)
229{ 236{
230 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 237 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
231 GNUNET_GETOPT_OPTION_END 238 GNUNET_GETOPT_OPTION_END
232 }; 239 };
233 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 240
241 if (GNUNET_OK !=
242 GNUNET_STRINGS_get_utf8_args (argc, argv,
243 &argc, &argv))
234 return 2; 244 return 2;
235 245
236 ret = (GNUNET_OK == 246 ret = (GNUNET_OK ==
237 GNUNET_PROGRAM_run (argc, argv, "gnunet-conversation-test", 247 GNUNET_PROGRAM_run (argc, argv,
238 gettext_noop ("help text"), options, &run, 248 "gnunet-conversation-test",
249 gettext_noop ("help text"),
250 options,
251 &run,
239 NULL)) ? ret : 1; 252 NULL)) ? ret : 1;
240 GNUNET_free ((void*) argv); 253 GNUNET_free ((void*) argv);
241 return ret; 254 return ret;