main.c: set -S twice! And about command line processing..
[s-mailx.git] / glob.h
blob993029653f1d9aa9774bd6501019174896cf87c0
1 /*
2 * S-nail - a mail user agent derived from Berkeley Mail.
4 * Copyright (c) 2000-2004 Gunnar Ritter, Freiburg i. Br., Germany.
5 * Copyright (c) 2012 Steffen "Daode" Nurpmeso.
6 */
7 /*
8 * Copyright (c) 1980, 1993
9 * The Regents of the University of California. All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
41 * A bunch of global variable declarations lie herein.
42 * def.h must be included first.
45 #if defined(_MAIL_GLOBS_)
46 # undef _E
47 # define _E
48 #else
49 # define _E extern
50 #endif
52 _E int msgCount; /* Count of messages read in */
53 _E int rcvmode; /* True if receiving mail */
54 _E int sawcom; /* Set after first command */
55 _E int Iflag; /* -I show Newsgroups: field */
56 _E char *Tflag; /* -T temp file for netnews */
57 _E int senderr; /* An error while checking */
58 _E int edit; /* Indicates editing a file */
59 _E int noreset; /* String resets suspended */
60 _E int sourcing; /* Currently reading variant file */
61 _E int loading; /* Loading user definitions */
62 _E enum condition cond; /* Current state of conditional exc. */
63 _E struct mailbox mb; /* Current mailbox */
64 _E int image; /* File descriptor for image of msg */
65 _E FILE *input; /* Current command input file */
66 _E char mailname[PATHSIZE]; /* Name of current file */
67 _E char mboxname[PATHSIZE]; /* Name of mbox */
68 _E char prevfile[PATHSIZE]; /* Name of previous file */
69 _E char *homedir; /* Path name of home directory */
70 _E char *progname; /* our name */
71 _E char *myname; /* My login name */
72 _E const char *const uagent; /* User agent */
73 _E const char *const version; /* The version string */
74 _E off_t mailsize; /* Size of system mailbox */
75 _E struct message *dot; /* Pointer to current message */
76 _E struct message *prevdot; /* Previous current message */
77 _E struct message *message; /* The actual message structure */
78 _E struct message *threadroot; /* first threaded message */
79 _E int msgspace; /* Number of allocated struct m */
80 _E struct var *variables[HSHSIZE]; /* Pointer to active var list */
81 _E struct grouphead *groups[HSHSIZE]; /* Pointer to active groups */
82 _E struct ignoretab ignore[2]; /* ignored and retained fields
83 0 is ignore, 1 is retain */
84 _E struct ignoretab saveignore[2]; /* ignored and retained fields
85 on save to folder */
86 _E struct ignoretab allignore[2]; /* special, ignore all headers */
87 _E struct ignoretab fwdignore[2]; /* fields to ignore for forwarding */
88 _E char **altnames; /* List of alternate names for user */
89 _E int debug; /* Debug flag set */
90 _E int scrnwidth; /* Screen width, or best guess */
91 _E int scrnheight; /* Screen height, or best guess,
92 for "header" command */
93 _E int realscreenheight; /* the real screen height */
94 _E gid_t effectivegid; /* Saved from when we started up */
95 _E gid_t realgid; /* Saved from when we started up */
96 _E int exit_status; /* Exit status */
97 _E int is_a_tty[2]; /* isatty(0), isatty(1) */
98 _E int did_print_dot; /* current message has been printed */
99 _E int tildeflag; /* enable tilde escapes */
100 _E char *uflag; /* name given with -u option */
101 _E struct shortcut *shortcuts; /* list of shortcuts */
102 _E int mb_cur_max; /* value of MB_CUR_MAX */
103 _E int imap_created_mailbox; /* hack to get feedback from imap */
104 _E int unset_allow_undefined; /* allow to unset undefined variables */
105 _E int inhook; /* currently executing a hook */
106 _E int starting; /* still in startup code */
107 _E char *wantcharset; /* overrides the "charset" variable */
108 _E int utf8; /* UTF-8 encoding in use for locale */
109 _E int Rflag; /* open all folders read-only */
111 #ifdef USE_SSL
112 _E enum ssl_vrfy_level ssl_vrfy_level; /* SSL verification level */
113 #endif
115 #ifdef HAVE_ICONV
116 _E iconv_t iconvd;
117 #endif
119 #ifdef HAVE_CATGETS
120 _E nl_catd catd;
121 #endif
124 * These are initialized strings.
126 extern char *us_ascii; /* "us-ascii" */
127 extern const char *month_names[];
129 #include <setjmp.h>
131 _E sigjmp_buf srbuf;
132 _E int interrupts;
133 _E sighandler_type handlerstacktop;
134 #define handlerpush(f) (savedtop = handlerstacktop, handlerstacktop = (f))
135 #define handlerpop() (handlerstacktop = savedtop)
136 extern sighandler_type dflpipe;
139 * The pointers for the string allocation routines,
140 * there are NSPACE independent areas.
141 * The first holds STRINGSIZE bytes, the next
142 * twice as much, and so on.
145 #define NSPACE 25 /* Total number of string spaces */
146 _E struct strings {
147 char *s_topFree; /* Beginning of this area */
148 char *s_nextFree; /* Next alloctable place here */
149 unsigned s_nleft; /* Number of bytes left here */
150 } stringdope[NSPACE];
152 #undef _E