xref: /openbsd/usr.bin/mail/glob.h (revision 7eb34045)
1*7eb34045Sderaadt /*	$OpenBSD: glob.h,v 1.2 1996/06/11 12:53:41 deraadt Exp $	*/
2*7eb34045Sderaadt /*	$NetBSD: glob.h,v 1.4 1996/06/08 19:48:25 christos Exp $	*/
3*7eb34045Sderaadt 
4df930be7Sderaadt /*
5df930be7Sderaadt  * Copyright (c) 1980, 1993
6df930be7Sderaadt  *	The Regents of the University of California.  All rights reserved.
7df930be7Sderaadt  *
8df930be7Sderaadt  * Redistribution and use in source and binary forms, with or without
9df930be7Sderaadt  * modification, are permitted provided that the following conditions
10df930be7Sderaadt  * are met:
11df930be7Sderaadt  * 1. Redistributions of source code must retain the above copyright
12df930be7Sderaadt  *    notice, this list of conditions and the following disclaimer.
13df930be7Sderaadt  * 2. Redistributions in binary form must reproduce the above copyright
14df930be7Sderaadt  *    notice, this list of conditions and the following disclaimer in the
15df930be7Sderaadt  *    documentation and/or other materials provided with the distribution.
16df930be7Sderaadt  * 3. All advertising materials mentioning features or use of this software
17df930be7Sderaadt  *    must display the following acknowledgement:
18df930be7Sderaadt  *	This product includes software developed by the University of
19df930be7Sderaadt  *	California, Berkeley and its contributors.
20df930be7Sderaadt  * 4. Neither the name of the University nor the names of its contributors
21df930be7Sderaadt  *    may be used to endorse or promote products derived from this software
22df930be7Sderaadt  *    without specific prior written permission.
23df930be7Sderaadt  *
24df930be7Sderaadt  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25df930be7Sderaadt  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26df930be7Sderaadt  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27df930be7Sderaadt  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28df930be7Sderaadt  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29df930be7Sderaadt  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30df930be7Sderaadt  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31df930be7Sderaadt  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32df930be7Sderaadt  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33df930be7Sderaadt  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34df930be7Sderaadt  * SUCH DAMAGE.
35df930be7Sderaadt  *
36df930be7Sderaadt  *	from: @(#)glob.h	8.1 (Berkeley) 6/6/93
37*7eb34045Sderaadt  *	$NetBSD: glob.h,v 1.4 1996/06/08 19:48:25 christos Exp $
38df930be7Sderaadt  */
39df930be7Sderaadt 
40df930be7Sderaadt /*
41df930be7Sderaadt  * A bunch of global variable declarations lie herein.
42df930be7Sderaadt  * def.h must be included first.
43df930be7Sderaadt  */
44df930be7Sderaadt 
45df930be7Sderaadt int	msgCount;			/* Count of messages read in */
46df930be7Sderaadt int	rcvmode;			/* True if receiving mail */
47df930be7Sderaadt int	sawcom;				/* Set after first command */
48df930be7Sderaadt char	*Tflag;				/* -T temp file for netnews */
49df930be7Sderaadt int	senderr;			/* An error while checking */
50df930be7Sderaadt int	edit;				/* Indicates editing a file */
51df930be7Sderaadt int	readonly;			/* Will be unable to rewrite file */
52df930be7Sderaadt int	noreset;			/* String resets suspended */
53df930be7Sderaadt int	sourcing;			/* Currently reading variant file */
54df930be7Sderaadt int	loading;			/* Loading user definitions */
55df930be7Sderaadt int	cond;				/* Current state of conditional exc. */
56df930be7Sderaadt FILE	*itf;				/* Input temp file buffer */
57df930be7Sderaadt FILE	*otf;				/* Output temp file buffer */
58df930be7Sderaadt int	image;				/* File descriptor for image of msg */
59df930be7Sderaadt FILE	*input;				/* Current command input file */
60df930be7Sderaadt char	mailname[PATHSIZE];		/* Name of current file */
61df930be7Sderaadt char	prevfile[PATHSIZE];		/* Name of previous file */
62df930be7Sderaadt char	*homedir;			/* Path name of home directory */
63df930be7Sderaadt char	*myname;			/* My login name */
64df930be7Sderaadt off_t	mailsize;			/* Size of system mailbox */
65df930be7Sderaadt int	lexnumber;			/* Number of TNUMBER from scan() */
66df930be7Sderaadt char	lexstring[STRINGLEN];		/* String from TSTRING, scan() */
67df930be7Sderaadt int	regretp;			/* Pointer to TOS of regret tokens */
68df930be7Sderaadt int	regretstack[REGDEP];		/* Stack of regretted tokens */
69df930be7Sderaadt char	*string_stack[REGDEP];		/* Stack of regretted strings */
70df930be7Sderaadt int	numberstack[REGDEP];		/* Stack of regretted numbers */
71df930be7Sderaadt struct	message	*dot;			/* Pointer to current message */
72df930be7Sderaadt struct	message	*message;		/* The actual message structure */
73df930be7Sderaadt struct	var	*variables[HSHSIZE];	/* Pointer to active var list */
74df930be7Sderaadt struct	grouphead	*groups[HSHSIZE];/* Pointer to active groups */
75df930be7Sderaadt struct	ignoretab	ignore[2];	/* ignored and retained fields
76df930be7Sderaadt 					   0 is ignore, 1 is retain */
77df930be7Sderaadt struct	ignoretab	saveignore[2];	/* ignored and retained fields
78df930be7Sderaadt 					   on save to folder */
79df930be7Sderaadt struct	ignoretab	ignoreall[2];	/* special, ignore all headers */
80df930be7Sderaadt char	**altnames;			/* List of alternate names for user */
81df930be7Sderaadt int	debug;				/* Debug flag set */
82df930be7Sderaadt int	screenwidth;			/* Screen width, or best guess */
83df930be7Sderaadt int	screenheight;			/* Screen height, or best guess,
84df930be7Sderaadt 					   for "header" command */
85df930be7Sderaadt int	realscreenheight;		/* the real screen height */
86df930be7Sderaadt 
87df930be7Sderaadt #include <setjmp.h>
88df930be7Sderaadt 
89df930be7Sderaadt jmp_buf	srbuf;
90df930be7Sderaadt 
91df930be7Sderaadt 
92df930be7Sderaadt /*
93df930be7Sderaadt  * The pointers for the string allocation routines,
94df930be7Sderaadt  * there are NSPACE independent areas.
95df930be7Sderaadt  * The first holds STRINGSIZE bytes, the next
96df930be7Sderaadt  * twice as much, and so on.
97df930be7Sderaadt  */
98df930be7Sderaadt 
99df930be7Sderaadt #define	NSPACE	25			/* Total number of string spaces */
100df930be7Sderaadt struct strings {
101df930be7Sderaadt 	char	*s_topFree;		/* Beginning of this area */
102df930be7Sderaadt 	char	*s_nextFree;		/* Next alloctable place here */
103df930be7Sderaadt 	unsigned s_nleft;		/* Number of bytes left here */
104df930be7Sderaadt } stringdope[NSPACE];
105