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