cmd1.c: expand() may fail
[s-mailx.git] / glob.h
blobc8ec2b39f5aa18e05ee337c56d8b85d647821a8b
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 char **smopts; /* sendmail(1) options, command line */
73 _E size_t smopts_count; /* Entries in smopts */
74 _E char const *const uagent; /* User agent */
75 _E char const *const version; /* The version string */
76 _E off_t mailsize; /* Size of system mailbox */
77 _E struct message *dot; /* Pointer to current message */
78 _E struct message *prevdot; /* Previous current message */
79 _E struct message *message; /* The actual message structure */
80 _E struct message *threadroot; /* first threaded message */
81 _E int msgspace; /* Number of allocated struct m */
82 _E struct var *variables[HSHSIZE]; /* Pointer to active var list */
83 _E struct grouphead *groups[HSHSIZE]; /* Pointer to active groups */
84 _E struct ignoretab ignore[2]; /* ignored and retained fields
85 0 is ignore, 1 is retain */
86 _E struct ignoretab saveignore[2]; /* ignored and retained fields
87 on save to folder */
88 _E struct ignoretab allignore[2]; /* special, ignore all headers */
89 _E struct ignoretab fwdignore[2]; /* fields to ignore for forwarding */
90 _E char **altnames; /* List of alternate names for user */
91 _E int debug; /* Debug flag set */
92 _E int scrnwidth; /* Screen width, or best guess */
93 _E int scrnheight; /* Screen height, or best guess,
94 for "header" command */
95 _E int realscreenheight; /* the real screen height */
96 _E gid_t effectivegid; /* Saved from when we started up */
97 _E gid_t realgid; /* Saved from when we started up */
98 _E int exit_status; /* Exit status */
99 _E int is_a_tty[2]; /* isatty(0), isatty(1) */
100 _E int did_print_dot; /* current message has been printed */
101 _E int tildeflag; /* enable tilde escapes */
102 _E char *uflag; /* name given with -u option */
103 _E struct shortcut *shortcuts; /* list of shortcuts */
104 _E int mb_cur_max; /* value of MB_CUR_MAX */
105 _E int imap_created_mailbox; /* hack to get feedback from imap */
106 _E int unset_allow_undefined; /* allow to unset undefined variables */
107 _E int inhook; /* currently executing a hook */
108 _E int starting; /* still in startup code */
109 _E char *wantcharset; /* overrides the "charset" variable */
110 _E int utf8; /* UTF-8 encoding in use for locale */
111 _E int Rflag; /* open all folders read-only */
113 #ifdef USE_SSL
114 _E enum ssl_vrfy_level ssl_vrfy_level; /* SSL verification level */
115 #endif
117 #ifdef HAVE_ICONV
118 _E iconv_t iconvd;
119 #endif
121 #ifdef HAVE_CATGETS
122 _E nl_catd catd;
123 #endif
126 * These are initialized strings.
128 extern char *us_ascii; /* "us-ascii" */
129 extern const char *month_names[];
131 #include <setjmp.h>
133 _E sigjmp_buf srbuf;
134 _E int interrupts;
135 _E sighandler_type handlerstacktop;
136 #define handlerpush(f) (savedtop = handlerstacktop, handlerstacktop = (f))
137 #define handlerpop() (handlerstacktop = savedtop)
138 extern sighandler_type dflpipe;
141 * The pointers for the string allocation routines,
142 * there are NSPACE independent areas.
143 * The first holds STRINGSIZE bytes, the next
144 * twice as much, and so on.
147 #define NSPACE 25 /* Total number of string spaces */
148 _E struct strings {
149 char *s_topFree; /* Beginning of this area */
150 char *s_nextFree; /* Next alloctable place here */
151 unsigned s_nleft; /* Number of bytes left here */
152 } stringdope[NSPACE];
154 #undef _E