Commit | Line | Data |
---|---|---|
d0aeaf5a DF |
1 | /* |
2 | * Copyright (c) 1983 Regents of the University of California. | |
9d85c861 | 3 | * All rights reserved. |
d0aeaf5a | 4 | * |
9d85c861 | 5 | * Redistribution and use in source and binary forms are permitted |
a399f6c8 KB |
6 | * provided that the above copyright notice and this paragraph are |
7 | * duplicated in all such forms and that any documentation, | |
8 | * advertising materials, and other materials related to such | |
9 | * distribution and use acknowledge that the software was developed | |
10 | * by the University of California, Berkeley. The name of the | |
11 | * University may not be used to endorse or promote products derived | |
12 | * from this software without specific prior written permission. | |
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
9d85c861 | 16 | * |
a399f6c8 | 17 | * @(#)lp.h 5.3 (Berkeley) %G% |
d0aeaf5a DF |
18 | */ |
19 | ||
809f6548 RC |
20 | /* |
21 | * Global definitions for the line printer system. | |
22 | */ | |
23 | ||
24 | #include <stdio.h> | |
51673d52 | 25 | #include <sys/param.h> |
809f6548 RC |
26 | #include <sys/file.h> |
27 | #include <sys/dir.h> | |
28 | #include <sys/stat.h> | |
29 | #include <sys/socket.h> | |
8fed920b | 30 | #include <sys/un.h> |
809f6548 RC |
31 | #include <netinet/in.h> |
32 | #include <netdb.h> | |
33 | #include <pwd.h> | |
51673d52 | 34 | #include <syslog.h> |
809f6548 | 35 | #include <signal.h> |
25db97f6 | 36 | #include <sys/wait.h> |
809f6548 RC |
37 | #include <sgtty.h> |
38 | #include <ctype.h> | |
39 | #include <errno.h> | |
40 | #include "lp.local.h" | |
41 | ||
42 | extern int DU; /* daeomon user-id */ | |
43 | extern int MX; /* maximum number of blocks to copy */ | |
c6d1c018 | 44 | extern int MC; /* maximum number of copies allowed */ |
809f6548 RC |
45 | extern char *LP; /* line printer device name */ |
46 | extern char *RM; /* remote machine name */ | |
6e4bbe1d | 47 | extern char *RG; /* restricted group */ |
809f6548 RC |
48 | extern char *RP; /* remote printer name */ |
49 | extern char *LO; /* lock file name */ | |
50 | extern char *ST; /* status file name */ | |
51 | extern char *SD; /* spool directory */ | |
52 | extern char *AF; /* accounting file */ | |
53 | extern char *LF; /* log file for error messages */ | |
54 | extern char *OF; /* name of output filter (created once) */ | |
55 | extern char *IF; /* name of input filter (created per job) */ | |
4d4caa50 | 56 | extern char *RF; /* name of fortran text filter (per job) */ |
809f6548 | 57 | extern char *TF; /* name of troff(1) filter (per job) */ |
a4f59913 | 58 | extern char *NF; /* name of ditroff(1) filter (per job) */ |
809f6548 RC |
59 | extern char *DF; /* name of tex filter (per job) */ |
60 | extern char *GF; /* name of graph(1G) filter (per job) */ | |
61 | extern char *VF; /* name of raster filter (per job) */ | |
62 | extern char *CF; /* name of cifplot filter (per job) */ | |
63 | extern char *FF; /* form feed string */ | |
64 | extern char *TR; /* trailer string to be output when Q empties */ | |
c6d1c018 | 65 | extern short SC; /* suppress multiple copies */ |
809f6548 RC |
66 | extern short SF; /* suppress FF on each print job */ |
67 | extern short SH; /* suppress header page */ | |
68 | extern short SB; /* short banner instead of normal header */ | |
1e7998ee | 69 | extern short HL; /* print header last */ |
809f6548 RC |
70 | extern short RW; /* open LP for reading and writing */ |
71 | extern short PW; /* page width */ | |
4d4caa50 RC |
72 | extern short PX; /* page width in pixels */ |
73 | extern short PY; /* page length in pixels */ | |
809f6548 RC |
74 | extern short PL; /* page length */ |
75 | extern short BR; /* baud rate if lp is a tty */ | |
c6d1c018 RC |
76 | extern int FC; /* flags to clear if lp is a tty */ |
77 | extern int FS; /* flags to set if lp is a tty */ | |
78 | extern int XC; /* flags to clear for local mode */ | |
79 | extern int XS; /* flags to set for local mode */ | |
4d4caa50 | 80 | extern short RS; /* restricted to those with local accounts */ |
809f6548 RC |
81 | |
82 | extern char line[BUFSIZ]; | |
83 | extern char pbuf[]; /* buffer for printcap entry */ | |
84 | extern char *bp; /* pointer into ebuf for pgetent() */ | |
85 | extern char *name; /* program name */ | |
86 | extern char *printer; /* printer name */ | |
87 | extern char host[32]; /* host machine name */ | |
88 | extern char *from; /* client's machine name */ | |
89 | extern int errno; | |
90 | ||
91 | /* | |
92 | * Structure used for building a sorted list of control files. | |
93 | */ | |
94 | struct queue { | |
95 | time_t q_time; /* modification time */ | |
96 | char q_name[MAXNAMLEN+1]; /* control file name */ | |
97 | }; | |
98 | ||
99 | char *pgetstr(); | |
100 | char *malloc(); | |
101 | char *getenv(); | |
102 | char *index(); | |
103 | char *rindex(); |