lp.h revision 1.19 1 /* $NetBSD: lp.h,v 1.19 2005/11/28 03:26:06 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 const char *AF; /* accounting file */
40 extern long BR; /* baud rate if lp is a tty */
41 extern const char *CF; /* name of cifplot filter (per job) */
42 extern const 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 const char *FF; /* form feed string */
46 extern long FS; /* flags to set if lp is a tty */
47 extern const char *GF; /* name of graph(1G) filter (per job) */
48 extern long HL; /* print header last */
49 extern const char *IF; /* name of input filter (created per job) */
50 extern const char *LF; /* log file for error messages */
51 extern const char *LO; /* lock file name */
52 extern const char *LP; /* line printer device name */
53 extern long MC; /* maximum number of copies allowed */
54 extern const char *MS; /* stty flags to set if lp is a tty */
55 extern long MX; /* maximum number of blocks to copy */
56 extern const char *NF; /* name of ditroff(1) filter (per job) */
57 extern const 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 const char *RF; /* name of fortran text filter (per job) */
63 extern const char *RG; /* restricted group */
64 extern const char *RM; /* remote machine name */
65 extern const 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 const char *SD; /* spool directory */
71 extern long SF; /* suppress FF on each print job */
72 extern long SH; /* suppress header page */
73 extern const char *ST; /* status file name */
74 extern const char *TF; /* name of troff(1) filter (per job) */
75 extern const char *TR; /* trailer string to be output when Q empties */
76 extern const 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 const char *printer; /* printer name */
83 /* host machine name */
84 extern char host[MAXHOSTNAMELEN + 1];
85 extern char *from; /* client's machine name */
86 extern int remote; /* true if sending files to a remote host */
87 extern const char *printcapdb[];/* printcap database array */
88 extern int wait_time; /* time to wait for remote responses */
89 /*
90 * Structure used for building a sorted list of control files.
91 */
92 struct queue {
93 time_t q_time; /* modification time */
94 char q_name[MAXNAMLEN+1]; /* control file name */
95 };
96
97 #include <sys/cdefs.h>
98
99 __BEGIN_DECLS
100 struct dirent;
101
102 void blankfill(int);
103 const char *checkremote(void);
104 int chk(const char *);
105 void displayq(int);
106 void dump(const char *, const char *, int);
107 void fatal(const char *, ...)
108 __attribute__((__format__(__printf__, 1, 2)));
109 int getline(FILE *);
110 int getport(const char *, int);
111 int getq(struct queue *(*[]));
112 void header(void);
113 void inform(const char *);
114 int inlist(const char *, const char *);
115 int iscf(const struct dirent *);
116 int isowner(const char *, const char *);
117 void ldump(const char *, const char *, int);
118 int lockchk(const char *);
119 void prank(int);
120 void process(const char *);
121 void rmjob(void);
122 void rmremote(void);
123 void show(const char *, const char *, int);
124 int startdaemon(const char *);
125 void nodaemon(void);
126 void delay(int);
127 void getprintcap(const char *);
128 int ckqueue(char *);
129 __END_DECLS
130