xref: /freebsd/usr.sbin/lpr/common_source/lp.h (revision 02f2e93b60c2b91feac8f45c4c889a5a8e40d8a2)
1 /*
2  * Copyright (c) 1983, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *	This product includes software developed by the University of
16  *	California, Berkeley and its contributors.
17  * 4. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  * 	@(#)lp.h	8.2 (Berkeley) 4/28/95
34  */
35 
36 
37 /*
38  * Global definitions for the line printer system.
39  */
40 
41 extern char	*AF;		/* accounting file */
42 extern long	 BR;		/* baud rate if lp is a tty */
43 extern char	*CF;		/* name of cifplot filter (per job) */
44 extern long	 CT;		/* TCP connection timeout */
45 extern char	*DF;		/* name of tex filter (per job) */
46 extern long	 DU;		/* daeomon user-id */
47 extern char	*FF;		/* form feed string */
48 extern char	*GF;		/* name of graph(1G) filter (per job) */
49 extern long	 HL;		/* print header last */
50 extern char	*IF;		/* name of input filter (created per job) */
51 extern char	*LF;		/* log file for error messages */
52 extern char	*LO;		/* lock file name */
53 extern char	*LP;		/* line printer device name */
54 extern long	 MC;		/* maximum number of copies allowed */
55 extern long      MX;		/* maximum number of blocks to copy */
56 extern char	*NF;		/* name of ditroff(1) filter (per job) */
57 extern char	*OF;		/* name of output filter (created once) */
58 extern long	 PL;		/* page length */
59 extern long	 PW;		/* page width */
60 extern long	 PX;		/* page width in pixels */
61 extern long	 PY;		/* page length in pixels */
62 extern char	*RF;		/* name of fortran text filter (per job) */
63 extern char	*RG;		/* restricted group */
64 extern char	*RM;		/* remote machine name */
65 extern char	*RP;		/* remote printer name */
66 extern long	 RS;		/* restricted to those with local accounts */
67 extern long	 RW;		/* open LP for reading and writing */
68 extern long	 SB;		/* short banner instead of normal header */
69 extern long	 SC;		/* suppress multiple copies */
70 extern char	*SD;		/* spool directory */
71 extern long	 SF;		/* suppress FF on each print job */
72 extern long	 SH;		/* suppress header page */
73 extern char	*ST;		/* status file name */
74 extern char	*TF;		/* name of troff(1) filter (per job) */
75 extern char	*TR;		/* trailer string to be output when Q empties */
76 extern char	*MS;		/* mode set, a la stty */
77 extern char	*VF;		/* name of raster filter (per job) */
78 
79 extern char	line[BUFSIZ];
80 extern char	*bp;		/* pointer into printcap buffer */
81 extern char	*name;		/* program name */
82 extern char	*printer;	/* printer name */
83 				/* host machine name */
84 extern char	host[MAXHOSTNAMELEN];
85 extern char	*from;		/* client's machine name */
86 extern int	remote;		/* true if sending files to a remote host */
87 extern char	*printcapdb[];  /* printcap database array */
88 
89 extern int	requ[];		/* job number of spool entries */
90 extern int	requests;	/* # of spool requests */
91 extern char	*user[];        /* users to process */
92 extern int	users;		/* # of users in user array */
93 extern char	*person;	/* name of person doing lprm */
94 extern char	*name;
95 
96 
97 /*
98  * Structure used for building a sorted list of control files.
99  */
100 struct queue {
101 	time_t	q_time;			/* modification time */
102 	char	q_name[MAXNAMLEN+1];	/* control file name */
103 };
104 
105 #include <sys/cdefs.h>
106 
107 __BEGIN_DECLS
108 struct dirent;
109 
110 void     blankfill __P((int));
111 char	*checkremote __P((void));
112 int      chk __P((char *));
113 void     displayq __P((int));
114 void     dump __P((char *, char *, int));
115 void	 fatal __P((const char *, ...));
116 int	 getline __P((FILE *));
117 int	 getport __P((char *, int));
118 int	 getq __P((struct queue *(*[])));
119 void     header __P((void));
120 void     inform __P((char *));
121 int      inlist __P((char *, char *));
122 int      iscf __P((struct dirent *));
123 int      isowner __P((char *, char *));
124 void     ldump __P((char *, char *, int));
125 int      lockchk __P((char *));
126 void     prank __P((int));
127 void     process __P((char *));
128 void     rmjob __P((void));
129 void     rmremote __P((void));
130 void     show __P((char *, char *, int));
131 int      startdaemon __P((char *));
132 void     delay __P((int));
133 __END_DECLS
134