xref: /illumos-gate/usr/src/cmd/lp/cmd/lpsched/validate.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
27 /*	  All Rights Reserved  	*/
28 
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * The old LP Spooler would take a job destined for a class of printers
34  * if the class was accepting, regardless of the acceptance status of
35  * the printers. This sounds a bit silly, so we thought we'd change it.
36  * Well, that's not compatible. So YOU decide. Define the following if
37  * you want compatibility, don't define it if you want to require BOTH
38  * the printers (at least one) and the class to be accepting.
39  */
40 #define CLASS_ACCEPT_PRINTERS_REJECT_SOWHAT 1	/* */
41 
42 /*
43  * Define the following if we should stop examing a list of printers
44  * on the first one that meets all the needs of the request.
45  * Currently this is done because to continue wouldn't matter. However,
46  * you may add additional code that considers other factors (e.g. size
47  * of queue for printer, size of file under consideration.)
48  */
49 #define FILTER_EARLY_OUT 1			/* */
50 
51 typedef struct candidate {
52 	PSTATUS *		pps;
53 	char *			slow;
54 	char *			fast;
55 	char **			printer_types;
56 	char *			printer_type;
57 	char *			output_type;
58 	unsigned short		flags;
59 	unsigned short		weight;
60 }			CANDIDATE;
61 
62 #define WEIGHT_NOFILTER	 1
63 #define WEIGHT_FREE	 2
64 #define	WEIGHT_ENABLED	 4
65 #define	WEIGHT_MOUNTED	 8
66 #define WEIGHT_SELECTS	16
67 #define	WEIGHT_MAX	( \
68 				WEIGHT_NOFILTER \
69 			      + WEIGHT_FREE \
70 			      + WEIGHT_ENABLED \
71 			      + 2 * WEIGHT_MOUNTED \
72 			      + WEIGHT_SELECTS \
73 			)
74 
75 extern int		pick_filter();
76 
77 extern char		*o_cpi,
78 			*o_lpi,
79 			*o_width,
80 			*o_length;
81