int
main (int argc, char **argv)
{
- int msgnum, *icachesw, autosw = 0;
+ int msgnum, *icachesw;
+ bool autosw = false;
/* verbosw defaults to 1 for backward compatibility. */
bool verbosw = true;
const char *clobbersw = "always";
done (0);
case AUTOSW:
- autosw++;
+ autosw = true;
continue;
case NAUTOSW:
- autosw = 0;
+ autosw = false;
continue;
case RCACHESW:
int
main (int argc, char **argv)
{
- int datesw = 1, notifysw = NT_ALL;
- int status = 0, sasl = 0, tls = 0, noverify = 0;
- int snoop = 0, vecp = 0;
+ bool datesw = true;
+ int notifysw = NT_ALL;
+ int status = 0;
+ bool sasl = false;
+ bool tls = false;
+ bool noverify = false;
+ bool snoop = false;
+ int vecp = 0;
char *cp, *host = NULL, *port = NULL, *user = NULL, *proxy = NULL;
char buf[BUFSIZ], *saslmech = NULL, *auth_svc = NULL;
char **argp, **arguments, *vec[MAXVEC];
done (0);
case DATESW:
- datesw++;
+ datesw = true;
continue;
case NDATESW:
- datesw = 0;
+ datesw = false;
continue;
case NOTESW:
continue;
case SNOOPSW:
- snoop++;
+ snoop = true;
continue;
case SASLSW:
- sasl++;
+ sasl = true;
continue;
case NOSASLSW:
- sasl = 0;
+ sasl = false;
continue;
case SASLMECHSW:
continue;
case INITTLSSW:
- tls++;
+ tls = true;
continue;
case NOTLSSW:
- tls = 0;
+ tls = false;
continue;
case CERTVERSW:
- noverify = 0;
+ noverify = false;
continue;
case NOCERTVERSW:
- noverify++;
+ noverify = true;
continue;
case AUTHSERVICESW:
int
main (int argc, char **argv)
{
- int publicsw = -1, zerosw = 1, vecp = 0;
+ int publicsw = -1;
+ bool zerosw = true;
+ int vecp = 0;
size_t seqp = 0;
int msgnum;
char *maildir, *folder = NULL, buf[100];
publicsw = 0;
continue;
case ZEROSW:
- zerosw++;
+ zerosw = true;
continue;
case NZEROSW:
- zerosw = 0;
+ zerosw = false;
continue;
case LISTSW:
static int
GREPaction(struct nexus *n, FILE *fp, int msgnum, long start, long stop)
{
- int c, body, lf;
+ int c;
+ bool body;
+ bool lf;
long pos = start;
char *p1, *p2, *ebp, *cbp;
char ibuf[BUFSIZ];
NMH_UNUSED (msgnum);
fseek (fp, start, SEEK_SET);
- body = 0;
+ body = false;
ebp = cbp = ibuf;
for (;;) {
if (body && n->n_header)
return 0;
p1 = linebuf;
p2 = cbp;
- lf = 0;
+ lf = false;
for (;;) {
if (p2 >= ebp) {
if (fgets (ibuf, sizeof ibuf, fp) == NULL
--p2;
break;
}
- lf = 0;
+ lf = false;
}
if (c == '\n') {
if (body)
break;
if (lf) {
- body++;
+ body = true;
break;
}
- lf++;
+ lf = true;
/* Unfold by skipping the newline. */
c = 0;
}
/* Attempt to decode as a MIME header. If it's the last header,
body will be 1 and lf will be at least 1. */
- if ((body == 0 || lf > 0) &&
+ if ((!body || lf) &&
decode_rfc2047 (linebuf, decoded_linebuf, sizeof decoded_linebuf)) {
p1 = decoded_linebuf;
}
static int
check_mech(char *server_mechs, size_t server_mechs_size)
{
- int status, sasl_capability = 0;
+ int status;
+ bool sasl_capability = false;
/*
* First off, we're going to send the CAPA command to see if we can
if (strncasecmp(response, "SASL ", 5) == 0) {
/* We've seen the SASL capability. Grab the mech list. */
- sasl_capability++;
+ sasl_capability = true;
strncpy(server_mechs, response + 5, server_mechs_size);
}
}
static short outputlinelen = OUTPUTLINELEN;
static int pfd = NOTOK; /* fd to write annotation list to */
-static int recipients = 0; /* how many people will get a copy */
+static bool recipients; /* how many people will get a copy */
static int unkadr = 0; /* how many of those were unknown */
static int badadr = 0; /* number of bad addrs */
-static int badmsg = 0; /* message has bad semantics */
-static int verbose = 0; /* spell it out */
+static bool badmsg; /* message has bad semantics */
+static bool verbose; /* spell it out */
static bool format = true; /* format addresses */
-static int mime = 0; /* use MIME-style encapsulations for Bcc */
-static int msgid = 0; /* add msgid */
-static int debug = 0; /* debugging post */
-static int watch = 0; /* watch the delivery process */
-static int whomsw = 0; /* we are whom not post */
-static int checksw = 0; /* whom -check */
+static bool mime; /* use MIME-style encapsulations for Bcc */
+static bool msgid; /* add msgid */
+static bool debug; /* debugging post */
+static bool watch; /* watch the delivery process */
+static bool whomsw; /* we are whom not post */
+static bool checksw; /* whom -check */
static int linepos=0; /* putadr()'s position on the line */
static int nameoutput=0; /* putadr() has output header name */
-static int sasl=0; /* Use SASL auth for SMTP */
+static bool sasl; /* Use SASL auth for SMTP */
static char *saslmech=NULL; /* Force use of particular SASL mech */
static char *user=NULL; /* Authenticate as this user */
static char *port="submission"; /* Name of server port for SMTP submission */
static int tlsflag=0; /* Flags to control TLS settings */
static int fromcount=0; /* Count of addresses on From: header */
-static int seensender=0; /* Have we seen a Sender: header? */
+static bool seensender; /* Have we seen a Sender: header? */
static unsigned msgflags = 0; /* what we've seen */
static struct mailname uuaddrs; /* uucp addrs */
static struct mailname tmpaddrs; /* temporary queue */
-static int snoop = 0;
+static bool snoop;
static char *clientsw = NULL;
static char *serversw = NULL;
int
main (int argc, char **argv)
{
- int state, compnum, dashstuff = 0, swnum, oauth_flag = 0, tls = -1;
- int noverify = 0;
+ int state, compnum, dashstuff = 0, swnum;
+ bool oauth_flag = false;
+ int tls = -1;
+ bool noverify = false;
int eai = 0; /* use Email Address Internationalization (EAI) (SMTPUTF8) */
char *cp, *msg = NULL, **argp, **arguments, *envelope;
char buf[NMH_BUFSIZ], name[NAMESZ], *auth_svc = NULL;
continue;
case CHKSW:
- checksw++;
+ checksw = true;
continue;
case NCHKSW:
- checksw = 0;
+ checksw = false;
continue;
case DEBUGSW:
- debug++;
+ debug = true;
continue;
case DISTSW:
case FILTSW:
if (!(filter = *argp++) || *filter == '-')
die("missing argument to %s", argp[-2]);
- mime = 0;
+ mime = false;
continue;
case NFILTSW:
filter = NULL;
continue;
case MIMESW:
- mime++;
+ mime = true;
filter = NULL;
continue;
case NMIMESW:
- mime = 0;
+ mime = false;
continue;
case MSGDSW:
- msgid++;
+ msgid = true;
continue;
case NMSGDSW:
- msgid = 0;
+ msgid = false;
continue;
case VERBSW:
- verbose++;
+ verbose = true;
continue;
case NVERBSW:
- verbose = 0;
+ verbose = false;
continue;
case WATCSW:
- watch++;
+ watch = true;
continue;
case NWATCSW:
- watch = 0;
+ watch = false;
continue;
case WHOMSW:
- whomsw++;
+ whomsw = true;
continue;
case WIDTHSW:
die("missing argument to %s", argp[-2]);
continue;
case SNOOPSW:
- snoop++;
+ snoop = true;
continue;
case PARTSW:
continue;
case SASLSW:
- sasl++;
+ sasl = true;
continue;
case NOSASLSW:
- sasl = 0;
+ sasl = false;
continue;
case SASLMECHSW:
case AUTHSERVICESW:
if (!(auth_svc = *argp++) || *auth_svc == '-')
die("missing argument to %s", argp[-2]);
- oauth_flag++;
+ oauth_flag = true;
continue;
case OAUTHCREDFILESW:
die("internal error: cannot map switch %s "
"to profile entry", argp[-2]);
- oauth_flag++;
+ oauth_flag = true;
continue;
}
continue;
case CERTVERSW:
- noverify = 0;
+ noverify = false;
continue;
case NOCERTVERSW:
- noverify++;
+ noverify = true;
continue;
case FILEPROCSW:
start_headers ();
if (debug) {
- verbose++;
+ verbose = true;
out = stdout;
} else {
if (whomsw) {
static void
putfmt (char *name, char *str, int *eai, FILE *out)
{
- int count, grp, i, keep;
+ int count;
+ bool grp;
+ int i, keep;
char *cp, *pp, *qp;
char namep[BUFSIZ], error[BUFSIZ];
char *savehdr = NULL;
if (msgstate == NORMAL && uprf (name, "resent")) {
inform("illegal header line -- %s:", name);
- badmsg++;
+ badmsg = true;
return;
}
}
if (hdr->flags & HBAD) {
inform("illegal header line -- %s:", name);
- badmsg++;
+ badmsg = true;
return;
}
msgflags |= (hdr->set & ~(MVIS | MINV));
if (hdr->flags & HTRY)
badadr++;
else
- badmsg++;
+ badmsg = true;
}
}
if ((msgstate == RESENT) ? (hdr->set & MRSN)
: (hdr->set & MSND)) {
inform("%s: field requires one address", name);
- badmsg++;
+ badmsg = true;
}
#ifdef notdef
inform("%s: field requires at least one address", name);
- badmsg++;
+ badmsg = true;
#endif /* notdef */
}
return;
if (count > 1 && (hdr->flags & HONE)) {
inform("%s: field only permits one address", name);
- badmsg++;
+ badmsg = true;
return;
}
snprintf (namep, sizeof(namep), "%s%s",
(hdr->flags & HMNG) ? "Original-" : "", name);
- for (grp = 0, mp = tmpaddrs.m_next; mp; mp = np)
+ for (grp = false, mp = tmpaddrs.m_next; mp; mp = np)
if (mp->m_nohost) { /* also used to test (hdr->flags & HTRY) */
/* The address doesn't include a host, so it might be an alias. */
pp = akvalue (mp->m_mbox); /* do mh alias substitution */
: (hdr->set & MSND)) {
strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
sender[sizeof(sender) - 1] = '\0';
- seensender++;
+ seensender = true;
}
/*
" sendmail/pipe");
}
- grp++;
+ grp = true;
}
if (putadr (namep, qp, mp, out, hdr->flags, savehdr,
savehdrlen))
: (hdr->set & MSND)) {
strncpy(sender, auxformat(mp, 0), sizeof(sender) - 1);
sender[sizeof(sender) - 1] = '\0';
- seensender++;
+ seensender = true;
}
/*
if (mp->m_gname)
putgrp (namep, mp->m_gname, out, hdr->flags);
if (mp->m_ingrp)
- grp++;
+ grp = true;
keep = putadr (namep, "", mp, out, hdr->flags, savehdr, savehdrlen);
np = mp->m_next;
if (keep) {
}
}
- if (grp > 0 && (hdr->flags & HNGR)) {
+ if (grp && (hdr->flags & HNGR)) {
inform("%s: field does not allow groups", name);
- badmsg++;
+ badmsg = true;
}
if (linepos) {
putc ('\n', out);
*/
inform("message has no From: header");
inform("See default components files for examples");
- badmsg++;
+ badmsg = true;
break;
}
- if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) {
+ if (fromcount > 1 && (!seensender && !(msgflags & MEFM))) {
inform("A Sender: or Envelope-From: header is required "
"with multiple\nFrom: addresses");
- badmsg++;
+ badmsg = true;
break;
}
* from Envelope-From: (which in this case, cannot be blank)
*/
- if (fromcount > 1 && seensender == 0) {
+ if (fromcount > 1 && !seensender) {
if (efrom[0] == '\0') {
inform("Envelope-From cannot be blank when there "
"is multiple From: addresses\nand no Sender: "
"header");
- badmsg++;
+ badmsg = true;
} else {
fprintf (out, "Sender: %s\n", efrom);
}
case RESENT:
if (!(msgflags & MDAT)) {
inform("message has no Date: header");
- badmsg++;
+ badmsg = true;
}
if (!(msgflags & MFRM)) {
inform("message has no From: header");
- badmsg++;
+ badmsg = true;
}
if (!(msgflags & MRFM)) {
inform("message has no Resent-From: header");
inform("See default components files for examples");
- badmsg++;
+ badmsg = true;
break;
}
- if (fromcount > 1 && (seensender == 0 && !(msgflags & MEFM))) {
+ if (fromcount > 1 && (!seensender && !(msgflags & MEFM))) {
inform("A Resent-Sender: or Envelope-From: header is "
"required with multiple\nResent-From: addresses");
- badmsg++;
+ badmsg = true;
break;
}
* from Envelope-From (which in this case, cannot be blank)
*/
- if (fromcount > 1 && seensender == 0) {
+ if (fromcount > 1 && !seensender) {
if (efrom[0] == '\0') {
inform("Envelope-From cannot be blank when there "
"is multiple Resent-From: addresses and no "
"Resent-Sender: header");
- badmsg++;
+ badmsg = true;
} else {
fprintf (out, "Resent-Sender: %s\n", efrom);
}
return 0;
mp->m_next = np;
- recipients++;
+ recipients = true;
return 1;
}
static struct termios tio;
static bool wtuser;
-static int sigint = 0;
+static bool sigint;
static jmp_buf sigenv;
/*
int
main (int argc, char **argv)
{
- int body = 1, prepend = 1, rapid = 0;
- int doteof = 0, fdi, fdo, i, state;
+ bool body = true;
+ bool prepend = true;
+ bool rapid = false;
+ bool doteof = false;
+ int fdi, fdo, i, state;
char *cp, *drft = NULL, *erasep = NULL;
char *killp = NULL, name[NAMESZ], field[NMH_BUFSIZ];
char buffer[BUFSIZ];
continue;
case PREPSW:
- prepend++;
+ prepend = true;
continue;
case NPREPSW:
- prepend = 0;
+ prepend = false;
continue;
case RAPDSW:
- rapid++;
+ rapid = true;
continue;
case NRAPDSW:
- rapid = 0;
+ rapid = false;
continue;
case BODYSW:
- body++;
+ body = true;
continue;
case NBODYSW:
- body = 0;
+ body = false;
continue;
case DOTSW:
- doteof++;
+ doteof = true;
continue;
case NDOTSW:
- doteof = 0;
+ doteof = false;
continue;
}
} else {
tio.c_cc[VERASE] = save_erase;
}
- sigint = 0;
+ sigint = false;
SIGNAL2 (SIGINT, intrser);
/*
if (wtuser)
longjmp (sigenv, NOTOK);
- sigint++;
+ sigint = true;
}
int
main (int argc, char **argv)
{
- int publicsw = -1, zerosw = 0;
- int create = 1;
+ int publicsw = -1;
+ bool zerosw = false;
+ bool create = true;
bool unseensw = true;
int fd, msgnum;
size_t seqp = 0;
continue;
case ZEROSW:
- zerosw++;
+ zerosw = true;
continue;
case NZEROSW:
- zerosw = 0;
+ zerosw = false;
continue;
case CRETSW:
- create++;
+ create = true;
continue;
case NCRETSW:
- create = 0;
+ create = false;
continue;
}
}
int
main (int argc, char **argv)
{
- int linkf = 0, preserve = 0;
+ bool linkf = false;
+ bool preserve = false;
bool retainseqs = false;
int filep = 0;
- int foldp = 0, isdf = 0, unlink_msgs = 0;
+ int foldp = 0, isdf = 0;
+ bool unlink_msgs = false;
int i, msgnum;
char *cp, *folder = NULL, buf[BUFSIZ];
char **argp, **arguments;
done (0);
case LINKSW:
- linkf++;
+ linkf = true;
continue;
case NLINKSW:
- linkf = 0;
+ linkf = false;
continue;
case PRESSW:
- preserve++;
+ preserve = true;
continue;
case NPRESSW:
- preserve = 0;
+ preserve = false;
continue;
case RETAINSEQSSW:
continue;
case UNLINKSW:
- unlink_msgs++;
+ unlink_msgs = true;
continue;
case NUNLINKSW:
- unlink_msgs = 0;
+ unlink_msgs = false;
continue;
case SRCSW:
short querysw = 0;
static short outputlinelen = OUTPUTLINELEN;
-static short groupreply = 0; /* Is this a group reply? */
+static bool groupreply; /* Is this a group reply? */
-static int mime = 0; /* include original as MIME part */
+static bool mime; /* include original as MIME part */
static char *form = NULL; /* form (components) file */
static char *filter = NULL; /* message filter file */
static char *fcc = NULL; /* folders to add to Fcc: header */
main (int argc, char **argv)
{
int i, isdf = 0;
- int anot = 0;
+ bool anot = false;
bool inplace = true;
- int nedit = 0, nwhat = 0;
- int atfile = 0;
+ bool nedit = false;
+ bool nwhat = false;
+ bool atfile = false;
int fmtproc = -1;
char *cp, *cwd, *dp, *maildir, *file = NULL;
char *folder = NULL, *msg = NULL, *dfolder = NULL;
struct msgs *mp = NULL;
struct stat st;
FILE *in;
-
- int buildsw = 0;
+ bool buildsw = false;
if (nmh_init(argv[0], true, true)) { return 1; }
done (0);
case GROUPSW:
- groupreply++;
+ groupreply = true;
continue;
case NGROUPSW:
- groupreply = 0;
+ groupreply = false;
continue;
case ANNOSW:
- anot++;
+ anot = true;
continue;
case NANNOSW:
- anot = 0;
+ anot = false;
continue;
case CCSW:
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 CONVERTARGSW: {
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 FCCSW:
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 == '-')
case FRMTSW:
filter = mh_xstrdup(etcpath(mhlreply));
- mime = 0;
+ mime = false;
continue;
case NFRMTSW:
filter = NULL;
continue;
case MIMESW:
- mime++;
+ mime = true;
filter = NULL;
continue;
case NMIMESW:
- mime = 0;
+ mime = false;
continue;
case QURYSW:
continue;
case ATFILESW:
- atfile++;
+ atfile = true;
continue;
case NOATFILESW:
- atfile = 0;
+ atfile = false;
continue;
case FMTPROCSW:
/*
* We are replying to a file.
*/
- anot = 0; /* we don't want to annotate a file */
+ anot = false; /* we don't want to annotate a file */
} else {
/*
* We are replying to a message.
{
int len;
char baddr[BUFSIZ], error[BUFSIZ];
- int isgroup;
+ bool isgroup;
char *dst;
char *cp;
char *sp;
}
/* concatenate all the new addresses onto 'buf' */
- for (isgroup = 0; (cp = getname (fixed_str)); ) {
+ for (isgroup = false; (cp = getname (fixed_str)); ) {
if ((mp = getm (cp, dfhost, dftype, error, sizeof(error))) == NULL) {
snprintf (baddr, sizeof(baddr), "\t%s -- %s\n", cp, error);
badaddrs = add (baddr, badaddrs);
}
if (isgroup && (mp->m_gname || !mp->m_ingrp)) {
*dst++ = ';';
- isgroup = 0;
+ isgroup = false;
}
if (insert (mp)) {
/* if we get here we're going to add an address */
if (mp->m_gname) {
CHECKMEM (mp->m_gname);
CPY (mp->m_gname);
- isgroup++;
+ isgroup = true;
}
sp = adrformat (mp);
CHECKMEM (sp);
int
main (int argc, char **argv)
{
- int defolder = 0, interactive = -1;
+ bool defolder = false;
+ int interactive = -1;
char *cp, *folder = NULL, newfolder[BUFSIZ];
char buf[BUFSIZ], **argp, **arguments;
char *fp;
free (path ("./", TFOLDER));
if (!folder) {
folder = getfolder (1);
- defolder++;
+ defolder = true;
}
fp = m_mailpath(folder);
if (!strcmp(fp, pwd()))
static int
rmf (char *folder)
{
- int i, others;
+ int i;
+ bool others;
char *fp;
char *maildir;
char cur[BUFSIZ];
if ((dd = opendir (".")) == NULL)
die("unable to read folder +%s", folder);
- others = 0;
+ others = false;
/*
* Run the external delete hook program.
inform("file \"%s/%s\" not deleted, continuing...",
folder, dp->d_name);
- others++;
+ others = true;
continue;
}
if (m_unlink (dp->d_name) == NOTOK) {
admonish (dp->d_name, "unable to unlink %s:", folder);
- others++;
+ others = true;
}
}
if (chdir ("..") < 0) {
advise ("..", "chdir");
}
- if (others == 0 && remdir (maildir))
+ if (!others && remdir (maildir))
return OK;
inform("folder +%s not removed", folder);
int
main (int argc, char **argv)
{
- int msgnum, unlink_msgs = 0;
+ int msgnum;
+ bool unlink_msgs = false;
char *cp, *maildir, *folder = NULL;
char buf[BUFSIZ], **argp;
char **arguments;
done (0);
case UNLINKSW:
- unlink_msgs++;
+ unlink_msgs = true;
continue;
case NUNLINKSW:
- unlink_msgs = 0;
+ unlink_msgs = false;
continue;
case RPROCSW:
int
main (int argc, char **argv)
{
- int clearflag = 0, hdrflag = 0, ontty;
- int width = -1, revflag = 0;
+ bool clearflag = false;
+ bool hdrflag = false;
+ int ontty;
+ int width = -1;
+ bool revflag = false;
int i, state, msgnum;
ivector_t seqnum = ivector_create (0);
bool unseen;
done (0);
case CLRSW:
- clearflag++;
+ clearflag = true;
continue;
case NCLRSW:
- clearflag = 0;
+ clearflag = false;
continue;
case FORMSW:
continue;
case HEADSW:
- hdrflag++;
+ hdrflag = true;
continue;
case NHEADSW:
- hdrflag = 0;
+ hdrflag = false;
continue;
case WIDTHSW:
width = atoi (cp);
continue;
case REVSW:
- revflag++;
+ revflag = true;
continue;
case NREVSW:
- revflag = 0;
+ revflag = false;
continue;
case FILESW:
}
charstring_free (scanl);
scan_finished ();
- hdrflag = 0;
+ hdrflag = false;
fclose (in);
if (ontty)
fflush (stdout);
#undef X
extern int debugsw; /* from sendsbr.c */
-extern int forwsw;
+extern bool forwsw;
extern int inplace;
-extern int pushsw;
+extern bool pushsw;
extern int splitsw;
-extern int unique;
-extern int verbsw;
+extern bool unique;
+extern bool verbsw;
extern char *altmsg; /* .. */
extern char *annotext;
continue;
case PUSHSW:
- pushsw++;
+ pushsw = true;
continue;
case NPUSHSW:
- pushsw = 0;
+ pushsw = false;
continue;
case SPLITSW:
continue;
case UNIQSW:
- unique++;
+ unique = true;
continue;
case NUNIQSW:
- unique = 0;
+ unique = false;
continue;
case FORWSW:
- forwsw++;
+ forwsw = true;
continue;
case NFORWSW:
- forwsw = 0;
+ forwsw = false;
continue;
case VERBSW:
- verbsw++;
+ verbsw = true;
vec[vecp++] = --cp;
continue;
case NVERBSW:
- verbsw = 0;
+ verbsw = false;
vec[vecp++] = --cp;
continue;
#endif /* OAUTH_SUPPORT */
int debugsw = 0; /* global */
-int forwsw = 1;
+bool forwsw = true;
int inplace = 1;
-int pushsw = 0;
+bool pushsw;
int splitsw = -1;
-int unique = 0;
-int verbsw = 0;
+bool unique;
+bool verbsw;
char *altmsg = NULL; /* .. */
char *annotext = NULL;
int
main (int argc, char **argv)
{
- int draftsw = 0;
+ bool draftsw = false;
bool headersw = true;
- int nshow = 0, checkmime = 1;
+ bool nshow = false;
+ bool checkmime = true;
bool mime = false;
int isdf = 0, mode = SHOW, msgnum;
char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
case DRFTSW:
if (file)
die("only one file at a time!");
- draftsw++;
+ draftsw = true;
if (mode == SHOW)
continue;
usage:
case SHOWSW:
if (!(showproc = *argp++) || *showproc == '-')
die("missing argument to %s", argp[-2]);
- nshow = 0;
+ nshow = false;
continue;
case NSHOWSW:
- nshow++;
+ nshow = true;
continue;
case SHOWMIMESW:
if (!(showmimeproc = *argp++) || *showmimeproc == '-')
die("missing argument to %s", argp[-2]);
- nshow = 0;
+ nshow = false;
continue;
case CHECKMIMESW:
- checkmime++;
+ checkmime = true;
continue;
case NOCHECKMIMESW:
- checkmime = 0;
+ checkmime = false;
continue;
}
}
static int globbed = 0; /* have we built "vars" table yet? */
static int parsed = 0; /* have we built header field table yet */
static int utmped = 0; /* have we scanned umtp(x) file yet */
-static int suppressdup = 0; /* are we suppressing duplicate messages? */
+static bool suppressdup; /* are we suppressing duplicate messages? */
-static int verbose = 0;
-static int debug = 0;
+static bool verbose;
+static bool debug;
static char *addr = NULL;
static char *user = NULL;
continue;
case VERBSW:
- verbose++;
+ verbose = true;
continue;
case NVERBSW:
- verbose = 0;
+ verbose = false;
continue;
case SUPPRESSDUP:
- suppressdup++;
+ suppressdup = true;
continue;
case NSUPPRESSDUP:
- suppressdup = 0;
+ suppressdup = false;
continue;
case DEBUGSW:
- debug++;
+ debug = true;
continue;
}
} else {
{
int i;
bool accept;
- int status=1, won, vecp;
+ int status=1;
+ bool won;
+ int vecp;
bool next;
char *field, *pattern, *action, *result, *string;
char buffer[BUFSIZ], tmpbuf[BUFSIZ];
return -1;
}
- won = 0;
+ won = false;
next = true;
/* read and process delivery file */
if (status) next = false; /* action failed, mark for 'N' result */
if (accept && status == 0)
- won++;
+ won = true;
}
fclose (fp);
char *subjsort; /* sort on subject if != 0 */
time_t datelimit = 0;
-int submajor = 0; /* if true, sort on subject-major */
-int verbose;
+bool submajor; /* if true, sort on subject-major */
+bool verbose;
int allmsgs = 1;
int check_failed = 0;
while (*cp == '0')
cp++; /* skip any leading zeros */
if (!*cp) { /* hit end of string */
- submajor++; /* sort subject-major */
+ submajor = true; /* sort subject-major */
continue;
}
if (!isdigit((unsigned char) *cp) || !(datelimit = atoi(cp)))
datelimit *= 60*60*24;
continue;
case NLIMSW:
- submajor = 0; /* use date-major, but */
- datelimit = 0; /* use no limit */
+ submajor = false; /* use date-major, but */
+ datelimit = 0; /* use no limit */
continue;
case VERBSW:
- verbose++;
+ verbose = true;
continue;
case NVERBSW:
- verbose = 0;
+ verbose = false;
continue;
case ALLMSGS:
extern int debugsw;
extern int splitsw;
-extern int verbsw;
+extern bool verbsw;
/*
* static prototypes
continue;
case VERBSW:
- verbsw = 1;
+ verbsw = true;
continue;
case NVERBSW:
- verbsw = 0;
+ verbsw = false;
continue;
case DEBUGSW:
what_now (char *ed, int nedit, int use, char *file, char *altmsg, int dist,
struct msgs *mp, char *text, int inplace, char *cwd, int atfile)
{
- int found, k, msgnum, vecp;
+ bool found;
+ int k, msgnum, vecp;
int len, buflen;
char *bp;
char buffer[BUFSIZ], *vec[MAXARGS];
unsetenv("mhinplace");
if (text && mp && !is_readonly(mp)) {
- found = 0;
+ found = false;
bp = buffer;
buflen = sizeof(buffer);
for (msgnum = mp->lowmsg; msgnum <= mp->hghmsg; msgnum++) {
buflen -= len;
}
msgnum = k + 1;
- found++;
+ found = true;
}
}
if (found) {
int
WhatNow (int argc, char **argv)
{
- int isdf = 0, nedit = 0, use = 0, atfile = 1;
+ int isdf = 0;
+ bool nedit = false;
+ int use = 0, atfile = 1;
char *cp, *dfolder = NULL, *dmsg = NULL;
char *ed = NULL, *drft = NULL, *msgnam = NULL;
char buf[BUFSIZ];
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 PRMPTSW:
if (ed == NULL && ((ed = getenv ("mheditor")) == NULL || *ed == 0)) {
ed = NULL;
- nedit++;
+ nedit = true;
}
/* start editing the draft, unless -noedit was given */
* EDIT
*/
-static int reedit = 0; /* have we been here before? */
+static bool reedit; /* have we been here before? */
static char *edsave = NULL; /* the editor we used previously */
break;
}
- reedit++;
+ reedit = true;
if (altmsg
&& mp
&& !is_readonly(mp)
extern int debugsw; /* from sendsbr.c */
-extern int forwsw;
+extern bool forwsw;
extern int inplace;
-extern int pushsw;
+extern bool pushsw;
extern int splitsw;
-extern int unique;
-extern int verbsw;
+extern bool unique;
+extern bool verbsw;
extern char *altmsg; /* .. */
extern char *annotext;
argp = arguments;
debugsw = 0;
- forwsw = 1;
+ forwsw = true;
inplace = 1;
- unique = 0;
+ unique = false;
altmsg = NULL;
annotext = NULL;
continue;
case UNIQSW:
- unique++;
+ unique = true;
continue;
case NUNIQSW:
- unique = 0;
+ unique = false;
continue;
case FORWSW:
- forwsw++;
+ forwsw = true;
continue;
case NFORWSW:
- forwsw = 0;
+ forwsw = false;
continue;
case VERBSW:
- verbsw++;
+ verbsw = true;
vec[vecp++] = --cp;
continue;
case NVERBSW:
- verbsw = 0;
+ verbsw = false;
vec[vecp++] = --cp;
continue;