[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r29795 - in gnunet/src: conversation include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r29795 - in gnunet/src: conversation include |
Date: |
Wed, 2 Oct 2013 19:10:22 +0200 |
Author: grothoff
Date: 2013-10-02 19:10:22 +0200 (Wed, 02 Oct 2013)
New Revision: 29795
Modified:
gnunet/src/conversation/conversation_api.c
gnunet/src/conversation/gnunet-conversation.c
gnunet/src/include/gnunet_conversation_service.h
Log:
-fix indentation, minor leaks
Modified: gnunet/src/conversation/conversation_api.c
===================================================================
--- gnunet/src/conversation/conversation_api.c 2013-10-02 17:05:21 UTC (rev
29794)
+++ gnunet/src/conversation/conversation_api.c 2013-10-02 17:10:22 UTC (rev
29795)
@@ -81,54 +81,54 @@
struct GNUNET_CONVERSATION_Handle
{
- /**
- * Our configuration.
- */
+ /**
+ * Our configuration.
+ */
const struct GNUNET_CONFIGURATION_Handle *cfg;
- /**
- * Handle to the server connection, to send messages later
- */
+ /**
+ * Handle to the server connection, to send messages later
+ */
struct GNUNET_CLIENT_Connection *client;
- /**
- * GNS handle
- */
+ /**
+ * GNS handle
+ */
struct GNUNET_GNS_Handle *gns;
- /**
- * Namestore handle
- */
+ /**
+ * Namestore handle
+ */
struct GNUNET_NAMESTORE_Handle *namestore;
- /**
- * TXT record for gns
- */
+ /**
+ * TXT record for gns
+ */
int txt_record_set;
- /**
- * Callback for incoming calls
- */
+ /**
+ * Callback for incoming calls
+ */
GNUNET_CONVERSATION_CallHandler *call_handler;
- /**
- * Callback for rejected calls
- */
+ /**
+ * Callback for rejected calls
+ */
GNUNET_CONVERSATION_RejectHandler *reject_handler;
-
- /**
- * Callback for notifications
- */
+
+ /**
+ * Callback for notifications
+ */
GNUNET_CONVERSATION_NotificationHandler *notification_handler;
- /**
- * Callback for missed calls
- */
+ /**
+ * Callback for missed calls
+ */
GNUNET_CONVERSATION_MissedCallHandler *missed_call_handler;
- /**
- * The pointer to the call
- */
+ /**
+ * The pointer to the call
+ */
struct GNUNET_CONVERSATION_CallInformation *call;
};
@@ -210,26 +210,24 @@
{
h->txt_record_set = GNUNET_YES;
}
-
- return;
}
+
/**
-* Check if the gns txt record for conversation exits
-*/
+ * Check if the gns txt record for conversation exits
+ */
static void
check_gns (struct GNUNET_CONVERSATION_Handle *h)
{
- GNUNET_GNS_lookup (h->gns, "conversation.gads",
+ GNUNET_GNS_lookup (h->gns, "conversation.gns",
NULL /* FIXME_ZONE */,
GNUNET_DNSPARSER_TYPE_TXT,
GNUNET_NO,
NULL,
&check_gns_cb, h);
-
- return;
}
+
/******************************************************************************/
/*********************** RECEIVE HANDLERS
****************************/
/******************************************************************************/
@@ -241,7 +239,8 @@
* @param msg message received, NULL on timeout or fatal error
*/
static void
-receive_message_cb (void *cls, const struct GNUNET_MessageHeader *msg)
+receive_message_cb (void *cls,
+ const struct GNUNET_MessageHeader *msg)
{
struct GNUNET_CONVERSATION_Handle *h = cls;
struct ServerClientSessionInitiateMessage *imsg;
@@ -532,6 +531,7 @@
&transmit_session_accept_message, h);
}
+
/**
* Auxiliary function to reject a call.
*
@@ -547,6 +547,7 @@
&transmit_session_reject_message, h);
}
+
/**
* Auxiliary function to terminate a call.
*
@@ -563,9 +564,10 @@
h);
}
+
/**
-*
-*/
+ *
+ */
static void
gns_call_cb (void *cls, uint32_t rd_count,
const struct GNUNET_NAMESTORE_RecordData *rd)
@@ -635,15 +637,17 @@
/******************************************************************************/
struct GNUNET_CONVERSATION_Handle *
-GNUNET_CONVERSATION_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
void *cls,
- GNUNET_CONVERSATION_CallHandler * call_handler,
- GNUNET_CONVERSATION_RejectHandler * reject_handler,
- GNUNET_CONVERSATION_NotificationHandler *
notification_handler,
- GNUNET_CONVERSATION_MissedCallHandler *
missed_call_handler)
+GNUNET_CONVERSATION_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ void *cls,
+ GNUNET_CONVERSATION_CallHandler call_handler,
+ GNUNET_CONVERSATION_RejectHandler reject_handler,
+ GNUNET_CONVERSATION_NotificationHandler
notification_handler,
+ GNUNET_CONVERSATION_MissedCallHandler
missed_call_handler)
{
struct GNUNET_CONVERSATION_Handle *h;
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, "GNUNET_CONVERSATION_connect()\n");
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "GNUNET_CONVERSATION_connect()\n");
h = GNUNET_malloc (sizeof (struct GNUNET_CONVERSATION_Handle));
h->cfg = cfg;
@@ -690,6 +694,7 @@
return h;
}
+
void
GNUNET_CONVERSATION_disconnect (struct GNUNET_CONVERSATION_Handle *handle)
{
@@ -732,6 +737,7 @@
initiate_call (h, peer);
}
+
void
GNUNET_CONVERSATION_hangup (struct GNUNET_CONVERSATION_Handle *h)
{
@@ -741,6 +747,7 @@
terminate_call (h);
}
+
void
GNUNET_CONVERSATION_accept (struct GNUNET_CONVERSATION_Handle *h)
{
@@ -750,6 +757,7 @@
accept_call (h);
}
+
void
GNUNET_CONVERSATION_reject (struct GNUNET_CONVERSATION_Handle *h)
{
Modified: gnunet/src/conversation/gnunet-conversation.c
===================================================================
--- gnunet/src/conversation/gnunet-conversation.c 2013-10-02 17:05:21 UTC
(rev 29794)
+++ gnunet/src/conversation/gnunet-conversation.c 2013-10-02 17:10:22 UTC
(rev 29795)
@@ -32,19 +32,20 @@
#define MAX_MESSAGE_LENGTH (32 * 1024)
/**
-* CONVERSATION handle
-*/
-struct GNUNET_CONVERSATION_Handle *conversation = NULL;
+ * CONVERSATION handle
+ */
+static struct GNUNET_CONVERSATION_Handle *conversation;
/**
-* Task which handles the commands
-*/
+ * Task which handles the commands
+ */
static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task;
/**
-* Function declareation for executing a action
-*/
-typedef int (*ActionFunction) (const char *argumetns, const void *xtra);
+ * Function declareation for executing a action
+ */
+typedef int (*ActionFunction) (const char *argumetns,
+ const void *xtra);
/**
* Structure which defines a command
@@ -56,17 +57,12 @@
const char *helptext;
};
-/******************************************************************************/
-/*********************** DECLARATIONS
*************************/
-/******************************************************************************/
-static int do_help (const char *args, const void *xtra);
+static int
+do_help (const char *args,
+ const void *xtra);
-/******************************************************************************/
-/*********************** Functions
*************************/
-/******************************************************************************/
-
/**
* Method called whenever a call is incoming
*
@@ -167,7 +163,8 @@
struct GNUNET_CONVERSATION_Handle *handle,
struct GNUNET_CONVERSATION_MissedCallNotification
*missed_calls)
{
- FPRINTF (stdout, _("You have missed calls.\n"));
+ FPRINTF (stdout,
+ _("You have missed calls.\n"));
}
@@ -189,7 +186,9 @@
do_unknown (const char *msg,
const void *xtra)
{
- FPRINTF (stderr, _("Unknown command `%s'\n"), msg);
+ FPRINTF (stderr,
+ _("Unknown command `%s'\n"),
+ msg);
return GNUNET_OK;
}
@@ -201,13 +200,11 @@
do_call (const char *arg,
const void *xtra)
{
- char *callee = GNUNET_strdup (arg);
-
FPRINTF (stdout,
_("Initiating call to: %s\n"),
- callee);
+ arg);
GNUNET_CONVERSATION_call (conversation,
- callee,
+ arg,
GNUNET_YES);
return GNUNET_OK;
}
@@ -220,13 +217,12 @@
do_call_peer (const char *arg,
const void *xtra)
{
- char *callee = GNUNET_strdup (arg);
-
FPRINTF (stdout,
_("Initiating call to: %s\n"),
- callee);
- GNUNET_CONVERSATION_call (conversation, callee, GNUNET_NO);
-
+ arg);
+ GNUNET_CONVERSATION_call (conversation,
+ arg,
+ GNUNET_NO);
return GNUNET_OK;
}
@@ -278,7 +274,7 @@
* List of supported commands.
*/
static struct VoipCommand commands[] = {
- {"/call ", &do_call, gettext_noop ("Use `/call gads_record'")},
+ {"/call ", &do_call, gettext_noop ("Use `/call gns_name'")},
{"/callpeer ", &do_call_peer,
gettext_noop ("Use `/call private_key' to call a person")},
{"/accept", &do_accept,
Modified: gnunet/src/include/gnunet_conversation_service.h
===================================================================
--- gnunet/src/include/gnunet_conversation_service.h 2013-10-02 17:05:21 UTC
(rev 29794)
+++ gnunet/src/include/gnunet_conversation_service.h 2013-10-02 17:10:22 UTC
(rev 29795)
@@ -93,8 +93,7 @@
* @param caller peer that calls you
*/
typedef void (GNUNET_CONVERSATION_CallHandler) (void *cls,
- struct
- GNUNET_CONVERSATION_Handle
*handle,
+ struct
GNUNET_CONVERSATION_Handle *handle,
const struct
GNUNET_PeerIdentity *caller);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r29795 - in gnunet/src: conversation include,
gnunet <=