11590Srgrimes/*
21590Srgrimes * Copyright (c) 1980, 1993
31590Srgrimes *	The Regents of the University of California.  All rights reserved.
41590Srgrimes *
51590Srgrimes * Redistribution and use in source and binary forms, with or without
61590Srgrimes * modification, are permitted provided that the following conditions
71590Srgrimes * are met:
81590Srgrimes * 1. Redistributions of source code must retain the above copyright
91590Srgrimes *    notice, this list of conditions and the following disclaimer.
101590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111590Srgrimes *    notice, this list of conditions and the following disclaimer in the
121590Srgrimes *    documentation and/or other materials provided with the distribution.
131590Srgrimes * 4. Neither the name of the University nor the names of its contributors
141590Srgrimes *    may be used to endorse or promote products derived from this software
151590Srgrimes *    without specific prior written permission.
161590Srgrimes *
171590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181590Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191590Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201590Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211590Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221590Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231590Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241590Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251590Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271590Srgrimes * SUCH DAMAGE.
281590Srgrimes *
291590Srgrimes *	@(#)glob.h	8.1 (Berkeley) 6/6/93
3074769Smikeh *
3174769Smikeh * $FreeBSD$
321590Srgrimes */
331590Srgrimes
341590Srgrimes/*
351590Srgrimes * A bunch of global variable declarations lie herein.
361590Srgrimes * def.h must be included first.
371590Srgrimes */
381590Srgrimes
391590Srgrimesint	msgCount;			/* Count of messages read in */
401590Srgrimesint	rcvmode;			/* True if receiving mail */
411590Srgrimesint	sawcom;				/* Set after first command */
421590Srgrimeschar	*Tflag;				/* -T temp file for netnews */
431590Srgrimesint	senderr;			/* An error while checking */
441590Srgrimesint	edit;				/* Indicates editing a file */
451590Srgrimesint	readonly;			/* Will be unable to rewrite file */
461590Srgrimesint	noreset;			/* String resets suspended */
471590Srgrimesint	sourcing;			/* Currently reading variant file */
481590Srgrimesint	loading;			/* Loading user definitions */
491590Srgrimesint	cond;				/* Current state of conditional exc. */
501590SrgrimesFILE	*itf;				/* Input temp file buffer */
511590SrgrimesFILE	*otf;				/* Output temp file buffer */
521590Srgrimesint	image;				/* File descriptor for image of msg */
531590SrgrimesFILE	*input;				/* Current command input file */
541590Srgrimeschar	mailname[PATHSIZE];		/* Name of current file */
551590Srgrimeschar	prevfile[PATHSIZE];		/* Name of previous file */
561590Srgrimeschar	*homedir;			/* Path name of home directory */
571590Srgrimeschar	*myname;			/* My login name */
581590Srgrimesoff_t	mailsize;			/* Size of system mailbox */
591590Srgrimesint	lexnumber;			/* Number of TNUMBER from scan() */
601590Srgrimeschar	lexstring[STRINGLEN];		/* String from TSTRING, scan() */
611590Srgrimesint	regretp;			/* Pointer to TOS of regret tokens */
621590Srgrimesint	regretstack[REGDEP];		/* Stack of regretted tokens */
631590Srgrimeschar	*string_stack[REGDEP];		/* Stack of regretted strings */
641590Srgrimesint	numberstack[REGDEP];		/* Stack of regretted numbers */
651590Srgrimesstruct	message	*dot;			/* Pointer to current message */
661590Srgrimesstruct	message	*message;		/* The actual message structure */
671590Srgrimesstruct	var	*variables[HSHSIZE];	/* Pointer to active var list */
681590Srgrimesstruct	grouphead	*groups[HSHSIZE];/* Pointer to active groups */
691590Srgrimesstruct	ignoretab	ignore[2];	/* ignored and retained fields
701590Srgrimes					   0 is ignore, 1 is retain */
711590Srgrimesstruct	ignoretab	saveignore[2];	/* ignored and retained fields
721590Srgrimes					   on save to folder */
731590Srgrimesstruct	ignoretab	ignoreall[2];	/* special, ignore all headers */
741590Srgrimeschar	**altnames;			/* List of alternate names for user */
751590Srgrimesint	debug;				/* Debug flag set */
761590Srgrimesint	screenwidth;			/* Screen width, or best guess */
771590Srgrimesint	screenheight;			/* Screen height, or best guess,
781590Srgrimes					   for "header" command */
791590Srgrimesint	realscreenheight;		/* the real screen height */
801590Srgrimes
811590Srgrimes#include <setjmp.h>
821590Srgrimes
831590Srgrimesjmp_buf	srbuf;
841590Srgrimes
851590Srgrimes
861590Srgrimes/*
871590Srgrimes * The pointers for the string allocation routines,
881590Srgrimes * there are NSPACE independent areas.
891590Srgrimes * The first holds STRINGSIZE bytes, the next
901590Srgrimes * twice as much, and so on.
911590Srgrimes */
921590Srgrimes
931590Srgrimes#define	NSPACE	25			/* Total number of string spaces */
941590Srgrimesstruct strings {
951590Srgrimes	char	*s_topFree;		/* Beginning of this area */
961590Srgrimes	char	*s_nextFree;		/* Next alloctable place here */
971590Srgrimes	unsigned s_nleft;		/* Number of bytes left here */
981590Srgrimes} stringdope[NSPACE];
99