xref: /titanic_50/usr/src/cmd/lp/cmd/lpsched/validate.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 1992 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved  	*/
29 
30 
31 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.1.1.2	*/
32 
33 /*
34  * The old LP Spooler would take a job destined for a class of printers
35  * if the class was accepting, regardless of the acceptance status of
36  * the printers. This sounds a bit silly, so we thought we'd change it.
37  * Well, that's not compatible. So YOU decide. Define the following if
38  * you want compatibility, don't define it if you want to require BOTH
39  * the printers (at least one) and the class to be accepting.
40  */
41 #define CLASS_ACCEPT_PRINTERS_REJECT_SOWHAT 1	/* */
42 
43 /*
44  * Define the following if we should stop examing a list of printers
45  * on the first one that meets all the needs of the request.
46  * Currently this is done because to continue wouldn't matter. However,
47  * you may add additional code that considers other factors (e.g. size
48  * of queue for printer, size of file under consideration.)
49  */
50 #define FILTER_EARLY_OUT 1			/* */
51 
52 typedef struct candidate {
53 	PSTATUS *		pps;
54 	char *			slow;
55 	char *			fast;
56 	char **			printer_types;
57 	char *			printer_type;
58 	char *			output_type;
59 	unsigned short		flags;
60 	unsigned short		weight;
61 }			CANDIDATE;
62 
63 #define WEIGHT_NOFILTER	 1
64 #define WEIGHT_FREE	 2
65 #define	WEIGHT_ENABLED	 4
66 #define	WEIGHT_MOUNTED	 8
67 #define WEIGHT_SELECTS	16
68 #define WEIGHT_LOCAL	32
69 #define	WEIGHT_MAX	( \
70 				WEIGHT_NOFILTER \
71 			      + WEIGHT_FREE \
72 			      + WEIGHT_ENABLED \
73 			      + 2 * WEIGHT_MOUNTED \
74 			      + WEIGHT_SELECTS \
75 			      + WEIGHT_LOCAL \
76 			)
77 
78 extern int		pick_filter();
79 
80 extern char		*o_cpi,
81 			*o_lpi,
82 			*o_width,
83 			*o_length;
84