112118Sralph /*
2*22441Sdist  * Copyright (c) 1983 Regents of the University of California.
3*22441Sdist  * All rights reserved.  The Berkeley software License Agreement
4*22441Sdist  * specifies the terms and conditions for redistribution.
5*22441Sdist  *
6*22441Sdist  *	@(#)lp.h	5.1 (Berkeley) 06/06/85
7*22441Sdist  */
8*22441Sdist 
9*22441Sdist /*
1012118Sralph  * Global definitions for the line printer system.
1112118Sralph  */
1212118Sralph 
1312118Sralph #include <stdio.h>
1416756Sralph #include <sys/param.h>
1512118Sralph #include <sys/file.h>
1612118Sralph #include <sys/dir.h>
1712118Sralph #include <sys/stat.h>
1812118Sralph #include <sys/socket.h>
1913441Sralph #include <sys/un.h>
2012118Sralph #include <netinet/in.h>
2112118Sralph #include <netdb.h>
2212118Sralph #include <pwd.h>
2316756Sralph #include <syslog.h>
2412118Sralph #include <signal.h>
2513585Swnj #include <sys/wait.h>
2612118Sralph #include <sgtty.h>
2712118Sralph #include <ctype.h>
2812118Sralph #include <errno.h>
2912118Sralph #include "lp.local.h"
3012118Sralph 
3112118Sralph extern int	DU;		/* daeomon user-id */
3212118Sralph extern int	MX;		/* maximum number of blocks to copy */
3313170Sralph extern int	MC;		/* maximum number of copies allowed */
3412118Sralph extern char	*LP;		/* line printer device name */
3512118Sralph extern char	*RM;		/* remote machine name */
3617929Smiriam extern char	*RG;		/* restricted group */
3712118Sralph extern char	*RP;		/* remote printer name */
3812118Sralph extern char	*LO;		/* lock file name */
3912118Sralph extern char	*ST;		/* status file name */
4012118Sralph extern char	*SD;		/* spool directory */
4112118Sralph extern char	*AF;		/* accounting file */
4212118Sralph extern char	*LF;		/* log file for error messages */
4312118Sralph extern char	*OF;		/* name of output filter (created once) */
4412118Sralph extern char	*IF;		/* name of input filter (created per job) */
4512433Sralph extern char	*RF;		/* name of fortran text filter (per job) */
4612118Sralph extern char	*TF;		/* name of troff(1) filter (per job) */
4713235Sralph extern char	*NF;		/* name of ditroff(1) filter (per job) */
4812118Sralph extern char	*DF;		/* name of tex filter (per job) */
4912118Sralph extern char	*GF;		/* name of graph(1G) filter (per job) */
5012118Sralph extern char	*VF;		/* name of raster filter (per job) */
5112118Sralph extern char	*CF;		/* name of cifplot filter (per job) */
5212118Sralph extern char	*FF;		/* form feed string */
5312118Sralph extern char	*TR;		/* trailer string to be output when Q empties */
5413170Sralph extern short	SC;		/* suppress multiple copies */
5512118Sralph extern short	SF;		/* suppress FF on each print job */
5612118Sralph extern short	SH;		/* suppress header page */
5712118Sralph extern short	SB;		/* short banner instead of normal header */
5818127Sralph extern short	HL;		/* print header last */
5912118Sralph extern short	RW;		/* open LP for reading and writing */
6012118Sralph extern short	PW;		/* page width */
6112433Sralph extern short	PX;		/* page width in pixels */
6212433Sralph extern short	PY;		/* page length in pixels */
6312118Sralph extern short	PL;		/* page length */
6412118Sralph extern short	BR;		/* baud rate if lp is a tty */
6513170Sralph extern int	FC;		/* flags to clear if lp is a tty */
6613170Sralph extern int	FS;		/* flags to set if lp is a tty */
6713170Sralph extern int	XC;		/* flags to clear for local mode */
6813170Sralph extern int	XS;		/* flags to set for local mode */
6912433Sralph extern short	RS;		/* restricted to those with local accounts */
7012118Sralph 
7112118Sralph extern char	line[BUFSIZ];
7212118Sralph extern char	pbuf[];		/* buffer for printcap entry */
7312118Sralph extern char	*bp;		/* pointer into ebuf for pgetent() */
7412118Sralph extern char	*name;		/* program name */
7512118Sralph extern char	*printer;	/* printer name */
7612118Sralph extern char	host[32];	/* host machine name */
7712118Sralph extern char	*from;		/* client's machine name */
7812118Sralph extern int	errno;
7912118Sralph 
8012118Sralph /*
8112118Sralph  * Structure used for building a sorted list of control files.
8212118Sralph  */
8312118Sralph struct queue {
8412118Sralph 	time_t	q_time;			/* modification time */
8512118Sralph 	char	q_name[MAXNAMLEN+1];	/* control file name */
8612118Sralph };
8712118Sralph 
8812118Sralph char	*pgetstr();
8912118Sralph char	*malloc();
9012118Sralph char	*getenv();
9112118Sralph char	*index();
9212118Sralph char	*rindex();
93