1 | /* |
---|
2 | * $Id: lp.h,v 1.17 1999-01-22 23:10:37 ghudson Exp $ |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * Copyright (c) 1983 Regents of the University of California. |
---|
7 | * All rights reserved. The Berkeley software License Agreement |
---|
8 | * specifies the terms and conditions for redistribution. |
---|
9 | * |
---|
10 | * @(#)lp.h 5.1 (Berkeley) 6/6/85 |
---|
11 | */ |
---|
12 | |
---|
13 | /* |
---|
14 | * Global definitions for the line printer system. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifdef POSIX |
---|
18 | #include <unistd.h> |
---|
19 | #endif |
---|
20 | #include <stdio.h> |
---|
21 | #include <sys/param.h> |
---|
22 | #include <sys/types.h> |
---|
23 | #include <sys/file.h> |
---|
24 | #include <fcntl.h> |
---|
25 | #ifdef POSIX |
---|
26 | #include <dirent.h> |
---|
27 | #else |
---|
28 | #include <sys/dir.h> |
---|
29 | #endif |
---|
30 | #include <sys/stat.h> |
---|
31 | #include <sys/socket.h> |
---|
32 | #include <sys/un.h> |
---|
33 | #include <netinet/in.h> |
---|
34 | #include <netdb.h> |
---|
35 | #include <pwd.h> |
---|
36 | #include <syslog.h> |
---|
37 | #include <signal.h> |
---|
38 | #ifdef _AIX |
---|
39 | #undef _BSD |
---|
40 | #endif |
---|
41 | #include <sys/wait.h> |
---|
42 | #ifdef _AIX |
---|
43 | #define _BSD 44 |
---|
44 | #include <sys/ioctl.h> |
---|
45 | #endif |
---|
46 | #ifdef POSIX |
---|
47 | #include <termios.h> |
---|
48 | #else |
---|
49 | #include <sgtty.h> |
---|
50 | #endif |
---|
51 | #include <ctype.h> |
---|
52 | #include <errno.h> |
---|
53 | #include <string.h> |
---|
54 | #include "lp.local.h" |
---|
55 | |
---|
56 | |
---|
57 | |
---|
58 | #ifdef KERBEROS |
---|
59 | #include <krb.h> |
---|
60 | #define KLPR_SERVICE "rcmd" |
---|
61 | #endif /* KERBEROS */ |
---|
62 | |
---|
63 | extern int DU; /* daeomon user-id */ |
---|
64 | extern int MX; /* maximum number of blocks to copy */ |
---|
65 | extern int MC; /* maximum number of copies allowed */ |
---|
66 | extern char *LP; /* line printer device name */ |
---|
67 | extern char *RM; /* remote machine name */ |
---|
68 | extern char *RG; /* restricted group */ |
---|
69 | extern char *RP; /* remote printer name */ |
---|
70 | extern char *LO; /* lock file name */ |
---|
71 | extern char *ST; /* status file name */ |
---|
72 | extern char *SD; /* spool directory */ |
---|
73 | extern char *AF; /* accounting file */ |
---|
74 | extern char *LF; /* log file for error messages */ |
---|
75 | extern char *OF; /* name of output filter (created once) */ |
---|
76 | extern char *IF; /* name of input filter (created per job) */ |
---|
77 | extern char *RF; /* name of fortran text filter (per job) */ |
---|
78 | extern char *TF; /* name of troff(1) filter (per job) */ |
---|
79 | extern char *NF; /* name of ditroff(1) filter (per job) */ |
---|
80 | extern char *DF; /* name of tex filter (per job) */ |
---|
81 | extern char *GF; /* name of graph(1G) filter (per job) */ |
---|
82 | extern char *VF; /* name of raster filter (per job) */ |
---|
83 | extern char *CF; /* name of cifplot filter (per job) */ |
---|
84 | extern char *FF; /* form feed string */ |
---|
85 | extern char *TR; /* trailer string to be output when Q empties */ |
---|
86 | extern char *MS; /* list of tty modes to set or clear */ |
---|
87 | extern short SC; /* suppress multiple copies */ |
---|
88 | extern short SF; /* suppress FF on each print job */ |
---|
89 | extern short SH; /* suppress header page */ |
---|
90 | extern short SB; /* short banner instead of normal header */ |
---|
91 | extern short HL; /* print header last */ |
---|
92 | extern short RW; /* open LP for reading and writing */ |
---|
93 | extern short PW; /* page width */ |
---|
94 | extern short PX; /* page width in pixels */ |
---|
95 | extern short PY; /* page length in pixels */ |
---|
96 | extern short PL; /* page length */ |
---|
97 | extern short BR; /* baud rate if lp is a tty */ |
---|
98 | extern int FC; /* flags to clear if lp is a tty */ |
---|
99 | extern int FS; /* flags to set if lp is a tty */ |
---|
100 | extern int XC; /* flags to clear for local mode */ |
---|
101 | extern int XS; /* flags to set for local mode */ |
---|
102 | extern short RS; /* restricted to those with local accounts */ |
---|
103 | #ifdef PQUOTA |
---|
104 | extern char *RQ; /* Name of remote quota server */ |
---|
105 | extern int CP; /* Cost per page */ |
---|
106 | extern char *QS; /* Quota service for printer */ |
---|
107 | #endif /* PQUOTA */ |
---|
108 | #ifdef LACL |
---|
109 | extern char *AC; /* Local ACL file to use */ |
---|
110 | extern short PA; /* ACL file used as positive ACL */ |
---|
111 | extern short RA; /* Restricted host access */ |
---|
112 | #endif /* LACL */ |
---|
113 | |
---|
114 | extern char line[BUFSIZ]; |
---|
115 | extern char pbuf[]; /* buffer for printcap entry */ |
---|
116 | extern char *bp; /* pointer into ebuf for pgetent() */ |
---|
117 | extern char *name; /* program name */ |
---|
118 | extern char *printer; /* printer name */ |
---|
119 | extern char host[MAXHOSTNAMELEN + 1]; /* host machine name */ |
---|
120 | extern char *from; /* client's machine name */ |
---|
121 | extern int errno; |
---|
122 | #ifdef HESIOD |
---|
123 | extern char alibuf[BUFSIZ/2]; /* buffer for printer alias */ |
---|
124 | #endif |
---|
125 | |
---|
126 | #ifdef KERBEROS |
---|
127 | extern int use_kerberos; |
---|
128 | extern int kerberos_cf; |
---|
129 | extern char kprincipal[]; |
---|
130 | extern char kinstance[]; |
---|
131 | extern char krealm[]; |
---|
132 | #endif /* KERBEROS */ |
---|
133 | |
---|
134 | /* |
---|
135 | * Structure used for building a sorted list of control files. |
---|
136 | */ |
---|
137 | struct queue_ { |
---|
138 | time_t q_time; /* modification time */ |
---|
139 | char q_name[MAXNAMLEN+1]; /* control file name */ |
---|
140 | }; |
---|
141 | |
---|
142 | char *pgetstr(); |
---|
143 | #ifdef vax |
---|
144 | char *malloc(); |
---|
145 | #endif |
---|
146 | char *getenv(); |
---|
147 | |
---|
148 | |
---|
149 | #define UNLINK unlink |
---|
150 | #ifdef PQUOTA |
---|
151 | #define QUOTA_QUERY_VERSION '1' |
---|
152 | #endif |
---|