Mercurial > pidgin
comparison src/dnsquery.h @ 14183:c3c792958635
[gaim-migrate @ 16835]
Change the DNS query function to return a struct that will eventually
allow the query to be canceled. Also rename two of the DNS query things
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 18 Aug 2006 07:40:17 +0000 |
parents | fc92a5a7dd95 |
children |
comparison
equal
deleted
inserted
replaced
14182:ccb670ba3b4f | 14183:c3c792958635 |
---|---|
26 #define _GAIM_DNSQUERY_H_ | 26 #define _GAIM_DNSQUERY_H_ |
27 | 27 |
28 #include <glib.h> | 28 #include <glib.h> |
29 #include "eventloop.h" | 29 #include "eventloop.h" |
30 | 30 |
31 typedef struct _GaimDnsQueryData GaimDnsQueryData; | |
32 | |
31 /** | 33 /** |
32 * The "hosts" parameter is a linked list containing pairs of | 34 * The "hosts" parameter is a linked list containing pairs of |
33 * one size_t addrlen and one struct sockaddr *addr. | 35 * one size_t addrlen and one struct sockaddr *addr. |
34 */ | 36 */ |
35 typedef void (*GaimProxyDnsConnectFunction)(GSList *hosts, gpointer data, const char *error_message); | 37 typedef void (*GaimDnsQueryConnectFunction)(GSList *hosts, gpointer data, const char *error_message); |
36 | 38 |
37 | 39 |
38 #include "account.h" | 40 #include "account.h" |
39 | 41 |
40 #ifdef __cplusplus | 42 #ifdef __cplusplus |
52 * @param hostname The hostname to resolve | 54 * @param hostname The hostname to resolve |
53 * @param port A portnumber which is stored in the struct sockaddr | 55 * @param port A portnumber which is stored in the struct sockaddr |
54 * @param callback Callback to call after resolving | 56 * @param callback Callback to call after resolving |
55 * @param data Extra data for the callback function | 57 * @param data Extra data for the callback function |
56 * | 58 * |
57 * @return Zero indicates the connection is pending. Any other value indicates failure. | 59 * @return NULL if there was an error, otherwise return a reference to |
60 * a data structure that can be used to cancel the pending | |
61 * DNS query, if needed. | |
58 */ | 62 */ |
59 int gaim_gethostbyname_async(const char *hostname, int port, GaimProxyDnsConnectFunction callback, gpointer data); | 63 GaimDnsQueryData *gaim_dnsquery_a(const char *hostname, int port, GaimDnsQueryConnectFunction callback, gpointer data); |
60 | 64 |
61 /*@}*/ | 65 /*@}*/ |
62 | 66 |
63 #ifdef __cplusplus | 67 #ifdef __cplusplus |
64 } | 68 } |