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