1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License as
4 * published by the Free Software Foundation; either version 2 of
5 * the License, or (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15 * MA 02111-1307 USA
16 */
17/***************************************************************************
18 * LPRng - An Extended Print Spooler System
19 *
20 * Copyright 1988-2003, Patrick Powell, San Diego, CA
21 *     papowell@lprng.com
22 * See LICENSE for conditions of use.
23 * $Id: lpd.h,v 1.1.1.1 2008/10/15 03:28:27 james26_jang Exp $
24 ***************************************************************************/
25
26
27
28#ifndef _LPD_H_
29#define _LPD_H_ 1
30
31
32/*
33 * file_info - information in log file
34 */
35
36struct file_info {
37	int fd;
38	int max_size;	/* maximum file size */
39	char *outbuffer;	/* for writing */
40	int outmax;	/* max buffer size */
41	char *inbuffer;		/* buffer for IO */
42	int  inmax;	/* buffer size */
43	int start;			/* starting offset */
44	int count;			/* total size of info */
45};
46
47union val{
48	int v;
49	char s[sizeof(int)];
50};
51
52EXTERN int Foreground_LPD;
53EXTERN char *Worker_LPD;
54EXTERN char *Logfile_LPD;
55EXTERN volatile int Reread_config;
56EXTERN int Started_server;
57
58/* PROTOTYPES */
59int main(int argc, char *argv[], char *envp[]);
60void Setup_log(char *logfile );
61void Reinit(void);
62int Get_lpd_pid(void);
63void Set_lpd_pid(int lockfd);
64int Lock_lpd_pid(void);
65int Read_server_status( int fd );
66void usage(void);
67void Get_parms(int argc, char *argv[] );
68int Start_all( int first_scan, int *start_fd );
69plp_signal_t sigchld_handler (int signo);
70void Setup_waitpid (void);
71void Setup_waitpid_break (void);
72void Fork_error( int last_fork_pid_value );
73
74#endif
75