gnome-adns

Name

gnome-adns -- an asynchronous dns resolver.

Synopsis



void        (*GnomeAdnsCallback)            (GnomeNetAddress *address,
                                             gpointer user_data);
gint        gnome_adns_lookup               (const gchar *hostname,
                                             GnomeNetAddressType address_type,
                                             GnomeAdnsCallback callback,
                                             gpointer callback_data);
gboolean    gnome_adns_abort                (gint tag);

Description

Details

GnomeAdnsCallback ()

void        (*GnomeAdnsCallback)            (GnomeNetAddress *address,
                                             gpointer user_data);

address :the result of the dns lookup. Its type is GNOME_NET_ADDRESS_INVALID iff the lookup failed. You haven't to destroy (free) the address: the library will do this for you when you return from the callback. If you need it after the callback returns you must call gnome_net_address_dup() to obtain a safe copy.
user_data :the pointer you passed to gnome_adns_lookup().


gnome_adns_lookup ()

gint        gnome_adns_lookup               (const gchar *hostname,
                                             GnomeNetAddressType address_type,
                                             GnomeAdnsCallback callback,
                                             gpointer callback_data);

Starts an asynchronous dns lookup. If you want, at any time you can call gnome_adns_abort() to abort the lookup: in this case the callback will not be called.

hostname :the name to be resolved.
address_type :this must be GNOME_NET_ADDRESS_INET4 for now.
callback :the function to call when dns lookup has been performed.
callback_data :the data to pass to the callback.
Returns :a valid tag or 0 in case of error.


gnome_adns_abort ()

gboolean    gnome_adns_abort                (gint tag);

Aborts a dns lookup started by gnome_adns_lookup().

tag :the tag obtained from gnome_adns_lookup().
Returns :TRUE on success, FALSE otherwise.