xref: /original-bsd/usr.bin/mail/glob.h (revision 9692974f)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms are permitted
6  * provided that this notice is preserved and that due credit is given
7  * to the University of California at Berkeley. The name of the University
8  * may not be used to endorse or promote products derived from this
9  * software without specific prior written permission. This software
10  * is provided ``as is'' without express or implied warranty.
11  *
12  *	@(#)glob.h	5.8 (Berkeley) 06/17/88
13  */
14 
15 /*
16  * A bunch of global variable declarations lie herein.
17  * def.h must be included first.
18  */
19 
20 int	msgCount;			/* Count of messages read in */
21 int	mypid;				/* Current process id */
22 int	rcvmode;			/* True if receiving mail */
23 int	sawcom;				/* Set after first command */
24 int	hflag;				/* Sequence number for network -h */
25 char	*rflag;				/* -r address for network */
26 char	*Tflag;				/* -T temp file for netnews */
27 char	nosrc;				/* Don't source /usr/lib/Mail.rc */
28 int	selfsent;			/* User sent self something */
29 int	senderr;			/* An error while checking */
30 int	edit;				/* Indicates editing a file */
31 int	readonly;			/* Will be unable to rewrite file */
32 int	noreset;			/* String resets suspended */
33 int	sourcing;			/* Currently reading variant file */
34 int	loading;			/* Loading user definitions */
35 int	cond;				/* Current state of conditional exc. */
36 FILE	*itf;				/* Input temp file buffer */
37 FILE	*otf;				/* Output temp file buffer */
38 FILE	*pipef;				/* Pipe file we have opened */
39 int	image;				/* File descriptor for image of msg */
40 FILE	*input;				/* Current command input file */
41 char	*sflag;				/* Subject given from non tty */
42 char	mailname[PATHSIZE];		/* Name of current file */
43 char	prevfile[PATHSIZE];		/* Name of previous file */
44 int	uid;				/* The invoker's user id */
45 char	mailrc[PATHSIZE];		/* Name of startup file */
46 char	deadletter[PATHSIZE];		/* Name of #/dead.letter */
47 char	homedir[PATHSIZE];		/* Path name of home directory */
48 char	myname[PATHSIZE];		/* My login id */
49 off_t	mailsize;			/* Size of system mailbox */
50 int	lexnumber;			/* Number of TNUMBER from scan() */
51 char	lexstring[STRINGLEN];		/* String from TSTRING, scan() */
52 int	regretp;			/* Pointer to TOS of regret tokens */
53 int	regretstack[REGDEP];		/* Stack of regretted tokens */
54 char	*stringstack[REGDEP];		/* Stack of regretted strings */
55 int	numberstack[REGDEP];		/* Stack of regretted numbers */
56 struct	message	*dot;			/* Pointer to current message */
57 struct	message	*message;		/* The actual message structure */
58 struct	var	*variables[HSHSIZE];	/* Pointer to active var list */
59 struct	grouphead	*groups[HSHSIZE];/* Pointer to active groups */
60 struct	ignoretab	ignore[2];	/* ignored and retained fields
61 					   0 is ignore, 1 is retain */
62 struct	ignoretab	saveignore[2];	/* ignored and retained fields
63 					   on save to folder */
64 char	**altnames;			/* List of alternate names for user */
65 char	**localnames;			/* List of aliases for our local host */
66 int	debug;				/* Debug flag set */
67 int	rmail;				/* Being called as rmail */
68 int	screenwidth;			/* Screen width, or best guess */
69 int	screenheight;			/* Screen height, or best guess,
70 					   for "header" command */
71 int	realscreenheight;		/* the real screen height */
72 
73 #include <setjmp.h>
74 
75 jmp_buf	srbuf;
76 
77 
78 /*
79  * The pointers for the string allocation routines,
80  * there are NSPACE independent areas.
81  * The first holds STRINGSIZE bytes, the next
82  * twice as much, and so on.
83  */
84 
85 #define	NSPACE	25			/* Total number of string spaces */
86 struct strings {
87 	char	*s_topFree;		/* Beginning of this area */
88 	char	*s_nextFree;		/* Next alloctable place here */
89 	unsigned s_nleft;		/* Number of bytes left here */
90 } stringdope[NSPACE];
91