1 /***************************************************************************
2  * LPRng - An Extended Print Spooler System
3  *
4  * Copyright 1988-2003, Patrick Powell, San Diego, CA
5  *     papowell@lprng.com
6  * See LICENSE for conditions of use.
7  ***************************************************************************/
8 
9 
10 
11 #ifndef _LPD_H_
12 #define _LPD_H_ 1
13 
14 
15 /*
16  * file_info - information in log file
17  */
18 
19 struct file_info {
20 	int fd;
21 	int max_size;	/* maximum file size */
22 	char *outbuffer;	/* for writing */
23 	int outmax;	/* max buffer size */
24 	char *inbuffer;		/* buffer for IO */
25 	int  inmax;	/* buffer size */
26 	int start;			/* starting offset */
27 	int count;			/* total size of info */
28 };
29 
30 union val{
31 	int v;
32 	char s[sizeof(int)];
33 };
34 
35 EXTERN int Foreground_LPD;
36 EXTERN char *Worker_LPD;
37 EXTERN char *Logfile_LPD;
38 EXTERN volatile int Reread_config;
39 EXTERN int Started_server;
40 
41 /* PROTOTYPES */
42 int main(int argc, char *argv[], char *envp[]);
43 static void Setup_log(char *logfile );
44 static void Reinit(void);
45 static int Get_lpd_pid(void);
46 static void Set_lpd_pid(int lockfd);
47 static int Lock_lpd_pid(void);
48 static int Read_server_status( int fd );
49 static void usage(void);
50 static void Get_parms(int argc, char *argv[] );
51 static void Accept_connection( int sock );
52 static int Start_all( int first_scan, int *start_fd );
53 plp_signal_t sigchld_handler (int signo);
54 static void Setup_waitpid (void);
55 static void Setup_waitpid_break (void);
56 static void Fork_error( int last_fork_pid_value );
57 
58 #endif
59