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