xref: /netbsd-src/usr.sbin/lpr/common_source/lp.h (revision 257a846ab490a529012453f79230bc6acc1130fb)
1*257a846aSjoerg /*	$NetBSD: lp.h,v 1.25 2011/08/30 19:27:37 joerg Exp $	*/
221908ddbSjtc 
361f28255Scgd /*
42847add2Scgd  * Copyright (c) 1983, 1993
52847add2Scgd  *	The Regents of the University of California.  All rights reserved.
661f28255Scgd  *
761f28255Scgd  * Redistribution and use in source and binary forms, with or without
861f28255Scgd  * modification, are permitted provided that the following conditions
961f28255Scgd  * are met:
1061f28255Scgd  * 1. Redistributions of source code must retain the above copyright
1161f28255Scgd  *    notice, this list of conditions and the following disclaimer.
1261f28255Scgd  * 2. Redistributions in binary form must reproduce the above copyright
1361f28255Scgd  *    notice, this list of conditions and the following disclaimer in the
1461f28255Scgd  *    documentation and/or other materials provided with the distribution.
15326b2259Sagc  * 3. Neither the name of the University nor the names of its contributors
1661f28255Scgd  *    may be used to endorse or promote products derived from this software
1761f28255Scgd  *    without specific prior written permission.
1861f28255Scgd  *
1961f28255Scgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2061f28255Scgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2161f28255Scgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2261f28255Scgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2361f28255Scgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2461f28255Scgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2561f28255Scgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2661f28255Scgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2761f28255Scgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2861f28255Scgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2961f28255Scgd  * SUCH DAMAGE.
3061f28255Scgd  *
31e6a91a09Smrg  * 	@(#)lp.h	8.2 (Berkeley) 4/28/95
3261f28255Scgd  */
3361f28255Scgd 
342847add2Scgd 
3561f28255Scgd /*
3661f28255Scgd  * Global definitions for the line printer system.
3761f28255Scgd  */
3861f28255Scgd 
3904723c3fSchristos extern const char	*AF;	/* accounting file */
402847add2Scgd extern long		 BR;	/* baud rate if lp is a tty */
4104723c3fSchristos extern const char	*CF;	/* name of cifplot filter (per job) */
4204723c3fSchristos extern const char	*DF;	/* name of tex filter (per job) */
43764d9a9dSmikel extern long		 DU;	/* daemon user-id */
442847add2Scgd extern long		 FC;	/* flags to clear if lp is a tty */
4504723c3fSchristos extern const char	*FF;	/* form feed string */
462847add2Scgd extern long		 FS;	/* flags to set if lp is a tty */
4704723c3fSchristos extern const char	*GF;	/* name of graph(1G) filter (per job) */
482847add2Scgd extern long		 HL;	/* print header last */
4904723c3fSchristos extern const char	*IF;	/* name of input filter (created per job) */
5004723c3fSchristos extern const char	*LF;	/* log file for error messages */
5104723c3fSchristos extern const char	*LO;	/* lock file name */
5204723c3fSchristos extern const char	*LP;	/* line printer device name */
532847add2Scgd extern long		 MC;	/* maximum number of copies allowed */
5404723c3fSchristos extern const char	*MS;	/* stty flags to set if lp is a tty */
552847add2Scgd extern long		 MX;	/* maximum number of blocks to copy */
5604723c3fSchristos extern const char	*NF;	/* name of ditroff(1) filter (per job) */
5704723c3fSchristos extern const char	*OF;	/* name of output filter (created once) */
58fae257a0Sgarbled extern const char	*PF;	/* name of postscript filter (per job) */
592847add2Scgd extern long		 PL;	/* page length */
602847add2Scgd extern long		 PW;	/* page width */
612847add2Scgd extern long		 PX;	/* page width in pixels */
622847add2Scgd extern long		 PY;	/* page length in pixels */
6304723c3fSchristos extern const char	*RF;	/* name of fortran text filter (per job) */
6404723c3fSchristos extern const char	*RG;	/* restricted group */
6504723c3fSchristos extern const char	*RM;	/* remote machine name */
6604723c3fSchristos extern const char	*RP;	/* remote printer name */
672847add2Scgd extern long		 RS;	/* restricted to those with local accounts */
682847add2Scgd extern long		 RW;	/* open LP for reading and writing */
692847add2Scgd extern long		 SB;	/* short banner instead of normal header */
702847add2Scgd extern long		 SC;	/* suppress multiple copies */
7104723c3fSchristos extern const char	*SD;	/* spool directory */
722847add2Scgd extern long		 SF;	/* suppress FF on each print job */
732847add2Scgd extern long		 SH;	/* suppress header page */
7404723c3fSchristos extern const char	*ST;	/* status file name */
7504723c3fSchristos extern const char	*TF;	/* name of troff(1) filter (per job) */
7604723c3fSchristos extern const char	*TR;	/* trailer string to be output when Q empties */
7704723c3fSchristos extern const char	*VF;	/* name of raster filter (per job) */
782847add2Scgd extern long		 XC;	/* flags to clear for local mode */
792847add2Scgd extern long		 XS;	/* flags to set for local mode */
8061f28255Scgd 
8161f28255Scgd extern char	line[BUFSIZ];
822847add2Scgd extern char	*bp;		/* pointer into printcap buffer */
8304723c3fSchristos extern const char *printer;	/* printer name */
842847add2Scgd 				/* host machine name */
85c0aa4ce5Smrg extern char	host[MAXHOSTNAMELEN + 1];
8661f28255Scgd extern char	*from;		/* client's machine name */
87e6a91a09Smrg extern int	remote;		/* true if sending files to a remote host */
8870229c52Schristos extern const char *printcapdb[];/* printcap database array */
895b6d0e7eSmrg extern int	wait_time;	/* time to wait for remote responses */
9061f28255Scgd /*
9161f28255Scgd  * Structure used for building a sorted list of control files.
9261f28255Scgd  */
9361f28255Scgd struct queue {
9461f28255Scgd 	time_t	q_time;			/* modification time */
9561f28255Scgd 	char	q_name[MAXNAMLEN+1];	/* control file name */
9661f28255Scgd };
9761f28255Scgd 
982847add2Scgd #include <sys/cdefs.h>
992847add2Scgd 
1002847add2Scgd __BEGIN_DECLS
1012847add2Scgd struct dirent;
1022847add2Scgd 
103895dc72aSwiz void     blankfill(int);
10404723c3fSchristos const char *checkremote(void);
10504723c3fSchristos int      chk(const char *);
106895dc72aSwiz void     displayq(int);
10704723c3fSchristos void     dump(const char *, const char *, int);
108*257a846aSjoerg void	 fatal(const char *, ...) __dead __printflike(1, 2);
1097027866aSroy size_t	 get_line(FILE *);
110c6813048Schristos const char *gethost(const char *);
111c6813048Schristos int	 getport(const char *);
112895dc72aSwiz int	 getq(struct queue *(*[]));
1134a6e5a62Schristos void	 freeq(struct queue **, u_int);
114895dc72aSwiz void     header(void);
11504723c3fSchristos void     inform(const char *);
11604723c3fSchristos int      inlist(const char *, const char *);
117895dc72aSwiz int      iscf(const struct dirent *);
11804723c3fSchristos int      isowner(const char *, const char *);
11904723c3fSchristos void     ldump(const char *, const char *, int);
12004723c3fSchristos int      lockchk(const char *);
121895dc72aSwiz void     prank(int);
12204723c3fSchristos void     process(const char *);
123*257a846aSjoerg void     rmjob(void) __dead;
124895dc72aSwiz void     rmremote(void);
12504723c3fSchristos void     show(const char *, const char *, int);
12604723c3fSchristos int      startdaemon(const char *);
127895dc72aSwiz void     nodaemon(void);
128895dc72aSwiz void     delay(int);
12904723c3fSchristos void	 getprintcap(const char *);
13004723c3fSchristos int	 ckqueue(char *);
1312847add2Scgd __END_DECLS
132