1235267Sgabor/*- 2235267Sgabor * SPDX-License-Identifier: BSD-3-Clause 3235267Sgabor * 4235267Sgabor * Copyright (c) 1980, 1993 5235267Sgabor * The Regents of the University of California. All rights reserved. 6235267Sgabor * 7235267Sgabor * Redistribution and use in source and binary forms, with or without 8235267Sgabor * modification, are permitted provided that the following conditions 9235267Sgabor * are met: 10235267Sgabor * 1. Redistributions of source code must retain the above copyright 11235267Sgabor * notice, this list of conditions and the following disclaimer. 12235267Sgabor * 2. Redistributions in binary form must reproduce the above copyright 13235267Sgabor * notice, this list of conditions and the following disclaimer in the 14235267Sgabor * documentation and/or other materials provided with the distribution. 15235267Sgabor * 3. Neither the name of the University nor the names of its contributors 16235267Sgabor * may be used to endorse or promote products derived from this software 17235267Sgabor * without specific prior written permission. 18235267Sgabor * 19235267Sgabor * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20235267Sgabor * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21235267Sgabor * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22235267Sgabor * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23235267Sgabor * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24235267Sgabor * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25235267Sgabor * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26235267Sgabor * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27235267Sgabor * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28235267Sgabor * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29235267Sgabor * SUCH DAMAGE. 30235267Sgabor */ 31235267Sgabor 32235267Sgabor/* 33235267Sgabor * A bunch of global variable declarations lie herein. 34235267Sgabor * def.h must be included first. 35235267Sgabor */ 36235267Sgabor 37235267Sgaborextern int msgCount; /* Count of messages read in */ 38235267Sgaborextern int rcvmode; /* True if receiving mail */ 39235267Sgaborextern int sawcom; /* Set after first command */ 40235267Sgaborextern char *Tflag; /* -T temp file for netnews */ 41235267Sgaborextern int senderr; /* An error while checking */ 42235267Sgaborextern int edit; /* Indicates editing a file */ 43235267Sgaborextern int readonly; /* Will be unable to rewrite file */ 44235267Sgaborextern int noreset; /* String resets suspended */ 45235267Sgaborextern int sourcing; /* Currently reading variant file */ 46235267Sgaborextern int loading; /* Loading user definitions */ 47235267Sgaborextern int cond; /* Current state of conditional exc. */ 48235267Sgaborextern FILE *itf; /* Input temp file buffer */ 49235267Sgaborextern FILE *otf; /* Output temp file buffer */ 50235267Sgaborextern int image; /* File descriptor for image of msg */ 51235267Sgaborextern FILE *input; /* Current command input file */ 52235267Sgaborextern char mailname[PATHSIZE]; /* Name of current file */ 53235267Sgaborextern char prevfile[PATHSIZE]; /* Name of previous file */ 54235267Sgaborextern char *homedir; /* Path name of home directory */ 55235267Sgaborextern char *myname; /* My login name */ 56235267Sgaborextern off_t mailsize; /* Size of system mailbox */ 57235267Sgaborextern int lexnumber; /* Number of TNUMBER from scan() */ 58235267Sgaborextern char lexstring[STRINGLEN]; /* String from TSTRING, scan() */ 59235267Sgaborextern int regretp; /* Pointer to TOS of regret tokens */ 60235267Sgaborextern int regretstack[REGDEP]; /* Stack of regretted tokens */ 61235267Sgaborextern char *string_stack[REGDEP]; /* Stack of regretted strings */ 62235267Sgaborextern int numberstack[REGDEP]; /* Stack of regretted numbers */ 63235267Sgaborextern struct message *dot; /* Pointer to current message */ 64235267Sgaborextern struct message *message; /* The actual message structure */ 65235267Sgaborextern struct var *variables[HSHSIZE]; /* Pointer to active var list */ 66235267Sgaborextern struct grouphead *groups[HSHSIZE];/* Pointer to active groups */ 67235267Sgaborextern struct ignoretab ignore[2]; /* ignored and retained fields 68235267Sgabor 0 is ignore, 1 is retain */ 69235267Sgaborextern struct ignoretab saveignore[2]; /* ignored and retained fields 70235267Sgabor on save to folder */ 71235267Sgaborextern struct ignoretab ignoreall[2]; /* special, ignore all headers */ 72235267Sgaborextern char **altnames; /* List of alternate names for user */ 73235267Sgaborextern int debug; /* Debug flag set */ 74235267Sgaborextern int screenwidth; /* Screen width, or best guess */ 75235267Sgaborextern int screenheight; /* Screen height, or best guess, 76235267Sgabor for "header" command */ 77235267Sgaborextern int realscreenheight; /* the real screen height */ 78235267Sgabor 79235267Sgabor#include <setjmp.h> 80235267Sgabor 81235267Sgaborextern jmp_buf srbuf; 82235267Sgabor 83235267Sgabor 84235267Sgabor/* 85235267Sgabor * The pointers for the string allocation routines, 86235267Sgabor * there are NSPACE independent areas. 87235267Sgabor * The first holds STRINGSIZE bytes, the next 88235267Sgabor * twice as much, and so on. 89235267Sgabor */ 90235267Sgabor 91235267Sgabor#define NSPACE 25 /* Total number of string spaces */ 92235267Sgaborextern struct strings { 93235267Sgabor char *s_topFree; /* Beginning of this area */ 94235267Sgabor char *s_nextFree; /* Next alloctable place here */ 95235267Sgabor unsigned s_nleft; /* Number of bytes left here */ 96235267Sgabor} stringdope[NSPACE]; 97235267Sgabor