Knowing the domain of the variable is Boolean aids comprehension of the
variable's name and purpose.
DEFINE_SWITCH_ARRAY(FOLDER, switches);
#undef X
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 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 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 */
static int ftotal = 0; /* should we output the totals? */
static bool all; /* should we output all folders */
int
main (int argc, char **argv)
{
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 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];
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 };
char **argp, **arguments;
struct stat st;
struct msgs_array msgs = { 0, 0, NULL };
if (nmh_init(argv[0], true, true)) { return 1; }
if (nmh_init(argv[0], true, true)) { return 1; }
continue;
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
die("missing argument to %s", argp[-2]);
continue;
case EDITRSW:
if (!(ed = *argp++) || *ed == '-')
die("missing argument to %s", argp[-2]);
continue;
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
die("missing argument to %s", argp[-2]);
continue;
case WHATSW:
if (!(whatnowproc = *argp++) || *whatnowproc == '-')
die("missing argument to %s", argp[-2]);
/* FALLTHRU */
case NWHATSW:
/* FALLTHRU */
case NWHATSW:
if (!(cp = *argp++) || *cp == '-')
die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
if (!(cp = *argp++) || *cp == '-')
die("missing argument to %s", argp[-2]);
filter = mh_xstrdup(etcpath(cp));
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
continue;
case FORMSW:
if (!(form = *argp++) || *form == '-')
filter = NULL;
continue;
case NMIMESW:
filter = NULL;
continue;
case NMIMESW:
continue;
case DGSTSW:
if (!(cp = *argp++) || *cp == '-')
die("missing argument to %s", argp[-2]);
digest = mh_xstrdup(cp);
continue;
case DGSTSW:
if (!(cp = *argp++) || *cp == '-')
die("missing argument to %s", argp[-2]);
digest = mh_xstrdup(cp);
continue;
case ISSUESW:
if (!(cp = *argp++) || *cp == '-')
continue;
case ISSUESW:
if (!(cp = *argp++) || *cp == '-')
/*
* Forwarding a file.
*/
/*
* 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.
} else {
/*
* Forwarding a message.
{
char *line;
struct imap_cmd *cmd;
{
char *line;
struct imap_cmd *cmd;
if (tokenresponse)
*tokenresponse = NULL;
if (tokenresponse)
*tokenresponse = NULL;
cmd->next = cmd->next->next;
if (failerr && strncmp(line + strlen(cmd2->tag),
"OK ", 3) != 0) {
cmd->next = cmd->next->next;
if (failerr && strncmp(line + strlen(cmd2->tag),
"OK ", 3) != 0) {
netsec_err(errstr, "%s", line + strlen(cmd2->tag));
}
free(cmd2);
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;
time_t mtime;
} *Maildir = NULL;
static int num_maildir_entries = 0;
typedef struct {
FILE *mailout;
typedef struct {
FILE *mailout;
int
main (int argc, char **argv)
{
int
main (int argc, char **argv)
{
char *cp, buf[BUFSIZ];
const char *pathname;
char *dp, **arguments, **argp;
char *cp, buf[BUFSIZ];
const char *pathname;
char *dp, **arguments, **argp;
int
main (int argc, char **argv)
{
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;
unsigned int seqp = 0;
char *cp, *maildir, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
- addsw++;
- deletesw = listsw = 0;
+ addsw = true;
+ deletesw = false;
+ listsw = false;
- deletesw++;
- addsw = listsw = 0;
+ deletesw = true;
+ addsw = false;
+ listsw = false;
- listsw++;
- addsw = deletesw = 0;
+ listsw = true;
+ addsw = false;
+ deletesw = false;
*/
if (!addsw && !deletesw && !listsw) {
if (seqp)
*/
if (!addsw && !deletesw && !listsw) {
if (seqp)
}
if (!context_find ("path"))
}
if (!context_find ("path"))
int
main (int argc, char **argv)
{
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;
bool directives = true;
bool autobuild = false;
bool dist = false;
bool dispo = false;
size_t maxunencoded = MAXTEXTPERLN;
int *icachesw;
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 */
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 == '-') {
break;
}
if (*cp == '-') {
continue;
case DIRECTIVES:
continue;
case DIRECTIVES:
continue;
case CONTENTIDSW:
continue;
case CONTENTIDSW:
continue;
case DISPOSW:
dispo = true;
continue;
case DISPOSW:
dispo = true;
{
bool sizesw = true;
bool headsw = true;
{
bool sizesw = true;
bool headsw = true;
bool verbosw = false;
bool dispo = false;
int msgnum, *icachesw;
bool verbosw = false;
bool dispo = false;
int msgnum, *icachesw;
static int clearflg = 0;
static int dashstuff = 0;
static bool dobody = true;
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 sleepsw = NOTOK;
static int issue = 0;
static int exitstat = 0;
static int issue = 0;
static int exitstat = 0;
-static int mhldebug = 0;
int
mhl (int argc, char **argv)
{
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;
unsigned int i, vecp = 0;
int width = 0;
char *cp, *folder = NULL, *form = NULL;
argp = arguments;
if ((cp = getenv ("MHLDEBUG")) && *cp)
argp = arguments;
if ((cp = getenv ("MHLDEBUG")) && *cp)
while ((cp = *argp++)) {
if (*cp == '-') {
while ((cp = *argp++)) {
if (*cp == '-') {
mhladios (NULL, "missing argument to %s", argp[-2]);
continue;
case NPROGSW:
mhladios (NULL, "missing argument to %s", argp[-2]);
continue;
case NPROGSW:
continue;
case FMTPROCSW:
continue;
case FMTPROCSW:
/* FALLTHRU */
case FORW1SW:
/* FALLTHRU */
case FORW1SW:
clearflg = -1;/* XXX */
continue;
clearflg = -1;/* XXX */
continue;
{
char *text; /* c1's text, or the name as a fallback. */
char *trimmed_prefix;
{
char *text; /* c1's text, or the name as a fallback. */
char *trimmed_prefix;
+ int count;
+ bool cchdr;
char *cp;
const int utf8 = strcasecmp(get_charset(), "UTF-8") == 0;
char *cp;
const int utf8 = strcasecmp(get_charset(), "UTF-8") == 0;
* blank lines. */
trimmed_prefix = rtrim(mh_xstrdup(FENDNULL(text)));
* blank lines. */
trimmed_prefix = rtrim(mh_xstrdup(FENDNULL(text)));
lm = 0;
llim = c1->c_length ? c1->c_length : -1;
wid = c1->c_width ? c1->c_width : global.c_width;
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;
if (!(c1->c_flags & SPLIT))
c1->c_flags |= HDROUTPUT;
if ((count = c1->c_cwidth - strlen(text) - 2) > 0)
while (count--)
putstr (" ", c1->c_flags);
if ((count = c1->c_cwidth - strlen(text) - 2) > 0)
while (count--)
putstr (" ", c1->c_flags);
if (!(c1->c_flags & SPLIT))
c2->c_flags |= HDROUTPUT;
if (!(c1->c_flags & SPLIT))
c2->c_flags |= HDROUTPUT;
if ((count = c1->c_cwidth - strlen (c2->c_name) - 2) > 0)
while (count--)
putstr (" ", c1->c_flags);
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)
{
static char *
oneline (char *stuff, unsigned long flags)
{
char *cp, *ret;
if (onelp == NULL)
char *cp, *ret;
if (onelp == NULL)
ret = onelp;
term = 0;
if (flags & COMPRESS) {
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 (isspace ((unsigned char) *onelp)) {
if (*onelp == '\n' && (!onelp[1] || (flags & ADDRFMT))) {
term = '\n';
}
if (!spc) {
*cp++ = ' ';
}
if (!spc) {
*cp++ = ' ';
}
}
else {
*cp++ = *onelp;
}
}
else {
*cp++ = *onelp;
/*
* what action to take?
*/
/*
* what action to take?
*/
static bool listsw;
static bool showsw;
static bool storesw;
static bool listsw;
static bool showsw;
static bool storesw;
{
bool sizesw = true;
bool headsw = true;
{
bool sizesw = true;
bool headsw = true;
int msgnum, *icachesw;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;
int msgnum, *icachesw;
char *cp, *file = NULL, *folder = NULL;
char *maildir, buf[100], **argp;