aboutsummaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-messenger.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/messenger/gnunet-messenger.c')
-rw-r--r--src/messenger/gnunet-messenger.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/messenger/gnunet-messenger.c b/src/messenger/gnunet-messenger.c
index 28fa4b147..e2d106be8 100644
--- a/src/messenger/gnunet-messenger.c
+++ b/src/messenger/gnunet-messenger.c
@@ -42,8 +42,11 @@ struct GNUNET_MESSENGER_Handle *messenger;
42 * @param[in] flags Flags of message 42 * @param[in] flags Flags of message
43 */ 43 */
44void 44void
45on_message (void *cls, struct GNUNET_MESSENGER_Room *room, const struct GNUNET_MESSENGER_Contact *sender, 45on_message (void *cls,
46 const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash, 46 struct GNUNET_MESSENGER_Room *room,
47 const struct GNUNET_MESSENGER_Contact *sender,
48 const struct GNUNET_MESSENGER_Message *message,
49 const struct GNUNET_HashCode *hash,
47 enum GNUNET_MESSENGER_MessageFlags flags) 50 enum GNUNET_MESSENGER_MessageFlags flags)
48{ 51{
49 const char *sender_name = GNUNET_MESSENGER_contact_get_name (sender); 52 const char *sender_name = GNUNET_MESSENGER_contact_get_name (sender);
@@ -124,7 +127,8 @@ listen_stdio (void *cls);
124#define MAX_BUFFER_SIZE 60000 127#define MAX_BUFFER_SIZE 60000
125 128
126static int 129static int
127iterate_send_private_message (void *cls, struct GNUNET_MESSENGER_Room *room, 130iterate_send_private_message (void *cls,
131 struct GNUNET_MESSENGER_Room *room,
128 const struct GNUNET_MESSENGER_Contact *contact) 132 const struct GNUNET_MESSENGER_Contact *contact)
129{ 133{
130 struct GNUNET_MESSENGER_Message *message = cls; 134 struct GNUNET_MESSENGER_Message *message = cls;
@@ -226,7 +230,8 @@ struct GNUNET_SCHEDULER_Task *shutdown_task;
226 * @param[in/out] handle Handle of messenger service 230 * @param[in/out] handle Handle of messenger service
227 */ 231 */
228static void 232static void
229on_identity (void *cls, struct GNUNET_MESSENGER_Handle *handle) 233on_identity (void *cls,
234 struct GNUNET_MESSENGER_Handle *handle)
230{ 235{
231 struct GNUNET_HashCode key; 236 struct GNUNET_HashCode key;
232 memset (&key, 0, sizeof(key)); 237 memset (&key, 0, sizeof(key));
@@ -292,7 +297,10 @@ on_identity (void *cls, struct GNUNET_MESSENGER_Handle *handle)
292 * @param[in] cfg configuration 297 * @param[in] cfg configuration
293 */ 298 */
294static void 299static void
295run (void *cls, char *const*args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) 300run (void *cls,
301 char *const*args,
302 const char *cfgfile,
303 const struct GNUNET_CONFIGURATION_Handle *cfg)
296{ 304{
297 messenger = GNUNET_MESSENGER_connect (cfg, ego_name, &on_identity, NULL, &on_message, NULL); 305 messenger = GNUNET_MESSENGER_connect (cfg, ego_name, &on_identity, NULL, &on_message, NULL);
298 306
@@ -307,7 +315,8 @@ run (void *cls, char *const*args, const char *cfgfile, const struct GNUNET_CONFI
307 * @return #EXIT_SUCCESS ok, #EXIT_FAILURE on error 315 * @return #EXIT_SUCCESS ok, #EXIT_FAILURE on error
308 */ 316 */
309int 317int
310main (int argc, char **argv) 318main (int argc,
319 char **argv)
311{ 320{
312 const char *description = "Open and connect to rooms using the MESSENGER to chat."; 321 const char *description = "Open and connect to rooms using the MESSENGER to chat.";
313 322