Home | History | Annotate | Line # | Download | only in common_source
      1 /*	$NetBSD: lp.h,v 1.25 2011/08/30 19:27:37 joerg 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 const char	*PF;	/* name of postscript filter (per job) */
     59 extern long		 PL;	/* page length */
     60 extern long		 PW;	/* page width */
     61 extern long		 PX;	/* page width in pixels */
     62 extern long		 PY;	/* page length in pixels */
     63 extern const char	*RF;	/* name of fortran text filter (per job) */
     64 extern const char	*RG;	/* restricted group */
     65 extern const char	*RM;	/* remote machine name */
     66 extern const char	*RP;	/* remote printer name */
     67 extern long		 RS;	/* restricted to those with local accounts */
     68 extern long		 RW;	/* open LP for reading and writing */
     69 extern long		 SB;	/* short banner instead of normal header */
     70 extern long		 SC;	/* suppress multiple copies */
     71 extern const char	*SD;	/* spool directory */
     72 extern long		 SF;	/* suppress FF on each print job */
     73 extern long		 SH;	/* suppress header page */
     74 extern const char	*ST;	/* status file name */
     75 extern const char	*TF;	/* name of troff(1) filter (per job) */
     76 extern const char	*TR;	/* trailer string to be output when Q empties */
     77 extern const char	*VF;	/* name of raster filter (per job) */
     78 extern long		 XC;	/* flags to clear for local mode */
     79 extern long		 XS;	/* flags to set for local mode */
     80 
     81 extern char	line[BUFSIZ];
     82 extern char	*bp;		/* pointer into printcap buffer */
     83 extern const 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 const char *checkremote(void);
    105 int      chk(const char *);
    106 void     displayq(int);
    107 void     dump(const char *, const char *, int);
    108 void	 fatal(const char *, ...) __dead __printflike(1, 2);
    109 size_t	 get_line(FILE *);
    110 const char *gethost(const char *);
    111 int	 getport(const char *);
    112 int	 getq(struct queue *(*[]));
    113 void	 freeq(struct queue **, u_int);
    114 void     header(void);
    115 void     inform(const char *);
    116 int      inlist(const char *, const char *);
    117 int      iscf(const struct dirent *);
    118 int      isowner(const char *, const char *);
    119 void     ldump(const char *, const char *, int);
    120 int      lockchk(const char *);
    121 void     prank(int);
    122 void     process(const char *);
    123 void     rmjob(void) __dead;
    124 void     rmremote(void);
    125 void     show(const char *, const char *, int);
    126 int      startdaemon(const char *);
    127 void     nodaemon(void);
    128 void     delay(int);
    129 void	 getprintcap(const char *);
    130 int	 ckqueue(char *);
    131 __END_DECLS
    132