112118Sralph /*
222441Sdist  * Copyright (c) 1983 Regents of the University of California.
334203Sbostic  * All rights reserved.
422441Sdist  *
534203Sbostic  * Redistribution and use in source and binary forms are permitted
634936Sbostic  * provided that the above copyright notice and this paragraph are
734936Sbostic  * duplicated in all such forms and that any documentation,
834936Sbostic  * advertising materials, and other materials related to such
934936Sbostic  * distribution and use acknowledge that the software was developed
1034936Sbostic  * by the University of California, Berkeley.  The name of the
1134936Sbostic  * University may not be used to endorse or promote products derived
1234936Sbostic  * from this software without specific prior written permission.
1334936Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1434936Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1534936Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1634203Sbostic  *
17*38736Stef  *	@(#)lp.h	5.4 (Berkeley) 08/22/89
1822441Sdist  */
1922441Sdist 
2022441Sdist /*
2112118Sralph  * Global definitions for the line printer system.
2212118Sralph  */
2312118Sralph 
2412118Sralph #include <stdio.h>
2516756Sralph #include <sys/param.h>
2612118Sralph #include <sys/file.h>
2712118Sralph #include <sys/dir.h>
2812118Sralph #include <sys/stat.h>
2912118Sralph #include <sys/socket.h>
3013441Sralph #include <sys/un.h>
3112118Sralph #include <netinet/in.h>
3212118Sralph #include <netdb.h>
3312118Sralph #include <pwd.h>
3416756Sralph #include <syslog.h>
3512118Sralph #include <signal.h>
3613585Swnj #include <sys/wait.h>
3712118Sralph #include <sgtty.h>
3812118Sralph #include <ctype.h>
3912118Sralph #include <errno.h>
4012118Sralph #include "lp.local.h"
4112118Sralph 
4212118Sralph extern int	DU;		/* daeomon user-id */
4312118Sralph extern int	MX;		/* maximum number of blocks to copy */
4413170Sralph extern int	MC;		/* maximum number of copies allowed */
4512118Sralph extern char	*LP;		/* line printer device name */
4612118Sralph extern char	*RM;		/* remote machine name */
4717929Smiriam extern char	*RG;		/* restricted group */
4812118Sralph extern char	*RP;		/* remote printer name */
4912118Sralph extern char	*LO;		/* lock file name */
5012118Sralph extern char	*ST;		/* status file name */
5112118Sralph extern char	*SD;		/* spool directory */
5212118Sralph extern char	*AF;		/* accounting file */
5312118Sralph extern char	*LF;		/* log file for error messages */
5412118Sralph extern char	*OF;		/* name of output filter (created once) */
5512118Sralph extern char	*IF;		/* name of input filter (created per job) */
5612433Sralph extern char	*RF;		/* name of fortran text filter (per job) */
5712118Sralph extern char	*TF;		/* name of troff(1) filter (per job) */
5813235Sralph extern char	*NF;		/* name of ditroff(1) filter (per job) */
5912118Sralph extern char	*DF;		/* name of tex filter (per job) */
6012118Sralph extern char	*GF;		/* name of graph(1G) filter (per job) */
6112118Sralph extern char	*VF;		/* name of raster filter (per job) */
6212118Sralph extern char	*CF;		/* name of cifplot filter (per job) */
6312118Sralph extern char	*FF;		/* form feed string */
6412118Sralph extern char	*TR;		/* trailer string to be output when Q empties */
6513170Sralph extern short	SC;		/* suppress multiple copies */
6612118Sralph extern short	SF;		/* suppress FF on each print job */
6712118Sralph extern short	SH;		/* suppress header page */
6812118Sralph extern short	SB;		/* short banner instead of normal header */
6918127Sralph extern short	HL;		/* print header last */
7012118Sralph extern short	RW;		/* open LP for reading and writing */
7112118Sralph extern short	PW;		/* page width */
7212433Sralph extern short	PX;		/* page width in pixels */
7312433Sralph extern short	PY;		/* page length in pixels */
7412118Sralph extern short	PL;		/* page length */
7512118Sralph extern short	BR;		/* baud rate if lp is a tty */
7613170Sralph extern int	FC;		/* flags to clear if lp is a tty */
7713170Sralph extern int	FS;		/* flags to set if lp is a tty */
7813170Sralph extern int	XC;		/* flags to clear for local mode */
7913170Sralph extern int	XS;		/* flags to set for local mode */
8012433Sralph extern short	RS;		/* restricted to those with local accounts */
8112118Sralph 
8212118Sralph extern char	line[BUFSIZ];
8312118Sralph extern char	pbuf[];		/* buffer for printcap entry */
8412118Sralph extern char	*bp;		/* pointer into ebuf for pgetent() */
8512118Sralph extern char	*name;		/* program name */
8612118Sralph extern char	*printer;	/* printer name */
8712118Sralph extern char	host[32];	/* host machine name */
8812118Sralph extern char	*from;		/* client's machine name */
89*38736Stef extern int	sendtorem;	/* are we sending to a remote? */
9012118Sralph extern int	errno;
9112118Sralph 
9212118Sralph /*
9312118Sralph  * Structure used for building a sorted list of control files.
9412118Sralph  */
9512118Sralph struct queue {
9612118Sralph 	time_t	q_time;			/* modification time */
9712118Sralph 	char	q_name[MAXNAMLEN+1];	/* control file name */
9812118Sralph };
9912118Sralph 
10012118Sralph char	*pgetstr();
10112118Sralph char	*malloc();
10212118Sralph char	*getenv();
10312118Sralph char	*index();
10412118Sralph char	*rindex();
105*38736Stef char	*checkremote();
106