DEFINE_SWITCH_ARRAY(FOLDER, switches);
#undef X
-static int fshort = 0; /* output only folder names */
+static bool fshort; /* output only folder names */
static int fcreat = 0; /* should we ask to create new folders? */
-static int fpack = 0; /* are we packing the folder? */
-static int fverb = 0; /* print actions taken while packing folder */
+static bool fpack; /* are we packing the folder? */
+static bool fverb; /* print actions taken while packing folder */
static int fheader = 0; /* should we output a header? */
-static int frecurse = 0; /* recurse through subfolders */
+static bool frecurse; /* recurse through subfolders */
static int ftotal = 0; /* should we output the totals? */
static bool all; /* should we output all folders */
continue;
case FASTSW:
- fshort++;
+ fshort = true;
continue;
case NFASTSW:
- fshort = 0;
+ fshort = false;
continue;
case HDRSW:
continue;
case PACKSW:
- fpack++;
+ fpack = true;
continue;
case NPACKSW:
- fpack = 0;
+ fpack = false;
continue;
case VERBSW:
- fverb++;
+ fverb = true;
continue;
case NVERBSW:
- fverb = 0;
+ fverb = false;
continue;
case RECURSW:
- frecurse++;
+ frecurse = true;
continue;
case NRECRSW:
- frecurse = 0;
+ frecurse = false;
continue;
case TOTALSW:
int
main (int argc, char **argv)
{
- int anot = 0, inplace = 1, mime = 0;
+ bool anot = false;
+ bool inplace = true;
+ bool mime = false;
int issue = 0, volume = 0, dashstuff = 0;
- int nedit = 0, nwhat = 0, i, in;
+ bool nedit = false;
+ bool nwhat = false;
+ int i, in;
int out, isdf = 0, msgnum = 0;
int outputlinelen = OUTPUTLINELEN;
int dat[5];
char **argp, **arguments;
struct stat st;
struct msgs_array msgs = { 0, 0, NULL };
- int buildsw = 0;
+ bool buildsw = false;
if (nmh_init(argv[0], true, true)) { return 1; }
done (0);
case ANNOSW:
- anot++;
+ anot = true;
continue;
case NANNOSW:
- anot = 0;
+ anot = false;
continue;
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
die("missing argument to %s", argp[-2]);
- nedit = 0;
+ nedit = false;
continue;
case NEDITSW:
- nedit++;
+ nedit = true;
continue;
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
die("missing argument to %s", argp[-2]);
- nwhat = 0;
+ nwhat = false;
continue;
case BILDSW:
- buildsw++;
+ buildsw = true;
/* FALLTHRU */
case NWHATSW:
- nwhat++;
+ nwhat = true;
continue;
case FILESW:
if (!(cp = *argp++) || *cp == '-')
die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
- mime = 0;
+ mime = false;
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
continue;
case INPLSW:
- inplace++;
+ inplace = true;
continue;
case NINPLSW:
- inplace = 0;
+ inplace = false;
continue;
case MIMESW:
- mime++;
+ mime = true;
filter = NULL;
continue;
case NMIMESW:
- mime = 0;
+ mime = false;
continue;
case DGSTSW:
if (!(cp = *argp++) || *cp == '-')
die("missing argument to %s", argp[-2]);
digest = mh_xstrdup(cp);
- mime = 0;
+ mime = false;
continue;
case ISSUESW:
if (!(cp = *argp++) || *cp == '-')
/*
* Forwarding a file.
*/
- anot = 0; /* don't want to annotate a file */
+ anot = false; /* don't want to annotate a file */
} else {
/*
* Forwarding a message.
{
char *line;
struct imap_cmd *cmd;
- int numerrs = 0;
+ bool numerrs = false;
if (tokenresponse)
*tokenresponse = NULL;
cmd->next = cmd->next->next;
if (failerr && strncmp(line + strlen(cmd2->tag),
"OK ", 3) != 0) {
- numerrs++;
+ numerrs = true;
netsec_err(errstr, "%s", line + strlen(cmd2->tag));
}
free(cmd2);
}
}
- return numerrs == 0 ? OK : NOTOK;
+ return numerrs ? NOTOK : OK;
}
/*
time_t mtime;
} *Maildir = NULL;
static int num_maildir_entries = 0;
-static int snoop = 0;
+static bool snoop;
typedef struct {
FILE *mailout;
continue;
case SNOOPSW:
- snoop++;
+ snoop = true;
continue;
case SASLSW:
int
main (int argc, char **argv)
{
- int autof = 0;
+ bool autof = false;
char *cp, buf[BUFSIZ];
const char *pathname;
char *dp, **arguments, **argp;
done (0);
case AUTOSW:
- autof++;
+ autof = true;
continue;
case CHECKSW:
int
main (int argc, char **argv)
{
- int addsw = 0, deletesw = 0, debugsw = 0;
- int listsw = 0, publicsw = -1, zerosw = 0, msgnum;
+ bool addsw = false;
+ bool deletesw = false;
+ bool debugsw = false;
+ bool listsw = false;
+ int publicsw = -1;
+ bool zerosw = false;
+ int msgnum;
unsigned int seqp = 0;
char *cp, *maildir, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
done (0);
case ADDSW:
- addsw++;
- deletesw = listsw = 0;
+ addsw = true;
+ deletesw = false;
+ listsw = false;
continue;
case DELSW:
- deletesw++;
- addsw = listsw = 0;
+ deletesw = true;
+ addsw = false;
+ listsw = false;
continue;
case LSTSW:
- listsw++;
- addsw = deletesw = 0;
+ listsw = true;
+ addsw = false;
+ deletesw = false;
continue;
case SEQSW:
continue;
case DEBUGSW:
- debugsw++;
+ debugsw = true;
continue;
case ZEROSW:
- zerosw++;
+ zerosw = true;
continue;
case NZEROSW:
- zerosw = 0;
+ zerosw = false;
continue;
}
}
*/
if (!addsw && !deletesw && !listsw) {
if (seqp)
- addsw++;
+ addsw = true;
else
- listsw++;
+ listsw = true;
}
if (!context_find ("path"))
int
main (int argc, char **argv)
{
- int sizesw = 1, headsw = 1;
+ bool sizesw = true;
+ bool headsw = true;
bool directives = true;
bool autobuild = false;
bool dist = false;
- int verbosw = 0;
+ bool verbosw = false;
bool dispo = false;
size_t maxunencoded = MAXTEXTPERLN;
int *icachesw;
die("cannot specify both standard input and a file");
compfile = cp;
listsw = false; /* turn off -list if using standard in/out */
- verbosw = 0; /* turn off -verbose listings */
+ verbosw = false; /* turn off -verbose listings */
break;
}
if (*cp == '-') {
continue;
case HEADSW:
- headsw++;
+ headsw = true;
continue;
case NHEADSW:
- headsw = 0;
+ headsw = false;
continue;
case DIRECTIVES:
continue;
case SIZESW:
- sizesw++;
+ sizesw = true;
continue;
case NSIZESW:
- sizesw = 0;
+ sizesw = false;
continue;
case CONTENTIDSW:
continue;
case VERBSW:
- verbosw++;
+ verbosw = true;
continue;
case NVERBSW:
- verbosw = 0;
+ verbosw = false;
continue;
case DISPOSW:
dispo = true;
{
bool sizesw = true;
bool headsw = true;
- int chgflag = 1;
+ bool chgflag = true;
bool verbosw = false;
bool dispo = false;
int msgnum, *icachesw;
continue;
case CHGSW:
- chgflag++;
+ chgflag = true;
continue;
case NCHGSW:
- chgflag = 0;
+ chgflag = false;
continue;
case VERBSW:
static int clearflg = 0;
static int dashstuff = 0;
static bool dobody = true;
-static int forwflg = 0;
-static int forwall = 0;
+static bool forwflg;
+static bool forwall;
static int sleepsw = NOTOK;
static int issue = 0;
static int exitstat = 0;
-static int mhldebug = 0;
+static bool mhldebug;
static int filesize = 0;
int
mhl (int argc, char **argv)
{
- int length = 0, nomore = 0;
+ int length = 0;
+ bool nomore = false;
unsigned int i, vecp = 0;
int width = 0;
char *cp, *folder = NULL, *form = NULL;
argp = arguments;
if ((cp = getenv ("MHLDEBUG")) && *cp)
- mhldebug++;
+ mhldebug = true;
while ((cp = *argp++)) {
if (*cp == '-') {
mhladios (NULL, "missing argument to %s", argp[-2]);
continue;
case NPROGSW:
- nomore++;
+ nomore = true;
continue;
case FMTPROCSW:
continue;
case FORW2SW:
- forwall++;
+ forwall = true;
/* FALLTHRU */
case FORW1SW:
- forwflg++;
+ forwflg = true;
clearflg = -1;/* XXX */
continue;
{
char *text; /* c1's text, or the name as a fallback. */
char *trimmed_prefix;
- int count, cchdr;
+ int count;
+ bool cchdr;
char *cp;
const int utf8 = strcasecmp(get_charset(), "UTF-8") == 0;
* blank lines. */
trimmed_prefix = rtrim(mh_xstrdup(FENDNULL(text)));
- cchdr = 0;
+ cchdr = false;
lm = 0;
llim = c1->c_length ? c1->c_length : -1;
wid = c1->c_width ? c1->c_width : global.c_width;
if (!(c1->c_flags & SPLIT))
c1->c_flags |= HDROUTPUT;
- cchdr++;
+ cchdr = true;
if ((count = c1->c_cwidth - strlen(text) - 2) > 0)
while (count--)
putstr (" ", c1->c_flags);
if (!(c1->c_flags & SPLIT))
c2->c_flags |= HDROUTPUT;
- cchdr++;
+ cchdr = true;
if ((count = c1->c_cwidth - strlen (c2->c_name) - 2) > 0)
while (count--)
putstr (" ", c1->c_flags);
static char *
oneline (char *stuff, unsigned long flags)
{
- int spc;
+ bool spc;
char *cp, *ret;
if (onelp == NULL)
ret = onelp;
term = 0;
if (flags & COMPRESS) {
- for (spc = 1, cp = ret; *onelp; onelp++)
+ for (spc = true, cp = ret; *onelp; onelp++)
if (isspace ((unsigned char) *onelp)) {
if (*onelp == '\n' && (!onelp[1] || (flags & ADDRFMT))) {
term = '\n';
}
if (!spc) {
*cp++ = ' ';
- spc++;
+ spc = true;
}
}
else {
*cp++ = *onelp;
- spc = 0;
+ spc = false;
}
*cp = 0;
/*
* what action to take?
*/
-static int cachesw = 0;
+static bool cachesw;
static bool listsw;
static bool showsw;
static bool storesw;
{
bool sizesw = true;
bool headsw = true;
- int autosw = 0;
+ bool autosw = false;
int msgnum, *icachesw;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
done (0);
case AUTOSW:
- autosw++;
+ autosw = true;
continue;
case NAUTOSW:
- autosw = 0;
+ autosw = false;
continue;
case CACHESW:
- cachesw++;
+ cachesw = true;
continue;
case NCACHESW:
- cachesw = 0;
+ cachesw = false;
continue;
case RCACHESW: