printers.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#if !defined(_LP_PRINTERS_H)
#define _LP_PRINTERS_H
/*
* Define the following to support administrator configurable
* streams modules:
*/
/**
** The disk copy of the printer files:
**/
/*
* There are 19 fields in the printer configuration file.
*/
#define PR_MAX 19
# define PR_BAN 0
# define PR_CPI 1
# define PR_CS 2
# define PR_ITYPES 3
# define PR_DEV 4
# define PR_DIAL 5
# define PR_RECOV 6
# define PR_INTFC 7
# define PR_LPI 8
# define PR_LEN 9
# define PR_LOGIN 10
# define PR_PTYPE 11
# define PR_REMOTE 12
# define PR_SPEED 13
# define PR_STTY 14
# define PR_WIDTH 15
# define PR_MODULES 16
#define PR_OPTIONS 17
#define PR_PPD 18
/**
**/
#define PS_REJECTED 0x001
#define PS_DISABLED 0x002
#define PS_FAULTED 0x004
#define PS_BUSY 0x008
#define PS_REMOTE 0x020
/**
** The internal copy of a printer as seen by the rest of the world:
**/
/*
* A (char **) list is an array of string pointers (char *) with
* a null pointer after the last item.
*/
typedef struct PRINTER {
char *name; /* name of printer (redundant) */
unsigned short banner; /* banner page conditions */
char **char_sets; /* list of okay char-sets/print-wheels */
char **input_types; /* list of types acceptable to printer */
char *device; /* printer port full path name */
char *dial_info; /* system name or phone # for dial-up */
char *fault_rec; /* printer fault recovery procedure */
char *interface; /* interface program full path name */
char *printer_type; /* Terminfo look-up value (obsolete) */
char *remote; /* remote machine!printer-name */
char *speed; /* baud rate for connection */
char *stty; /* space separated list of stty options */
char *description; /* comment about printer */
short daisy; /* 1/0 - printwheels/character-sets */
#if defined(CAN_DO_MODULES)
char **modules; /* streams modules to push */
#endif
char **printer_types; /* Terminfo look-up values */
char **options; /* space separated list of undefined -o options */
#ifdef LP_USE_PAPI_ATTR
char *ppd; /* printer's PPD file full path name */
#endif
/*
* Adding new members to this structure? Check out
* cmd/lpadmin/do_printer.c, where we initialize
* each new printer structure.
*/
} PRINTER;
/*
* The following PCK_... bits are only set by the Spooler,
* when refusing a request.
*/
/*
* Flags set by "putprinter()" for things that go wrong.
*/
/*
* A comma separated list of STREAMS modules to be pushed on an
* opened port.
*/
#define DEFMODULES "ldterm"
/*
* For print wheels:
*/
typedef struct PWHEEL {
char *name; /* name of print wheel */
} PWHEEL;
extern unsigned long badprinter,
/*
* Set if ppd file information is from the user rather than
* the configuration file.
*/
extern int ppdopt;
/**
** Various routines.
**/
PRINTER * getprinter ( char * );
char * getdefault ( void );
int putprinter ( char *, PRINTER *);
int delprinter ( char * );
int putdefault ( char * );
int deldefault ( void );
int delpwheel ( char * );
unsigned long chkprinter (char *, char *, char *, char *, char *, char *);
void freeprinter ( PRINTER * );
void freepwheel ( PWHEEL * );
char * getpentry(char *, int);
/**
** Aliases (copies) of some important Terminfo caps.
**/
extern int ti_daisy;
#endif