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 00033 typedef struct _PurpleDnsQueryData PurpleDnsQueryData; 00034 00040 typedef void (*PurpleDnsQueryConnectFunction)(GSList *hosts, gpointer data, const char *error_message); 00041 00045 typedef void (*PurpleDnsQueryResolvedCallback) (PurpleDnsQueryData *query_data, GSList *hosts); 00046 typedef void (*PurpleDnsQueryFailedCallback) (PurpleDnsQueryData *query_data, const gchar *error_message); 00047 00054 typedef struct 00055 { 00057 gboolean (*resolve_host)(PurpleDnsQueryData *query_data, 00058 PurpleDnsQueryResolvedCallback resolved_cb, 00059 PurpleDnsQueryFailedCallback failed_cb); 00060 00065 void (*destroy)(PurpleDnsQueryData *query_data); 00066 00067 void (*_purple_reserved1)(void); 00068 void (*_purple_reserved2)(void); 00069 void (*_purple_reserved3)(void); 00070 void (*_purple_reserved4)(void); 00071 } PurpleDnsQueryUiOps; 00072 00073 #ifdef __cplusplus 00074 extern "C" { 00075 #endif 00076 00077 /**************************************************************************/ 00079 /**************************************************************************/ 00094 PurpleDnsQueryData *purple_dnsquery_a(const char *hostname, int port, PurpleDnsQueryConnectFunction callback, gpointer data); 00095 00102 void purple_dnsquery_destroy(PurpleDnsQueryData *query_data); 00103 00111 void purple_dnsquery_set_ui_ops(PurpleDnsQueryUiOps *ops); 00112 00119 PurpleDnsQueryUiOps *purple_dnsquery_get_ui_ops(void); 00120 00127 char *purple_dnsquery_get_host(PurpleDnsQueryData *query_data); 00128 00135 unsigned short purple_dnsquery_get_port(PurpleDnsQueryData *query_data); 00136 00140 void purple_dnsquery_init(void); 00141 00145 void purple_dnsquery_uninit(void); 00146 00149 #ifdef __cplusplus 00150 } 00151 #endif 00152 00153 #endif /* _PURPLE_DNSQUERY_H_ */