Merge branch 'vendor/GCC44'
[games.git] / contrib / bind-9.3 / lib / bind / irs / nul_ng.c
1 /*
2  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (c) 1996,1999 by Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17
18 #if defined(LIBC_SCCS) && !defined(lint)
19 static const char rcsid[] = "$Id: nul_ng.c,v 1.1.206.1 2004/03/09 08:33:39 marka Exp $";
20 #endif
21
22 /*
23  * nul_ng.c - the netgroup accessor null map
24  */
25
26 #include "port_before.h"
27
28 #include <sys/types.h>
29 #include <netinet/in.h>
30 #include <arpa/nameser.h>
31 #include <resolv.h>
32
33 #include <stdio.h>
34 #include <string.h>
35 #include <netdb.h>
36 #include <ctype.h>
37 #include <stdlib.h>
38 #include <errno.h>
39
40 #include <irs.h>
41 #include <isc/memcluster.h>
42
43 #include "port_after.h"
44
45 #include "irs_p.h"
46 #include "hesiod.h"
47 #include "dns_p.h"
48
49 /* Forward. */
50
51 static void             ng_close(struct irs_ng *);
52 static int              ng_next(struct irs_ng *, const char **,
53                                 const char **, const char **);
54 static int              ng_test(struct irs_ng *,
55                                 const char *, const char *,
56                                 const char *, const char *);
57 static void             ng_rewind(struct irs_ng *, const char *);
58 static void             ng_minimize(struct irs_ng *);
59
60 /* Public. */
61
62 struct irs_ng *
63 irs_nul_ng(struct irs_acc *this) {
64         struct irs_ng *ng;
65
66         UNUSED(this);
67
68         if (!(ng = memget(sizeof *ng))) {
69                 errno = ENOMEM;
70                 return (NULL);
71         }
72         memset(ng, 0x5e, sizeof *ng);
73         ng->private = NULL;
74         ng->close = ng_close;
75         ng->next = ng_next;
76         ng->test = ng_test;
77         ng->rewind = ng_rewind;
78         ng->minimize = ng_minimize;
79         return (ng);
80 }
81
82 /* Methods. */
83
84 static void
85 ng_close(struct irs_ng *this) {
86         memput(this, sizeof *this);
87 }
88
89 /* ARGSUSED */
90 static int
91 ng_next(struct irs_ng *this, const char **host, const char **user,
92         const char **domain)
93 {
94         UNUSED(this);
95         UNUSED(host);
96         UNUSED(user);
97         UNUSED(domain);
98         errno = ENOENT;
99         return (-1);
100 }
101
102 static int
103 ng_test(struct irs_ng *this, const char *name,
104         const char *user, const char *host, const char *domain)
105 {
106         UNUSED(this);
107         UNUSED(name);
108         UNUSED(user);
109         UNUSED(host);
110         UNUSED(domain);
111         errno = ENODEV;
112         return (-1);
113 }
114
115 static void
116 ng_rewind(struct irs_ng *this, const char *netgroup) {
117         UNUSED(this);
118         UNUSED(netgroup);
119         /* NOOP */
120 }
121
122 static void
123 ng_minimize(struct irs_ng *this) {
124         UNUSED(this);
125         /* NOOP */
126 }