lp.h revision 1.1.1.1 1 /*
2 * Copyright (c) 1983 Regents of the University of California.
3 * 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 5.5 (Berkeley) 6/1/90
34 */
35
36 /*
37 * Global definitions for the line printer system.
38 */
39
40 #include <stdio.h>
41 #include <sys/param.h>
42 #include <sys/file.h>
43 #include <sys/dir.h>
44 #include <sys/stat.h>
45 #include <sys/socket.h>
46 #include <sys/un.h>
47 #include <netinet/in.h>
48 #include <netdb.h>
49 #include <pwd.h>
50 #include <syslog.h>
51 #include <signal.h>
52 #include <sys/wait.h>
53 #include <sgtty.h>
54 #include <ctype.h>
55 #include <errno.h>
56 #include "lp.local.h"
57
58 extern int DU; /* daeomon user-id */
59 extern int MX; /* maximum number of blocks to copy */
60 extern int MC; /* maximum number of copies allowed */
61 extern char *LP; /* line printer device name */
62 extern char *RM; /* remote machine name */
63 extern char *RG; /* restricted group */
64 extern char *RP; /* remote printer name */
65 extern char *LO; /* lock file name */
66 extern char *ST; /* status file name */
67 extern char *SD; /* spool directory */
68 extern char *AF; /* accounting file */
69 extern char *LF; /* log file for error messages */
70 extern char *OF; /* name of output filter (created once) */
71 extern char *IF; /* name of input filter (created per job) */
72 extern char *RF; /* name of fortran text filter (per job) */
73 extern char *TF; /* name of troff(1) filter (per job) */
74 extern char *NF; /* name of ditroff(1) filter (per job) */
75 extern char *DF; /* name of tex filter (per job) */
76 extern char *GF; /* name of graph(1G) filter (per job) */
77 extern char *VF; /* name of raster filter (per job) */
78 extern char *CF; /* name of cifplot filter (per job) */
79 extern char *FF; /* form feed string */
80 extern char *TR; /* trailer string to be output when Q empties */
81 extern short SC; /* suppress multiple copies */
82 extern short SF; /* suppress FF on each print job */
83 extern short SH; /* suppress header page */
84 extern short SB; /* short banner instead of normal header */
85 extern short HL; /* print header last */
86 extern short RW; /* open LP for reading and writing */
87 extern short PW; /* page width */
88 extern short PX; /* page width in pixels */
89 extern short PY; /* page length in pixels */
90 extern short PL; /* page length */
91 extern short BR; /* baud rate if lp is a tty */
92 extern int FC; /* flags to clear if lp is a tty */
93 extern int FS; /* flags to set if lp is a tty */
94 extern int XC; /* flags to clear for local mode */
95 extern int XS; /* flags to set for local mode */
96 extern short RS; /* restricted to those with local accounts */
97
98 extern char line[BUFSIZ];
99 extern char pbuf[]; /* buffer for printcap entry */
100 extern char *bp; /* pointer into ebuf for pgetent() */
101 extern char *name; /* program name */
102 extern char *printer; /* printer name */
103 extern char host[32]; /* host machine name */
104 extern char *from; /* client's machine name */
105 extern int sendtorem; /* are we sending to a remote? */
106 extern int errno;
107
108 /*
109 * Structure used for building a sorted list of control files.
110 */
111 struct queue {
112 time_t q_time; /* modification time */
113 char q_name[MAXNAMLEN+1]; /* control file name */
114 };
115
116 char *pgetstr();
117 char *malloc();
118 char *getenv();
119 char *index();
120 char *rindex();
121 char *checkremote();
122