xref: /titanic_51/usr/src/lib/nsswitch/nis/common/getprinter.c (revision 06e46062ef4f5f4b687cbafb4518fb123fe23920)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 #pragma weak _nss_nis__printers_constr = _nss_nis_printers_constr
30 
31 #include <nss_dbdefs.h>
32 #include "nis_common.h"
33 
34 static nss_status_t
35 getbyname(be, a)
36 	nis_backend_ptr_t	be;
37 	void			*a;
38 {
39 	nss_XbyY_args_t		*argp = (nss_XbyY_args_t *)a;
40 	nss_status_t		res;
41 
42 	return (_nss_nis_lookup(be, argp, 0, "printers.conf.byname",
43 				argp->key.name, 0));
44 }
45 
46 static nis_backend_op_t printers_ops[] = {
47 	_nss_nis_destr,
48 	_nss_nis_endent,
49 	_nss_nis_setent,
50 	_nss_nis_getent_rigid,
51 	getbyname
52 };
53 
54 nss_backend_t *
55 _nss_nis_printers_constr(dummy1, dummy2, dummy3)
56 	const char	*dummy1, *dummy2, *dummy3;
57 {
58 	return (_nss_nis_constr(printers_ops,
59 		sizeof (printers_ops) / sizeof (printers_ops[0]),
60 		"printers.conf.byname"));
61 }
62