Mercurial > pidgin
diff 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 |
line wrap: on
line diff
--- a/src/dnsquery.h Fri Aug 18 07:22:55 2006 +0000 +++ b/src/dnsquery.h Fri Aug 18 07:40:17 2006 +0000 @@ -28,11 +28,13 @@ #include <glib.h> #include "eventloop.h" +typedef struct _GaimDnsQueryData GaimDnsQueryData; + /** * The "hosts" parameter is a linked list containing pairs of * one size_t addrlen and one struct sockaddr *addr. */ -typedef void (*GaimProxyDnsConnectFunction)(GSList *hosts, gpointer data, const char *error_message); +typedef void (*GaimDnsQueryConnectFunction)(GSList *hosts, gpointer data, const char *error_message); #include "account.h" @@ -54,9 +56,11 @@ * @param callback Callback to call after resolving * @param data Extra data for the callback function * - * @return Zero indicates the connection is pending. Any other value indicates failure. + * @return NULL if there was an error, otherwise return a reference to + * a data structure that can be used to cancel the pending + * DNS query, if needed. */ -int gaim_gethostbyname_async(const char *hostname, int port, GaimProxyDnsConnectFunction callback, gpointer data); +GaimDnsQueryData *gaim_dnsquery_a(const char *hostname, int port, GaimDnsQueryConnectFunction callback, gpointer data); /*@}*/