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