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