|
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
|
2 /* |
|
3 * Copyright (C) 2008 Imendio AB |
|
4 * |
|
5 * This program is free software; you can redistribute it and/or |
|
6 * modify it under the terms of the GNU Lesser General Public License as |
|
7 * published by the Free Software Foundation; either version 2 of the |
|
8 * License, or (at your option) any later version. |
|
9 * |
|
10 * This program 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. |
|
14 * |
|
15 * You should have received a copy of the GNU Lesser General Public |
|
16 * License along with this program; if not, write to the |
|
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
18 * Boston, MA 02111-1307, USA. |
|
19 */ |
|
20 |
|
21 #ifndef __LM_RESOLVER_H__ |
|
22 #define __LM_RESOLVER_H__ |
|
23 |
|
24 #include <glib-object.h> |
|
25 |
|
26 G_BEGIN_DECLS |
|
27 |
|
28 #define LM_TYPE_RESOLVER (lm_resolver_get_type()) |
|
29 #define LM_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), LM_TYPE_RESOLVER, LmResolver)) |
|
30 #define LM_IS_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), LM_TYPE_RESOLVER)) |
|
31 #define LM_RESOLVER_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE((o), LM_TYPE_RESOLVER, LmResolverIface)) |
|
32 |
|
33 typedef struct _LmResolver LmResolver; |
|
34 typedef struct _LmResolverIface LmResolverIface; |
|
35 |
|
36 struct _LmResolverIface { |
|
37 GTypeInterface parent; |
|
38 |
|
39 /* <vtable> */ |
|
40 void (*lookup_host) (LmResolver *resolver, |
|
41 const gchar *host); |
|
42 void (*lookup_srv) (LmResolver *resolver, |
|
43 const gchar *domain, |
|
44 const gchar *srv); |
|
45 void (*cancel) (LmResolver *resolver); |
|
46 }; |
|
47 |
|
48 typedef void (*LmResolverCallback) (LmResolver *resolver, |
|
49 guint status_code, |
|
50 gpointer user_data); |
|
51 |
|
52 GType lm_resolver_get_type (void); |
|
53 |
|
54 LmResolver * lm_resolver_new (LmResolverCallback callback, |
|
55 gpointer user_data); |
|
56 void lm_resolver_lookup_host (LmResolver *resolver, |
|
57 const gchar *host); |
|
58 void lm_resolver_lookup_srv (LmResolver *resolver, |
|
59 const gchar *domain, |
|
60 const gchar *srv); |
|
61 void lm_resolver_cancel (LmResolver *resolver); |
|
62 |
|
63 G_END_DECLS |
|
64 |
|
65 #endif /* __LM_RESOLVER_H__ */ |