annotate src/protocols/bonjour/jabber.h @ 14035:8bda65b88e49

[gaim-migrate @ 16638] A bunch of small changes. Mostly remove "if not null" checks before calling g_free, g_list_free, g_slist_free and g_strdup. Also use g_list_foreach() to call g_free to free strings in an array. And some whitespace changes here and there. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 05 Aug 2006 08:27:39 +0000
parents 8264f52a1142
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
1 /**
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
2 * @file jabber.h The Gaim interface to mDNS and peer to peer Jabber.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
3 *
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
4 * gaim
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
5 *
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
6 * Gaim is the legal property of its developers, whose names are too numerous
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
8 * source distribution.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
9 *
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
13 * (at your option) any later version.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
14 *
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
18 * GNU General Public License for more details.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
19 *
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
23 *
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
24 */
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
25
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
26 #ifndef _BONJOUR_JABBER_H_
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
27 #define _BONJOUR_JABBER_H_
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
28
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
29 #include "account.h"
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
30
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
31 #define STREAM_END "</stream:stream>"
13902
425e0f861e88 [gaim-migrate @ 16390]
Mark Doliner <mark@kingant.net>
parents: 11984
diff changeset
32 #define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">"
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
33
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
34 typedef struct _BonjourJabber
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
35 {
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
36 gint port;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
37 gint socket;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
38 gint watcher_id;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
39 GaimAccount* account;
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
40 } BonjourJabber;
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
41
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
42 typedef struct _BonjourJabberConversation
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
43 {
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
44 gint socket;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
45 gint watcher_id;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
46 gchar* buddy_name;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
47 gboolean stream_started;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
48 gint message_id;
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
49 } BonjourJabberConversation;
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
50
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
51 /**
13909
8264f52a1142 [gaim-migrate @ 16406]
Mark Doliner <mark@kingant.net>
parents: 13902
diff changeset
52 * Start listening for jabber connections.
8264f52a1142 [gaim-migrate @ 16406]
Mark Doliner <mark@kingant.net>
parents: 13902
diff changeset
53 *
8264f52a1142 [gaim-migrate @ 16406]
Mark Doliner <mark@kingant.net>
parents: 13902
diff changeset
54 * @return -1 if there was a problem, else returns the listening
8264f52a1142 [gaim-migrate @ 16406]
Mark Doliner <mark@kingant.net>
parents: 13902
diff changeset
55 * port number.
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
56 */
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
57 gint bonjour_jabber_start(BonjourJabber *data);
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
58
11693
b91a84e7cbcb [gaim-migrate @ 13979]
Mark Doliner <mark@kingant.net>
parents: 11539
diff changeset
59 int bonjour_jabber_send_message(BonjourJabber *data, const gchar *to, const gchar *body);
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
60
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
61 void bonjour_jabber_close_conversation(BonjourJabber *data, GaimBuddy *gb);
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
62
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
63 void bonjour_jabber_stop(BonjourJabber *data);
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
64
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
65 #endif /* _BONJOUR_JABBER_H_ */