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, see <http://www.gnu.org/licenses/>.
19 #ifndef __G_RESOLVER_H__
20 #define __G_RESOLVER_H__
22 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
23 #error "Only <gio/gio.h> can be included directly."
26 #include <gio/giotypes.h>
30 #define G_TYPE_RESOLVER (g_resolver_get_type ())
31 #define G_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_RESOLVER, GResolver))
32 #define G_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_RESOLVER, GResolverClass))
33 #define G_IS_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_RESOLVER))
34 #define G_IS_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_RESOLVER))
35 #define G_RESOLVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_RESOLVER, GResolverClass))
37 typedef struct _GResolverPrivate GResolverPrivate
;
38 typedef struct _GResolverClass GResolverClass
;
41 GObject parent_instance
;
43 GResolverPrivate
*priv
;
46 struct _GResolverClass
{
47 GObjectClass parent_class
;
50 void ( *reload
) (GResolver
*resolver
);
53 GList
* ( *lookup_by_name
) (GResolver
*resolver
,
54 const gchar
*hostname
,
55 GCancellable
*cancellable
,
57 void ( *lookup_by_name_async
) (GResolver
*resolver
,
58 const gchar
*hostname
,
59 GCancellable
*cancellable
,
60 GAsyncReadyCallback callback
,
62 GList
* ( *lookup_by_name_finish
) (GResolver
*resolver
,
66 gchar
* ( *lookup_by_address
) (GResolver
*resolver
,
67 GInetAddress
*address
,
68 GCancellable
*cancellable
,
70 void ( *lookup_by_address_async
) (GResolver
*resolver
,
71 GInetAddress
*address
,
72 GCancellable
*cancellable
,
73 GAsyncReadyCallback callback
,
75 gchar
* ( *lookup_by_address_finish
) (GResolver
*resolver
,
79 GList
* ( *lookup_service
) (GResolver
*resolver
,
81 GCancellable
*cancellable
,
83 void ( *lookup_service_async
) (GResolver
*resolver
,
85 GCancellable
*cancellable
,
86 GAsyncReadyCallback callback
,
88 GList
* ( *lookup_service_finish
) (GResolver
*resolver
,
92 GList
* ( *lookup_records
) (GResolver
*resolver
,
94 GResolverRecordType record_type
,
95 GCancellable
*cancellable
,
98 void ( *lookup_records_async
) (GResolver
*resolver
,
100 GResolverRecordType record_type
,
101 GCancellable
*cancellable
,
102 GAsyncReadyCallback callback
,
105 GList
* ( *lookup_records_finish
) (GResolver
*resolver
,
106 GAsyncResult
*result
,
109 /* Padding for future expansion */
110 void (*_g_reserved4
) (void);
111 void (*_g_reserved5
) (void);
112 void (*_g_reserved6
) (void);
116 GLIB_AVAILABLE_IN_ALL
117 GType
g_resolver_get_type (void) G_GNUC_CONST
;
118 GLIB_AVAILABLE_IN_ALL
119 GResolver
*g_resolver_get_default (void);
120 GLIB_AVAILABLE_IN_ALL
121 void g_resolver_set_default (GResolver
*resolver
);
123 GLIB_AVAILABLE_IN_ALL
124 GList
*g_resolver_lookup_by_name (GResolver
*resolver
,
125 const gchar
*hostname
,
126 GCancellable
*cancellable
,
128 GLIB_AVAILABLE_IN_ALL
129 void g_resolver_lookup_by_name_async (GResolver
*resolver
,
130 const gchar
*hostname
,
131 GCancellable
*cancellable
,
132 GAsyncReadyCallback callback
,
134 GLIB_AVAILABLE_IN_ALL
135 GList
*g_resolver_lookup_by_name_finish (GResolver
*resolver
,
136 GAsyncResult
*result
,
139 GLIB_AVAILABLE_IN_ALL
140 void g_resolver_free_addresses (GList
*addresses
);
142 GLIB_AVAILABLE_IN_ALL
143 gchar
*g_resolver_lookup_by_address (GResolver
*resolver
,
144 GInetAddress
*address
,
145 GCancellable
*cancellable
,
147 GLIB_AVAILABLE_IN_ALL
148 void g_resolver_lookup_by_address_async (GResolver
*resolver
,
149 GInetAddress
*address
,
150 GCancellable
*cancellable
,
151 GAsyncReadyCallback callback
,
153 GLIB_AVAILABLE_IN_ALL
154 gchar
*g_resolver_lookup_by_address_finish (GResolver
*resolver
,
155 GAsyncResult
*result
,
158 GLIB_AVAILABLE_IN_ALL
159 GList
*g_resolver_lookup_service (GResolver
*resolver
,
160 const gchar
*service
,
161 const gchar
*protocol
,
163 GCancellable
*cancellable
,
165 GLIB_AVAILABLE_IN_ALL
166 void g_resolver_lookup_service_async (GResolver
*resolver
,
167 const gchar
*service
,
168 const gchar
*protocol
,
170 GCancellable
*cancellable
,
171 GAsyncReadyCallback callback
,
173 GLIB_AVAILABLE_IN_ALL
174 GList
*g_resolver_lookup_service_finish (GResolver
*resolver
,
175 GAsyncResult
*result
,
178 GLIB_AVAILABLE_IN_2_34
179 GList
*g_resolver_lookup_records (GResolver
*resolver
,
181 GResolverRecordType record_type
,
182 GCancellable
*cancellable
,
184 GLIB_AVAILABLE_IN_2_34
185 void g_resolver_lookup_records_async (GResolver
*resolver
,
187 GResolverRecordType record_type
,
188 GCancellable
*cancellable
,
189 GAsyncReadyCallback callback
,
191 GLIB_AVAILABLE_IN_2_34
192 GList
*g_resolver_lookup_records_finish (GResolver
*resolver
,
193 GAsyncResult
*result
,
196 GLIB_AVAILABLE_IN_ALL
197 void g_resolver_free_targets (GList
*targets
);
202 * Error domain for #GResolver. Errors in this domain will be from the
203 * #GResolverError enumeration. See #GError for more information on
206 #define G_RESOLVER_ERROR (g_resolver_error_quark ())
207 GLIB_AVAILABLE_IN_ALL
208 GQuark
g_resolver_error_quark (void);
212 #endif /* __G_RESOLVER_H__ */