1*13585Swnj /*	lp.h	4.6	83/07/01	*/
212118Sralph /*
312118Sralph  * Global definitions for the line printer system.
412118Sralph  */
512118Sralph 
612118Sralph #include <stdio.h>
712118Sralph #include <sys/types.h>
812118Sralph #include <sys/file.h>
912118Sralph #include <sys/dir.h>
1012118Sralph #include <sys/stat.h>
1112118Sralph #include <sys/socket.h>
1213441Sralph #include <sys/un.h>
1312118Sralph #include <netinet/in.h>
1412118Sralph #include <netdb.h>
1512118Sralph #include <pwd.h>
1612118Sralph #include <signal.h>
17*13585Swnj #include <sys/wait.h>
1812118Sralph #include <sgtty.h>
1912118Sralph #include <ctype.h>
2012118Sralph #include <errno.h>
2112118Sralph #include "lp.local.h"
2212118Sralph 
2312118Sralph extern int	DU;		/* daeomon user-id */
2412118Sralph extern int	MX;		/* maximum number of blocks to copy */
2513170Sralph extern int	MC;		/* maximum number of copies allowed */
2612118Sralph extern char	*LP;		/* line printer device name */
2712118Sralph extern char	*RM;		/* remote machine name */
2812118Sralph extern char	*RP;		/* remote printer name */
2912118Sralph extern char	*LO;		/* lock file name */
3012118Sralph extern char	*ST;		/* status file name */
3112118Sralph extern char	*SD;		/* spool directory */
3212118Sralph extern char	*AF;		/* accounting file */
3312118Sralph extern char	*LF;		/* log file for error messages */
3412118Sralph extern char	*OF;		/* name of output filter (created once) */
3512118Sralph extern char	*IF;		/* name of input filter (created per job) */
3612433Sralph extern char	*RF;		/* name of fortran text filter (per job) */
3712118Sralph extern char	*TF;		/* name of troff(1) filter (per job) */
3813235Sralph extern char	*NF;		/* name of ditroff(1) filter (per job) */
3912118Sralph extern char	*DF;		/* name of tex filter (per job) */
4012118Sralph extern char	*GF;		/* name of graph(1G) filter (per job) */
4112118Sralph extern char	*VF;		/* name of raster filter (per job) */
4212118Sralph extern char	*CF;		/* name of cifplot filter (per job) */
4312118Sralph extern char	*FF;		/* form feed string */
4412118Sralph extern char	*TR;		/* trailer string to be output when Q empties */
4513170Sralph extern short	SC;		/* suppress multiple copies */
4612118Sralph extern short	SF;		/* suppress FF on each print job */
4712118Sralph extern short	SH;		/* suppress header page */
4812118Sralph extern short	SB;		/* short banner instead of normal header */
4912118Sralph extern short	RW;		/* open LP for reading and writing */
5012118Sralph extern short	PW;		/* page width */
5112433Sralph extern short	PX;		/* page width in pixels */
5212433Sralph extern short	PY;		/* page length in pixels */
5312118Sralph extern short	PL;		/* page length */
5412118Sralph extern short	BR;		/* baud rate if lp is a tty */
5513170Sralph extern int	FC;		/* flags to clear if lp is a tty */
5613170Sralph extern int	FS;		/* flags to set if lp is a tty */
5713170Sralph extern int	XC;		/* flags to clear for local mode */
5813170Sralph extern int	XS;		/* flags to set for local mode */
5912433Sralph extern short	RS;		/* restricted to those with local accounts */
6012118Sralph 
6112118Sralph extern char	line[BUFSIZ];
6212118Sralph extern char	pbuf[];		/* buffer for printcap entry */
6312118Sralph extern char	*bp;		/* pointer into ebuf for pgetent() */
6412118Sralph extern char	*name;		/* program name */
6512118Sralph extern char	*printer;	/* printer name */
6612118Sralph extern char	host[32];	/* host machine name */
6712118Sralph extern char	*from;		/* client's machine name */
6812118Sralph extern int	errno;
6912118Sralph 
7012118Sralph /*
7112118Sralph  * Structure used for building a sorted list of control files.
7212118Sralph  */
7312118Sralph struct queue {
7412118Sralph 	time_t	q_time;			/* modification time */
7512118Sralph 	char	q_name[MAXNAMLEN+1];	/* control file name */
7612118Sralph };
7712118Sralph 
7812118Sralph char	*pgetstr();
7912118Sralph char	*malloc();
8012118Sralph char	*getenv();
8112118Sralph char	*index();
8212118Sralph char	*rindex();
83