1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2008 Red Hat, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
22 #error "Only <gio/gio.h> can be included directly."
25 #ifndef __G_RESOLVER_H__
26 #define __G_RESOLVER_H__
28 #include <gio/giotypes.h>
32 #define G_TYPE_RESOLVER (g_resolver_get_type ())
33 #define G_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_RESOLVER, GResolver))
34 #define G_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_RESOLVER, GResolverClass))
35 #define G_IS_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_RESOLVER))
36 #define G_IS_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_RESOLVER))
37 #define G_RESOLVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_RESOLVER, GResolverClass))
39 typedef struct _GResolverPrivate GResolverPrivate;
40 typedef struct _GResolverClass GResolverClass;
43 GObject parent_instance;
45 GResolverPrivate *priv;
48 struct _GResolverClass {
49 GObjectClass parent_class;
52 void ( *reload) (GResolver *resolver);
55 GList * ( *lookup_by_name) (GResolver *resolver,
56 const gchar *hostname,
57 GCancellable *cancellable,
59 void ( *lookup_by_name_async) (GResolver *resolver,
60 const gchar *hostname,
61 GCancellable *cancellable,
62 GAsyncReadyCallback callback,
64 GList * ( *lookup_by_name_finish) (GResolver *resolver,
68 gchar * ( *lookup_by_address) (GResolver *resolver,
69 GInetAddress *address,
70 GCancellable *cancellable,
72 void ( *lookup_by_address_async) (GResolver *resolver,
73 GInetAddress *address,
74 GCancellable *cancellable,
75 GAsyncReadyCallback callback,
77 gchar * ( *lookup_by_address_finish) (GResolver *resolver,
81 GList * ( *lookup_service) (GResolver *resolver,
83 GCancellable *cancellable,
85 void ( *lookup_service_async) (GResolver *resolver,
87 GCancellable *cancellable,
88 GAsyncReadyCallback callback,
90 GList * ( *lookup_service_finish) (GResolver *resolver,
94 /* Padding for future expansion */
95 void (*_g_reserved1) (void);
96 void (*_g_reserved2) (void);
97 void (*_g_reserved3) (void);
98 void (*_g_reserved4) (void);
99 void (*_g_reserved5) (void);
100 void (*_g_reserved6) (void);
104 GType g_resolver_get_type (void) G_GNUC_CONST;
105 GResolver *g_resolver_get_default (void);
106 void g_resolver_set_default (GResolver *resolver);
108 GList *g_resolver_lookup_by_name (GResolver *resolver,
109 const gchar *hostname,
110 GCancellable *cancellable,
112 void g_resolver_lookup_by_name_async (GResolver *resolver,
113 const gchar *hostname,
114 GCancellable *cancellable,
115 GAsyncReadyCallback callback,
117 GList *g_resolver_lookup_by_name_finish (GResolver *resolver,
118 GAsyncResult *result,
121 void g_resolver_free_addresses (GList *addresses);
123 gchar *g_resolver_lookup_by_address (GResolver *resolver,
124 GInetAddress *address,
125 GCancellable *cancellable,
127 void g_resolver_lookup_by_address_async (GResolver *resolver,
128 GInetAddress *address,
129 GCancellable *cancellable,
130 GAsyncReadyCallback callback,
132 gchar *g_resolver_lookup_by_address_finish (GResolver *resolver,
133 GAsyncResult *result,
136 GList *g_resolver_lookup_service (GResolver *resolver,
137 const gchar *service,
138 const gchar *protocol,
140 GCancellable *cancellable,
142 void g_resolver_lookup_service_async (GResolver *resolver,
143 const gchar *service,
144 const gchar *protocol,
146 GCancellable *cancellable,
147 GAsyncReadyCallback callback,
149 GList *g_resolver_lookup_service_finish (GResolver *resolver,
150 GAsyncResult *result,
153 void g_resolver_free_targets (GList *targets);
158 * Error domain for #GResolver. Errors in this domain will be from the
159 * #GResolverError enumeration. See #GError for more information on
162 #define G_RESOLVER_ERROR (g_resolver_error_quark ())
163 GQuark g_resolver_error_quark (void);
167 #endif /* __G_RESOLVER_H__ */