lp.h revision 1.18 1 /* $NetBSD: lp.h,v 1.18 2004/04/24 02:59:19 christos Exp $ */
2
3 /*
4 * Copyright (c) 1983, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * @(#)lp.h 8.2 (Berkeley) 4/28/95
32 */
33
34
35 /*
36 * Global definitions for the line printer system.
37 */
38
39 extern char *AF; /* accounting file */
40 extern long BR; /* baud rate if lp is a tty */
41 extern char *CF; /* name of cifplot filter (per job) */
42 extern char *DF; /* name of tex filter (per job) */
43 extern long DU; /* daemon user-id */
44 extern long FC; /* flags to clear if lp is a tty */
45 extern char *FF; /* form feed string */
46 extern long FS; /* flags to set if lp is a tty */
47 extern char *GF; /* name of graph(1G) filter (per job) */
48 extern long HL; /* print header last */
49 extern char *IF; /* name of input filter (created per job) */
50 extern char *LF; /* log file for error messages */
51 extern char *LO; /* lock file name */
52 extern char *LP; /* line printer device name */
53 extern long MC; /* maximum number of copies allowed */
54 extern char *MS; /* stty flags to set if lp is a tty */
55 extern long MX; /* maximum number of blocks to copy */
56 extern char *NF; /* name of ditroff(1) filter (per job) */
57 extern char *OF; /* name of output filter (created once) */
58 extern long PL; /* page length */
59 extern long PW; /* page width */
60 extern long PX; /* page width in pixels */
61 extern long PY; /* page length in pixels */
62 extern char *RF; /* name of fortran text filter (per job) */
63 extern char *RG; /* restricted group */
64 extern char *RM; /* remote machine name */
65 extern char *RP; /* remote printer name */
66 extern long RS; /* restricted to those with local accounts */
67 extern long RW; /* open LP for reading and writing */
68 extern long SB; /* short banner instead of normal header */
69 extern long SC; /* suppress multiple copies */
70 extern char *SD; /* spool directory */
71 extern long SF; /* suppress FF on each print job */
72 extern long SH; /* suppress header page */
73 extern char *ST; /* status file name */
74 extern char *TF; /* name of troff(1) filter (per job) */
75 extern char *TR; /* trailer string to be output when Q empties */
76 extern char *VF; /* name of raster filter (per job) */
77 extern long XC; /* flags to clear for local mode */
78 extern long XS; /* flags to set for local mode */
79
80 extern char line[BUFSIZ];
81 extern char *bp; /* pointer into printcap buffer */
82 extern char *name; /* program name */
83 extern char *printer; /* printer name */
84 /* host machine name */
85 extern char host[MAXHOSTNAMELEN + 1];
86 extern char *from; /* client's machine name */
87 extern int remote; /* true if sending files to a remote host */
88 extern const char *printcapdb[];/* printcap database array */
89 extern int wait_time; /* time to wait for remote responses */
90 /*
91 * Structure used for building a sorted list of control files.
92 */
93 struct queue {
94 time_t q_time; /* modification time */
95 char q_name[MAXNAMLEN+1]; /* control file name */
96 };
97
98 #include <sys/cdefs.h>
99
100 __BEGIN_DECLS
101 struct dirent;
102
103 void blankfill(int);
104 char *checkremote(void);
105 int chk(char *);
106 void displayq(int);
107 void dump(char *, char *, int);
108 void fatal(const char *, ...)
109 __attribute__((__format__(__printf__, 1, 2)));
110 int getline(FILE *);
111 int getport(char *, int);
112 int getq(struct queue *(*[]));
113 void header(void);
114 void inform(char *);
115 int inlist(char *, char *);
116 int iscf(const struct dirent *);
117 int isowner(char *, char *);
118 void ldump(char *, char *, int);
119 int lockchk(char *);
120 void prank(int);
121 void process(char *);
122 void rmjob(void);
123 void rmremote(void);
124 void show(char *, char *, int);
125 int startdaemon(char *);
126 void nodaemon(void);
127 void delay(int);
128 __END_DECLS
129