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 {
00062     gboolean (*resolve_host)(PurpleDnsQueryData *query_data,
00063                              PurpleDnsQueryResolvedCallback resolved_cb,
00064                              PurpleDnsQueryFailedCallback failed_cb);
00065 
00070     void (*destroy)(PurpleDnsQueryData *query_data);
00071 
00072     void (*_purple_reserved1)(void);
00073     void (*_purple_reserved2)(void);
00074     void (*_purple_reserved3)(void);
00075     void (*_purple_reserved4)(void);
00076 } PurpleDnsQueryUiOps;
00077 
00078 #ifdef __cplusplus
00079 extern "C" {
00080 #endif
00081 
00082 /**************************************************************************/
00084 /**************************************************************************/
00099 PurpleDnsQueryData *purple_dnsquery_a(const char *hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data);
00100 
00107 void purple_dnsquery_destroy(PurpleDnsQueryData *query_data);
00108 
00116 void purple_dnsquery_set_ui_ops(PurpleDnsQueryUiOps *ops);
00117 
00124 PurpleDnsQueryUiOps *purple_dnsquery_get_ui_ops(void);
00125 
00132 char *purple_dnsquery_get_host(PurpleDnsQueryData *query_data);
00133 
00140 unsigned short purple_dnsquery_get_port(PurpleDnsQueryData *query_data);
00141 
00145 void purple_dnsquery_init(void);
00146 
00150 void purple_dnsquery_uninit(void);
00151 
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157 
00158 #endif /* _PURPLE_DNSQUERY_H_ */