Frameworks/libpurple.framework/Versions/0.6.2/Headers/jutil.h
author Zachary West <zacw@adium.im>
Fri Aug 21 13:25:11 2009 -0700 (2009-08-21)
changeset 2592 e8d15275025e
parent 2535 Frameworks/libpurple.framework/Versions/0.6.0/Headers/jutil.h@39c3c161de14
permissions -rw-r--r--
im.pidgin.adium.1-4 at 267c6165e02e34318a1823960bd04c0639952f73
     1 /**
     2  * @file jutil.h utility functions
     3  *
     4  * purple
     5  *
     6  * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
     7  *
     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.
    12  *
    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.
    17  *
    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
    21  */
    22 #ifndef PURPLE_JABBER_JUTIL_H_
    23 #define PURPLE_JABBER_JUTIL_H_
    24 
    25 typedef struct _JabberID {
    26 	char *node;
    27 	char *domain;
    28 	char *resource;
    29 } JabberID;
    30 
    31 #include "jabber.h"
    32 
    33 JabberID* jabber_id_new(const char *str);
    34 void jabber_id_free(JabberID *jid);
    35 
    36 char *jabber_get_resource(const char *jid);
    37 char *jabber_get_bare_jid(const char *jid);
    38 
    39 const char *jabber_normalize(const PurpleAccount *account, const char *in);
    40 
    41 /* Returns true if JID is the bare JID of our server. */
    42 gboolean jabber_is_own_server(JabberStream *js, const char *jid);
    43 
    44 /* Returns true if JID is the bare JID of our account. */
    45 gboolean jabber_is_own_account(JabberStream *js, const char *jid);
    46 
    47 gboolean jabber_nodeprep_validate(const char *);
    48 gboolean jabber_domain_validate(const char *);
    49 gboolean jabber_resourceprep_validate(const char *);
    50 
    51 PurpleConversation *jabber_find_unnormalized_conv(const char *name, PurpleAccount *account);
    52 
    53 char *jabber_calculate_data_sha1sum(gconstpointer data, size_t len);
    54 #endif /* PURPLE_JABBER_JUTIL_H_ */