112118Sralph /* 222441Sdist * Copyright (c) 1983 Regents of the University of California. 3*34203Sbostic * All rights reserved. 422441Sdist * 5*34203Sbostic * Redistribution and use in source and binary forms are permitted 6*34203Sbostic * provided that this notice is preserved and that due credit is given 7*34203Sbostic * to the University of California at Berkeley. The name of the University 8*34203Sbostic * may not be used to endorse or promote products derived from this 9*34203Sbostic * software without specific prior written permission. This software 10*34203Sbostic * is provided ``as is'' without express or implied warranty. 11*34203Sbostic * 12*34203Sbostic * @(#)lp.h 5.2 (Berkeley) 05/05/88 1322441Sdist */ 1422441Sdist 1522441Sdist /* 1612118Sralph * Global definitions for the line printer system. 1712118Sralph */ 1812118Sralph 1912118Sralph #include <stdio.h> 2016756Sralph #include <sys/param.h> 2112118Sralph #include <sys/file.h> 2212118Sralph #include <sys/dir.h> 2312118Sralph #include <sys/stat.h> 2412118Sralph #include <sys/socket.h> 2513441Sralph #include <sys/un.h> 2612118Sralph #include <netinet/in.h> 2712118Sralph #include <netdb.h> 2812118Sralph #include <pwd.h> 2916756Sralph #include <syslog.h> 3012118Sralph #include <signal.h> 3113585Swnj #include <sys/wait.h> 3212118Sralph #include <sgtty.h> 3312118Sralph #include <ctype.h> 3412118Sralph #include <errno.h> 3512118Sralph #include "lp.local.h" 3612118Sralph 3712118Sralph extern int DU; /* daeomon user-id */ 3812118Sralph extern int MX; /* maximum number of blocks to copy */ 3913170Sralph extern int MC; /* maximum number of copies allowed */ 4012118Sralph extern char *LP; /* line printer device name */ 4112118Sralph extern char *RM; /* remote machine name */ 4217929Smiriam extern char *RG; /* restricted group */ 4312118Sralph extern char *RP; /* remote printer name */ 4412118Sralph extern char *LO; /* lock file name */ 4512118Sralph extern char *ST; /* status file name */ 4612118Sralph extern char *SD; /* spool directory */ 4712118Sralph extern char *AF; /* accounting file */ 4812118Sralph extern char *LF; /* log file for error messages */ 4912118Sralph extern char *OF; /* name of output filter (created once) */ 5012118Sralph extern char *IF; /* name of input filter (created per job) */ 5112433Sralph extern char *RF; /* name of fortran text filter (per job) */ 5212118Sralph extern char *TF; /* name of troff(1) filter (per job) */ 5313235Sralph extern char *NF; /* name of ditroff(1) filter (per job) */ 5412118Sralph extern char *DF; /* name of tex filter (per job) */ 5512118Sralph extern char *GF; /* name of graph(1G) filter (per job) */ 5612118Sralph extern char *VF; /* name of raster filter (per job) */ 5712118Sralph extern char *CF; /* name of cifplot filter (per job) */ 5812118Sralph extern char *FF; /* form feed string */ 5912118Sralph extern char *TR; /* trailer string to be output when Q empties */ 6013170Sralph extern short SC; /* suppress multiple copies */ 6112118Sralph extern short SF; /* suppress FF on each print job */ 6212118Sralph extern short SH; /* suppress header page */ 6312118Sralph extern short SB; /* short banner instead of normal header */ 6418127Sralph extern short HL; /* print header last */ 6512118Sralph extern short RW; /* open LP for reading and writing */ 6612118Sralph extern short PW; /* page width */ 6712433Sralph extern short PX; /* page width in pixels */ 6812433Sralph extern short PY; /* page length in pixels */ 6912118Sralph extern short PL; /* page length */ 7012118Sralph extern short BR; /* baud rate if lp is a tty */ 7113170Sralph extern int FC; /* flags to clear if lp is a tty */ 7213170Sralph extern int FS; /* flags to set if lp is a tty */ 7313170Sralph extern int XC; /* flags to clear for local mode */ 7413170Sralph extern int XS; /* flags to set for local mode */ 7512433Sralph extern short RS; /* restricted to those with local accounts */ 7612118Sralph 7712118Sralph extern char line[BUFSIZ]; 7812118Sralph extern char pbuf[]; /* buffer for printcap entry */ 7912118Sralph extern char *bp; /* pointer into ebuf for pgetent() */ 8012118Sralph extern char *name; /* program name */ 8112118Sralph extern char *printer; /* printer name */ 8212118Sralph extern char host[32]; /* host machine name */ 8312118Sralph extern char *from; /* client's machine name */ 8412118Sralph extern int errno; 8512118Sralph 8612118Sralph /* 8712118Sralph * Structure used for building a sorted list of control files. 8812118Sralph */ 8912118Sralph struct queue { 9012118Sralph time_t q_time; /* modification time */ 9112118Sralph char q_name[MAXNAMLEN+1]; /* control file name */ 9212118Sralph }; 9312118Sralph 9412118Sralph char *pgetstr(); 9512118Sralph char *malloc(); 9612118Sralph char *getenv(); 9712118Sralph char *index(); 9812118Sralph char *rindex(); 99