1 1.25 joerg /* $NetBSD: lp.h,v 1.25 2011/08/30 19:27:37 joerg 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.20 garbled extern const char *PF; /* name of postscript filter (per job) */ 59 1.19 christos extern long PL; /* page length */ 60 1.19 christos extern long PW; /* page width */ 61 1.19 christos extern long PX; /* page width in pixels */ 62 1.19 christos extern long PY; /* page length in pixels */ 63 1.19 christos extern const char *RF; /* name of fortran text filter (per job) */ 64 1.19 christos extern const char *RG; /* restricted group */ 65 1.19 christos extern const char *RM; /* remote machine name */ 66 1.19 christos extern const char *RP; /* remote printer name */ 67 1.19 christos extern long RS; /* restricted to those with local accounts */ 68 1.19 christos extern long RW; /* open LP for reading and writing */ 69 1.19 christos extern long SB; /* short banner instead of normal header */ 70 1.19 christos extern long SC; /* suppress multiple copies */ 71 1.19 christos extern const char *SD; /* spool directory */ 72 1.19 christos extern long SF; /* suppress FF on each print job */ 73 1.19 christos extern long SH; /* suppress header page */ 74 1.19 christos extern const char *ST; /* status file name */ 75 1.19 christos extern const char *TF; /* name of troff(1) filter (per job) */ 76 1.19 christos extern const char *TR; /* trailer string to be output when Q empties */ 77 1.19 christos extern const char *VF; /* name of raster filter (per job) */ 78 1.19 christos extern long XC; /* flags to clear for local mode */ 79 1.19 christos extern long XS; /* flags to set for local mode */ 80 1.1 cgd 81 1.1 cgd extern char line[BUFSIZ]; 82 1.5 cgd extern char *bp; /* pointer into printcap buffer */ 83 1.19 christos extern const char *printer; /* printer name */ 84 1.5 cgd /* host machine name */ 85 1.12 mrg extern char host[MAXHOSTNAMELEN + 1]; 86 1.1 cgd extern char *from; /* client's machine name */ 87 1.10 mrg extern int remote; /* true if sending files to a remote host */ 88 1.18 christos extern const char *printcapdb[];/* printcap database array */ 89 1.13 mrg extern int wait_time; /* time to wait for remote responses */ 90 1.1 cgd /* 91 1.1 cgd * Structure used for building a sorted list of control files. 92 1.1 cgd */ 93 1.1 cgd struct queue { 94 1.1 cgd time_t q_time; /* modification time */ 95 1.1 cgd char q_name[MAXNAMLEN+1]; /* control file name */ 96 1.1 cgd }; 97 1.1 cgd 98 1.5 cgd #include <sys/cdefs.h> 99 1.5 cgd 100 1.5 cgd __BEGIN_DECLS 101 1.5 cgd struct dirent; 102 1.5 cgd 103 1.16 wiz void blankfill(int); 104 1.19 christos const char *checkremote(void); 105 1.19 christos int chk(const char *); 106 1.16 wiz void displayq(int); 107 1.19 christos void dump(const char *, const char *, int); 108 1.25 joerg void fatal(const char *, ...) __dead __printflike(1, 2); 109 1.24 roy size_t get_line(FILE *); 110 1.21 christos const char *gethost(const char *); 111 1.21 christos int getport(const char *); 112 1.16 wiz int getq(struct queue *(*[])); 113 1.22 christos void freeq(struct queue **, u_int); 114 1.16 wiz void header(void); 115 1.19 christos void inform(const char *); 116 1.19 christos int inlist(const char *, const char *); 117 1.16 wiz int iscf(const struct dirent *); 118 1.19 christos int isowner(const char *, const char *); 119 1.19 christos void ldump(const char *, const char *, int); 120 1.19 christos int lockchk(const char *); 121 1.16 wiz void prank(int); 122 1.19 christos void process(const char *); 123 1.25 joerg void rmjob(void) __dead; 124 1.16 wiz void rmremote(void); 125 1.19 christos void show(const char *, const char *, int); 126 1.19 christos int startdaemon(const char *); 127 1.16 wiz void nodaemon(void); 128 1.16 wiz void delay(int); 129 1.19 christos void getprintcap(const char *); 130 1.19 christos int ckqueue(char *); 131 1.5 cgd __END_DECLS 132