1
/* MockResolver - a very stupid resolver used in test code
3
* This resolver always resolves a given hostname successfully, and returns
4
* an error for anything else. It only implements just enough of the API to
5
* fool the usersetup plugin.
7
* Copyright (C) 2012 Canonical Ltd.
8
* Author: Colin Watson <cjwatson@ubuntu.com>
10
* This file is part of Ubiquity.
12
* Ubiquity is free software; you can redistribute it and/or modify it under
13
* the terms of the GNU General Public License as published by the Free
14
* Software Foundation; either version 2 of the License, or at your option)
17
* Ubiquity is distributed in the hope that it will be useful, but WITHOUT
18
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
22
* You should have received a copy of the GNU General Public License along
23
* with Ubiquity; if not, write to the Free Software Foundation, Inc., 51
24
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
#ifndef _UBIQUITY_MOCK_RESOLVER_H
28
#define _UBIQUITY_MOCK_RESOLVER_H
31
#include <glib-object.h>
36
#define UBIQUITY_TYPE_MOCK_RESOLVER ubiquity_mock_resolver_get_type()
38
#define UBIQUITY_MOCK_RESOLVER(obj) \
39
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
40
UBIQUITY_TYPE_MOCK_RESOLVER, UbiquityMockResolver))
42
#define UBIQUITY_MOCK_RESOLVER_CLASS(klass) \
43
(G_TYPE_CHECK_CLASS_CAST ((klass), \
44
UBIQUITY_TYPE_MOCK_RESOLVER, UbiquityMockResolverClass))
46
#define UBIQUITY_IS_MOCK_RESOLVER(obj) \
47
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
48
UBIQUITY_TYPE_MOCK_RESOLVER))
50
#define UBIQUITY_IS_MOCK_RESOLVER_CLASS(klass) \
51
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
52
UBIQUITY_TYPE_MOCK_RESOLVER))
54
#define UBIQUITY_MOCK_RESOLVER_GET_CLASS(obj) \
55
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
56
UBIQUITY_TYPE_MOCK_RESOLVER, UbiquityMockResolverClass))
58
typedef struct _UbiquityMockResolver UbiquityMockResolver;
59
typedef struct _UbiquityMockResolverClass UbiquityMockResolverClass;
60
typedef struct _UbiquityMockResolverPrivate UbiquityMockResolverPrivate;
62
struct _UbiquityMockResolver
66
UbiquityMockResolverPrivate *priv;
69
struct _UbiquityMockResolverClass
71
GResolverClass parent_class;
74
GType ubiquity_mock_resolver_get_type (void) G_GNUC_CONST;
76
UbiquityMockResolver *ubiquity_mock_resolver_new (void);
80
#endif /* _UBIQUITY_MOCK_RESOLVER_H */