aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/gnunet-conversation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-02 17:10:22 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-02 17:10:22 +0000
commit17e35f0a3eabb698ac7a0e34e096d64ab3a6d123 (patch)
treef5f84f055e5ef8afcadc046d69d4e300bef1ed2f /src/conversation/gnunet-conversation.c
parent1e0fa3c5117a2c3306b6bfa4a9d100ebde33b833 (diff)
downloadgnunet-17e35f0a3eabb698ac7a0e34e096d64ab3a6d123.tar.gz
gnunet-17e35f0a3eabb698ac7a0e34e096d64ab3a6d123.zip
-fix indentation, minor leaks
Diffstat (limited to 'src/conversation/gnunet-conversation.c')
-rw-r--r--src/conversation/gnunet-conversation.c52
1 files changed, 24 insertions, 28 deletions
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c
index 60130c6d5..a4088984b 100644
--- a/src/conversation/gnunet-conversation.c
+++ b/src/conversation/gnunet-conversation.c
@@ -32,19 +32,20 @@
32#define MAX_MESSAGE_LENGTH (32 * 1024) 32#define MAX_MESSAGE_LENGTH (32 * 1024)
33 33
34/** 34/**
35* CONVERSATION handle 35 * CONVERSATION handle
36*/ 36 */
37struct GNUNET_CONVERSATION_Handle *conversation = NULL; 37static struct GNUNET_CONVERSATION_Handle *conversation;
38 38
39/** 39/**
40* Task which handles the commands 40 * Task which handles the commands
41*/ 41 */
42static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task; 42static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task;
43 43
44/** 44/**
45* Function declareation for executing a action 45 * Function declareation for executing a action
46*/ 46 */
47typedef int (*ActionFunction) (const char *argumetns, const void *xtra); 47typedef int (*ActionFunction) (const char *argumetns,
48 const void *xtra);
48 49
49/** 50/**
50* Structure which defines a command 51* Structure which defines a command
@@ -56,15 +57,10 @@ struct VoipCommand
56 const char *helptext; 57 const char *helptext;
57}; 58};
58 59
59/******************************************************************************/
60/*********************** DECLARATIONS *************************/
61/******************************************************************************/
62
63static int do_help (const char *args, const void *xtra);
64 60
65/******************************************************************************/ 61static int
66/*********************** Functions *************************/ 62do_help (const char *args,
67/******************************************************************************/ 63 const void *xtra);
68 64
69 65
70/** 66/**
@@ -167,7 +163,8 @@ missed_call_handler (void *cls,
167 struct GNUNET_CONVERSATION_Handle *handle, 163 struct GNUNET_CONVERSATION_Handle *handle,
168 struct GNUNET_CONVERSATION_MissedCallNotification *missed_calls) 164 struct GNUNET_CONVERSATION_MissedCallNotification *missed_calls)
169{ 165{
170 FPRINTF (stdout, _("You have missed calls.\n")); 166 FPRINTF (stdout,
167 _("You have missed calls.\n"));
171} 168}
172 169
173 170
@@ -189,7 +186,9 @@ static int
189do_unknown (const char *msg, 186do_unknown (const char *msg,
190 const void *xtra) 187 const void *xtra)
191{ 188{
192 FPRINTF (stderr, _("Unknown command `%s'\n"), msg); 189 FPRINTF (stderr,
190 _("Unknown command `%s'\n"),
191 msg);
193 return GNUNET_OK; 192 return GNUNET_OK;
194} 193}
195 194
@@ -201,13 +200,11 @@ static int
201do_call (const char *arg, 200do_call (const char *arg,
202 const void *xtra) 201 const void *xtra)
203{ 202{
204 char *callee = GNUNET_strdup (arg);
205
206 FPRINTF (stdout, 203 FPRINTF (stdout,
207 _("Initiating call to: %s\n"), 204 _("Initiating call to: %s\n"),
208 callee); 205 arg);
209 GNUNET_CONVERSATION_call (conversation, 206 GNUNET_CONVERSATION_call (conversation,
210 callee, 207 arg,
211 GNUNET_YES); 208 GNUNET_YES);
212 return GNUNET_OK; 209 return GNUNET_OK;
213} 210}
@@ -220,13 +217,12 @@ static int
220do_call_peer (const char *arg, 217do_call_peer (const char *arg,
221 const void *xtra) 218 const void *xtra)
222{ 219{
223 char *callee = GNUNET_strdup (arg);
224
225 FPRINTF (stdout, 220 FPRINTF (stdout,
226 _("Initiating call to: %s\n"), 221 _("Initiating call to: %s\n"),
227 callee); 222 arg);
228 GNUNET_CONVERSATION_call (conversation, callee, GNUNET_NO); 223 GNUNET_CONVERSATION_call (conversation,
229 224 arg,
225 GNUNET_NO);
230 return GNUNET_OK; 226 return GNUNET_OK;
231} 227}
232 228
@@ -278,7 +274,7 @@ do_hang_up (const char *args,
278 * List of supported commands. 274 * List of supported commands.
279 */ 275 */
280static struct VoipCommand commands[] = { 276static struct VoipCommand commands[] = {
281 {"/call ", &do_call, gettext_noop ("Use `/call gads_record'")}, 277 {"/call ", &do_call, gettext_noop ("Use `/call gns_name'")},
282 {"/callpeer ", &do_call_peer, 278 {"/callpeer ", &do_call_peer,
283 gettext_noop ("Use `/call private_key' to call a person")}, 279 gettext_noop ("Use `/call private_key' to call a person")},
284 {"/accept", &do_accept, 280 {"/accept", &do_accept,