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
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.
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]
26 * Copyright (c) 1998 by Sun Microsystems, Inc.
27 * All rights reserved.
30 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
31 /* All Rights Reserved */
33 #pragma ident "%Z%%M% %I% %E% SMI"
35 #include "../../include/lp.h"
37 typedef struct PRINTER {
38 char *name; /* name of printer (redundant) */
39 unsigned short banner; /* banner page conditions */
40 SCALED cpi; /* default character pitch */
41 char **char_sets; /* list of okay char-sets/print-wheels */
42 char **input_types; /* list of types acceptable to printer */
43 char *device; /* printer port full path name */
44 char *dial_info; /* system name or phone # for dial-up */
45 char *fault_rec; /* printer fault recovery procedure */
46 char *interface; /* interface program full path name */
47 SCALED lpi; /* default line pitch */
48 SCALED plen; /* default page length */
49 unsigned short login; /* is/isn't a login terminal */
50 char *printer_type; /* Terminfo look-up value (obsolete) */
51 char *remote; /* remote machine!printer-name */
52 char *speed; /* baud rate for connection */
53 char *stty; /* space separated list of stty options */
54 SCALED pwid; /* default page width */
55 char *description; /* comment about printer */
56 FALERT fault_alert; /* how to alert on printer fault */
57 short daisy; /* 1/0 - printwheels/character-sets */
58 #if defined(CAN_DO_MODULES)
59 char **modules; /* streams modules to push */
61 char **printer_types; /* Terminfo look-up values */
62 char **options; /* space separated list of undefined -o options */
65 * Adding new members to this structure? Check out
66 * cmd/lpadmin/do_printer.c, where we initialize
67 * each new printer structure.
71 typedef struct PWHEEL {
72 char *name; /* name of print wheel */
73 FALERT alert; /* how to alert when mount needed */
76 extern unsigned long badprinter,
78 PRINTER * getprinter ( char * );
80 PWHEEL * getpwheel ( char * );
82 char * getdefault ( void );
84 int putprinter ( char *, PRINTER *);
85 int delprinter ( char * );
86 int putdefault ( char * );
87 int deldefault ( void );
88 int putpwheel ( char * , PWHEEL * );
89 int delpwheel ( char * );
90 int okprinter ( char * , PRINTER * , int );
92 unsigned long chkprinter (char *, char *, char *, char *, char *, char *);
94 void freeprinter ( PRINTER * );
95 void freepwheel ( PWHEEL * );
97 char * getpentry(char *, int);