2 * @file jutil.h utility functions
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef PURPLE_JABBER_JUTIL_H_
23 #define PURPLE_JABBER_JUTIL_H_
25 typedef struct _JabberID {
33 JabberID* jabber_id_new(const char *str);
34 void jabber_id_free(JabberID *jid);
36 char *jabber_get_resource(const char *jid);
37 char *jabber_get_bare_jid(const char *jid);
39 const char *jabber_normalize(const PurpleAccount *account, const char *in);
41 /* Returns true if JID is the bare JID of our server. */
42 gboolean jabber_is_own_server(JabberStream *js, const char *jid);
44 /* Returns true if JID is the bare JID of our account. */
45 gboolean jabber_is_own_account(JabberStream *js, const char *jid);
47 gboolean jabber_nodeprep_validate(const char *);
48 gboolean jabber_domain_validate(const char *);
49 gboolean jabber_resourceprep_validate(const char *);
51 PurpleConversation *jabber_find_unnormalized_conv(const char *name, PurpleAccount *account);
53 char *jabber_calculate_data_sha1sum(gconstpointer data, size_t len);
54 #endif /* PURPLE_JABBER_JUTIL_H_ */