dnsquery.h

Go to the documentation of this file.
00001 
00006 /* purple
00007  *
00008  * Purple is the legal property of its developers, whose names are too numerous
00009  * to list here.  Please refer to the COPYRIGHT file distributed with this
00010  * source distribution.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00025  */
00026 #ifndef _PURPLE_DNSQUERY_H_
00027 #define _PURPLE_DNSQUERY_H_
00028 
00029 #include <glib.h>
00030 #include "eventloop.h"
00031 #include "account.h"
00032 
00038 typedef struct _PurpleDnsQueryData PurpleDnsQueryData;
00039 
00045 typedef void (*PurpleDnsQueryConnectFunction)(GSList *hosts, gpointer data, const char *error_message);
00046 
00050 typedef void  (*PurpleDnsQueryResolvedCallback) (PurpleDnsQueryData *query_data, GSList *hosts);
00051 typedef void  (*PurpleDnsQueryFailedCallback) (PurpleDnsQueryData *query_data, const gchar *error_message);
00052 
00059 typedef struct
00060 {
00063     gboolean (*resolve_host)(PurpleDnsQueryData *query_data,
00064                              PurpleDnsQueryResolvedCallback resolved_cb,
00065                              PurpleDnsQueryFailedCallback failed_cb);
00066 
00071     void (*destroy)(PurpleDnsQueryData *query_data);
00072 
00073     void (*_purple_reserved1)(void);
00074     void (*_purple_reserved2)(void);
00075     void (*_purple_reserved3)(void);
00076     void (*_purple_reserved4)(void);
00077 } PurpleDnsQueryUiOps;
00078 
00079 #ifdef __cplusplus
00080 extern "C" {
00081 #endif
00082 
00083 /**************************************************************************/
00085 /**************************************************************************/
00103 PurpleDnsQueryData *purple_dnsquery_a_account(PurpleAccount *account, const char *hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data);
00104 
00105 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_DNSQUERY_C_)
00106 
00120 PurpleDnsQueryData *purple_dnsquery_a(const char *hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data);
00121 #endif
00122 
00129 void purple_dnsquery_destroy(PurpleDnsQueryData *query_data);
00130 
00138 void purple_dnsquery_set_ui_ops(PurpleDnsQueryUiOps *ops);
00139 
00146 PurpleDnsQueryUiOps *purple_dnsquery_get_ui_ops(void);
00147 
00154 char *purple_dnsquery_get_host(PurpleDnsQueryData *query_data);
00155 
00162 unsigned short purple_dnsquery_get_port(PurpleDnsQueryData *query_data);
00163 
00167 void purple_dnsquery_init(void);
00168 
00172 void purple_dnsquery_uninit(void);
00173 
00176 #ifdef __cplusplus
00177 }
00178 #endif
00179 
00180 #endif /* _PURPLE_DNSQUERY_H_ */