X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/dbdbd49d59ae5c14e66b1c148a63b8abc9d076ab..fc8e02dc2074ce73276afc6f48919b9ecb32a409:/uip/send.c diff --git a/uip/send.c b/uip/send.c index 7bf3c7cb..c12908f4 100644 --- a/uip/send.c +++ b/uip/send.c @@ -5,12 +5,35 @@ * complete copyright information. */ -#include +#include "h/mh.h" +#include "sendsbr.h" +#include "sbr/m_name.h" +#include "sbr/getarguments.h" +#include "sbr/read_switch_multiword.h" +#include "sbr/concat.h" +#include "sbr/seq_setprev.h" +#include "sbr/seq_save.h" +#include "sbr/showfile.h" +#include "sbr/smatch.h" +#include "sbr/cpydata.h" +#include "sbr/m_draft.h" +#include "sbr/m_convert.h" +#include "sbr/folder_read.h" +#include "sbr/context_save.h" +#include "sbr/context_find.h" +#include "sbr/brkstring.h" +#include "sbr/ambigsw.h" +#include "sbr/push.h" +#include "sbr/path.h" +#include "sbr/print_version.h" +#include "sbr/print_help.h" +#include "sbr/arglist.h" +#include "sbr/error.h" #include #include "h/done.h" -#include +#include "h/utils.h" #ifdef OAUTH_SUPPORT -# include +#include "h/oauth.h" #endif #include "sbr/m_maildir.h" #include "sbr/m_mktemp.h" @@ -46,7 +69,6 @@ X("nomsgid", 0, NMSGDSW) \ X("push", 0, PUSHSW) \ X("nopush", 0, NPUSHSW) \ - X("split seconds", 0, SPLITSW) \ X("unique", -6, UNIQSW) \ X("nounique", -8, NUNIQSW) \ X("verbose", 0, VERBSW) \ @@ -98,12 +120,11 @@ DEFINE_SWITCH_ARRAY(USE, anyl); #undef X extern int debugsw; /* from sendsbr.c */ -extern int forwsw; +extern bool forwsw; extern int inplace; -extern int pushsw; -extern int splitsw; -extern int unique; -extern int verbsw; +extern bool pushsw; +extern bool unique; +extern bool verbsw; extern char *altmsg; /* .. */ extern char *annotext; @@ -114,7 +135,7 @@ int main (int argc, char **argv) { int msgp = 0, vecp; - int isdf = 0, mime = 0; + int isdf = 0; int msgnum, status; char *cp, *dfolder = NULL, *maildir = NULL; char buf[BUFSIZ], **ap, **argp, **arguments, *program; @@ -122,7 +143,6 @@ main (int argc, char **argv) const char *user = NULL, *saslmech = NULL; struct msgs *mp; struct stat st; - int snoop = 0; char *auth_svc = NULL; if (nmh_init(argv[0], true, true)) { return 1; } @@ -191,51 +211,43 @@ main (int argc, char **argv) continue; case PUSHSW: - pushsw++; + pushsw = true; continue; case NPUSHSW: - pushsw = 0; - continue; - - case SPLITSW: - if (!(cp = *argp++) || sscanf (cp, "%d", &splitsw) != 1) - die("missing argument to %s", argp[-2]); + pushsw = false; 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; case MIMESW: - mime++; vec[vecp++] = --cp; continue; case NMIMESW: - mime = 0; vec[vecp++] = --cp; continue; case SNOOPSW: - snoop++; vec[vecp++] = --cp; continue; @@ -463,7 +475,6 @@ go_to_it: push (); status = 0; - closefds (3); for (msgnum = 0; msgnum < msgp; msgnum++) { switch (sendsbr (vec, vecp, program, msgs[msgnum], &st, 1, auth_svc)) {