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 GList * ( *lookup_records) (GResolver *resolver,
96 GResolverRecordType record_type,
97 GCancellable *cancellable,
100 void ( *lookup_records_async) (GResolver *resolver,
102 GResolverRecordType record_type,
103 GCancellable *cancellable,
104 GAsyncReadyCallback callback,
107 GList * ( *lookup_records_finish) (GResolver *resolver,
108 GAsyncResult *result,
111 /* Padding for future expansion */
112 void (*_g_reserved4) (void);
113 void (*_g_reserved5) (void);
114 void (*_g_reserved6) (void);
118 GType g_resolver_get_type (void) G_GNUC_CONST;
119 GResolver *g_resolver_get_default (void);
120 void g_resolver_set_default (GResolver *resolver);
122 GList *g_resolver_lookup_by_name (GResolver *resolver,
123 const gchar *hostname,
124 GCancellable *cancellable,
126 void g_resolver_lookup_by_name_async (GResolver *resolver,
127 const gchar *hostname,
128 GCancellable *cancellable,
129 GAsyncReadyCallback callback,
131 GList *g_resolver_lookup_by_name_finish (GResolver *resolver,
132 GAsyncResult *result,
135 void g_resolver_free_addresses (GList *addresses);
137 gchar *g_resolver_lookup_by_address (GResolver *resolver,
138 GInetAddress *address,
139 GCancellable *cancellable,
141 void g_resolver_lookup_by_address_async (GResolver *resolver,
142 GInetAddress *address,
143 GCancellable *cancellable,
144 GAsyncReadyCallback callback,
146 gchar *g_resolver_lookup_by_address_finish (GResolver *resolver,
147 GAsyncResult *result,
150 GList *g_resolver_lookup_service (GResolver *resolver,
151 const gchar *service,
152 const gchar *protocol,
154 GCancellable *cancellable,
156 void g_resolver_lookup_service_async (GResolver *resolver,
157 const gchar *service,
158 const gchar *protocol,
160 GCancellable *cancellable,
161 GAsyncReadyCallback callback,
163 GList *g_resolver_lookup_service_finish (GResolver *resolver,
164 GAsyncResult *result,
167 GLIB_AVAILABLE_IN_2_34
168 GList *g_resolver_lookup_records (GResolver *resolver,
170 GResolverRecordType record_type,
171 GCancellable *cancellable,
173 GLIB_AVAILABLE_IN_2_34
174 void g_resolver_lookup_records_async (GResolver *resolver,
176 GResolverRecordType record_type,
177 GCancellable *cancellable,
178 GAsyncReadyCallback callback,
180 GLIB_AVAILABLE_IN_2_34
181 GList *g_resolver_lookup_records_finish (GResolver *resolver,
182 GAsyncResult *result,
185 void g_resolver_free_targets (GList *targets);
190 * Error domain for #GResolver. Errors in this domain will be from the
191 * #GResolverError enumeration. See #GError for more information on
194 #define G_RESOLVER_ERROR (g_resolver_error_quark ())
195 GQuark g_resolver_error_quark (void);
199 #endif /* __G_RESOLVER_H__ */