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