xref: /csrg-svn/libexec/bugfiler/bug.h (revision 31916)
130160Sbostic /*
230160Sbostic  * Copyright (c) 1986 Regents of the University of California.
330160Sbostic  * All rights reserved.  The Berkeley software License Agreement
430160Sbostic  * specifies the terms and conditions for redistribution.
530160Sbostic  *
630160Sbostic  *	@(#)bug.h	1.1 (Berkeley) 11/25/86
730160Sbostic  */
830160Sbostic 
930160Sbostic #define BUGS_HOME	"owner-bugs@ucbvax.BERKELEY.EDU"
1030160Sbostic #define BUGS_ID		"bugs"
1130160Sbostic #define MAIL_CMD	"/usr/lib/sendmail -i -t -F \"Bugs Bunny\" -f owner-bugs@ucbvax.BERKELEY.EDU"
1230160Sbostic 
1330160Sbostic /*
1430160Sbostic  * the METOO definition has the bugfiler exit with an error (-1) status
15*31916Sbostic  * if there's a problem.  This causes sendmail to send off a copy of the
16*31916Sbostic  * report (as failed mail) to the "owner" of the mail alias that executed
17*31916Sbostic  * the bugfiler.  This is great if you would have otherwise lost the bug
18*31916Sbostic  * report.  It's not so great if you get a whole bunch of mail that you
19*31916Sbostic  * really don't want.
2030160Sbostic  */
2130160Sbostic #define METOO
2230160Sbostic 
2330160Sbostic /* files */
2430894Sbostic #define ACK_FILE	"bug:ack"		/* acknowledge file */
2530894Sbostic #define DIST_FILE	"bug:redist"		/* redistribution file */
2630160Sbostic #define ERROR_FILE	"log"			/* error file */
2730160Sbostic #define LOCK_FILE	"bug:lock"		/* lock file name */
2830160Sbostic #define SUMMARY_FILE	"summary"		/* summary file */
2930160Sbostic #define TMP_BUG		"errors/BUG_XXXXXX"	/* tmp bug report */
30*31916Sbostic #define TMP_DIR		"errors"		/* tmp directory */
3130160Sbostic 
3230160Sbostic #define CHN		(char *)NULL	/* null arg string */
3330160Sbostic #define COMMENT		'#'		/* comment in redist file */
3430160Sbostic #define EOS		(char)NULL	/* end of string */
3530160Sbostic #define ERR		-1		/* error return */
3630160Sbostic #define MAXLINELEN	200		/* max line length in message */
3730160Sbostic #define NO		0		/* no/false */
3830160Sbostic #define OK		0		/* okay return */
3930160Sbostic #define YES		1		/* yes/true */
4030160Sbostic 
4130160Sbostic typedef struct {
4230160Sbostic 	short	found,			/* line number if found */
4330160Sbostic 		redist;			/* if part of redist headers */
4430160Sbostic 	int	(*valid)();		/* validation routine */
4530160Sbostic 	short	len;			/* length of tag */
4630160Sbostic 	char	*tag,			/* leading tag */
4730160Sbostic 		*line;			/* actual line */
4830160Sbostic } HEADER;
4930894Sbostic extern HEADER	mailhead[];
5030160Sbostic 
5130160Sbostic #define DATE_TAG	0		/* "Date:" offset */
5230160Sbostic #define FROM_TAG	1		/* "From " offset */
5330160Sbostic #define CFROM_TAG	2		/* "From:" offset */
5430160Sbostic #define INDX_TAG	3		/* "Index:" offset */
5530160Sbostic #define MSG_TAG		4		/* "Message-Id:" offset */
5630160Sbostic #define RPLY_TAG	5		/* "Reply-To:" offset */
5730160Sbostic #define RET_TAG		6		/* "Return-Path:" offset */
5830160Sbostic #define SUBJ_TAG	7		/* "Subject:" offset */
5930160Sbostic #define TO_TAG		8		/* "To:" offset */
6030160Sbostic 
6130160Sbostic /* so sizeof doesn't return 0 */
6230160Sbostic #include <sys/param.h>
6330894Sbostic #include <sys/dir.h>
6430894Sbostic extern char	bfr[MAXBSIZE],			/* general I/O buffer */
6530894Sbostic 		dir[MAXNAMLEN],			/* subject and folder */
6630894Sbostic 		folder[MAXNAMLEN],
6730894Sbostic 		tmpname[sizeof(TMP_BUG) + 5];	/* temp bug file */
68