Reformated comments and long lines
[mmh] / uip / mhshow.c
index bbb7fb8..d55f2c6 100644 (file)
@@ -1,10 +1,10 @@
 /*
 /*
- * mhshow.c -- display the contents of MIME messages
- *
- * This code is Copyright (c) 2002, by the authors of nmh.  See the
- * COPYRIGHT file in the root directory of the nmh distribution for
- * complete copyright information.
- */
+** mhshow.c -- display the contents of MIME messages
+**
+** This code is Copyright (c) 2002, by the authors of nmh.  See the
+** COPYRIGHT file in the root directory of the nmh distribution for
+** complete copyright information.
+*/
 
 #include <h/mh.h>
 #include <fcntl.h>
 
 #include <h/mh.h>
 #include <fcntl.h>
@@ -58,8 +58,8 @@ static struct swit switches[] = {
        { "help", 0 },
 
 /*
        { "help", 0 },
 
 /*
- * switches for moreproc/mhlproc
- */
+** switches for moreproc/mhlproc
+*/
 #define PROGSW  16
        { "moreproc program", -4 },
 #define NPROGSW  17
 #define PROGSW  16
        { "moreproc program", -4 },
 #define NPROGSW  17
@@ -70,8 +70,8 @@ static struct swit switches[] = {
        { "width columns", -4 },
 
 /*
        { "width columns", -4 },
 
 /*
- * switches for debugging
- */
+** switches for debugging
+*/
 #define DEBUGSW  20
        { "debug", -5 },
        { NULL, 0 }
 #define DEBUGSW  20
        { "debug", -5 },
        { NULL, 0 }
@@ -125,8 +125,8 @@ extern CT *cts;
 void freects_done (int) NORETURN;
 
 /*
 void freects_done (int) NORETURN;
 
 /*
- * static prototypes
- */
+** static prototypes
+*/
 static RETSIGTYPE pipeser (int);
 
 
 static RETSIGTYPE pipeser (int);
 
 
@@ -156,8 +156,8 @@ main (int argc, char **argv)
        argp = arguments;
 
        /*
        argp = arguments;
 
        /*
-        * Parse arguments
-        */
+       ** Parse arguments
+       */
        while ((cp = *argp++)) {
                if (*cp == '-') {
                        switch (smatch (++cp, switches)) {
        while ((cp = *argp++)) {
                if (*cp == '-') {
                        switch (smatch (++cp, switches)) {
@@ -183,7 +183,8 @@ main (int argc, char **argv)
                                icachesw = &wcachesw;
 do_cache:
                                if (!(cp = *argp++) || *cp == '-')
                                icachesw = &wcachesw;
 do_cache:
                                if (!(cp = *argp++) || *cp == '-')
-                                       adios (NULL, "missing argument to %s", argp[-2]);
+                                       adios (NULL, "missing argument to %s",
+                                                       argp[-2]);
                                switch (*icachesw = smatch (cp, caches)) {
                                case AMBIGSW:
                                        ambigsw (cp, caches);
                                switch (*icachesw = smatch (cp, caches)) {
                                case AMBIGSW:
                                        ambigsw (cp, caches);
@@ -218,7 +219,8 @@ do_cache:
 
                        case PARTSW:
                                if (!(cp = *argp++) || *cp == '-')
 
                        case PARTSW:
                                if (!(cp = *argp++) || *cp == '-')
-                                       adios (NULL, "missing argument to %s", argp[-2]);
+                                       adios (NULL, "missing argument to %s",
+                                                       argp[-2]);
                                if (npart >= NPARTS)
                                        adios (NULL, "too many parts (starting with %s), %d max",
                                                   cp, NPARTS);
                                if (npart >= NPARTS)
                                        adios (NULL, "too many parts (starting with %s), %d max",
                                                   cp, NPARTS);
@@ -227,7 +229,8 @@ do_cache:
 
                        case TYPESW:
                                if (!(cp = *argp++) || *cp == '-')
 
                        case TYPESW:
                                if (!(cp = *argp++) || *cp == '-')
-                                       adios (NULL, "missing argument to %s", argp[-2]);
+                                       adios (NULL, "missing argument to %s",
+                                                       argp[-2]);
                                if (ntype >= NTYPES)
                                        adios (NULL, "too many types (starting with %s), %d max",
                                                   cp, NTYPES);
                                if (ntype >= NTYPES)
                                        adios (NULL, "too many types (starting with %s), %d max",
                                                   cp, NTYPES);
@@ -236,24 +239,27 @@ do_cache:
 
                        case FILESW:
                                if (!(cp = *argp++) || (*cp == '-' && cp[1]))
 
                        case FILESW:
                                if (!(cp = *argp++) || (*cp == '-' && cp[1]))
-                                       adios (NULL, "missing argument to %s", argp[-2]);
+                                       adios (NULL, "missing argument to %s",
+                                                       argp[-2]);
                                file = *cp == '-' ? cp : path (cp, TFILE);
                                continue;
 
                        case FORMSW:
                                if (!(cp = *argp++) || *cp == '-')
                                file = *cp == '-' ? cp : path (cp, TFILE);
                                continue;
 
                        case FORMSW:
                                if (!(cp = *argp++) || *cp == '-')
-                                       adios (NULL, "missing argument to %s", argp[-2]);
+                                       adios (NULL, "missing argument to %s",
+                                                       argp[-2]);
                                if (formsw)
                                        free (formsw);
                                formsw = getcpy (etcpath (cp));
                                continue;
 
                        /*
                                if (formsw)
                                        free (formsw);
                                formsw = getcpy (etcpath (cp));
                                continue;
 
                        /*
-                        * Switches for moreproc/mhlproc
-                        */
+                       ** Switches for moreproc/mhlproc
+                       */
                        case PROGSW:
                                if (!(progsw = *argp++) || *progsw == '-')
                        case PROGSW:
                                if (!(progsw = *argp++) || *progsw == '-')
-                                       adios (NULL, "missing argument to %s", argp[-2]);
+                                       adios (NULL, "missing argument to %s",
+                                                       argp[-2]);
                                continue;
                        case NPROGSW:
                                nomore++;
                                continue;
                        case NPROGSW:
                                nomore++;
@@ -262,7 +268,8 @@ do_cache:
                        case LENSW:
                        case WIDTHSW:
                                if (!(cp = *argp++) || *cp == '-')
                        case LENSW:
                        case WIDTHSW:
                                if (!(cp = *argp++) || *cp == '-')
-                                       adios (NULL, "missing argument to %s", argp[-2]);
+                                       adios (NULL, "missing argument to %s",
+                                                       argp[-2]);
                                continue;
 
                        case VERBSW:
                                continue;
 
                        case VERBSW:
@@ -297,20 +304,21 @@ do_cache:
        }
 
        /*
        }
 
        /*
-        * Check if we've specified an additional profile
-        */
+       ** Check if we've specified an additional profile
+       */
        if ((cp = getenv ("MHSHOW"))) {
                if ((fp = fopen (cp, "r"))) {
                        readconfig ((struct node **) 0, fp, cp, 0);
                        fclose (fp);
                } else {
        if ((cp = getenv ("MHSHOW"))) {
                if ((fp = fopen (cp, "r"))) {
                        readconfig ((struct node **) 0, fp, cp, 0);
                        fclose (fp);
                } else {
-                       admonish ("", "unable to read $MHSHOW profile (%s)", cp);
+                       admonish ("", "unable to read $MHSHOW profile (%s)",
+                                       cp);
                }
        }
 
        /*
                }
        }
 
        /*
-        * Read the standard profile setup
-        */
+       ** Read the standard profile setup
+       */
        if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) {
                readconfig ((struct node **) 0, fp, cp, 0);
                fclose (fp);
        if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) {
                readconfig ((struct node **) 0, fp, cp, 0);
                fclose (fp);
@@ -326,10 +334,10 @@ do_cache:
        cache_private = getcpy (m_maildir (cache_private));
 
        /*
        cache_private = getcpy (m_maildir (cache_private));
 
        /*
-        * Check for storage directory.  If specified,
-        * then store temporary files there.  Else we
-        * store them in standard nmh directory.
-        */
+       ** Check for storage directory.  If specified,
+       ** then store temporary files there.  Else we
+       ** store them in standard nmh directory.
+       */
        if ((cp = context_find (nmhstorage)) && *cp)
                tmp = concat (cp, "/", invo_name, NULL);
        else
        if ((cp = context_find (nmhstorage)) && *cp)
                tmp = concat (cp, "/", invo_name, NULL);
        else
@@ -342,8 +350,8 @@ do_cache:
                adios (NULL, "cannot specify msg and file at same time!");
 
        /*
                adios (NULL, "cannot specify msg and file at same time!");
 
        /*
-        * check if message is coming from file
-        */
+       ** check if message is coming from file
+       */
        if (file) {
                if (!(cts = (CT *) calloc ((size_t) 2, sizeof(*cts))))
                        adios (NULL, "out of memory");
        if (file) {
                if (!(cts = (CT *) calloc ((size_t) 2, sizeof(*cts))))
                        adios (NULL, "out of memory");
@@ -353,8 +361,8 @@ do_cache:
                        *ctp++ = ct;
        } else {
                /*
                        *ctp++ = ct;
        } else {
                /*
-                * message(s) are coming from a folder
-                */
+               ** message(s) are coming from a folder
+               */
                if (!msgs.size)
                        app_msgarg(&msgs, "cur");
                if (!folder)
                if (!msgs.size)
                        app_msgarg(&msgs, "cur");
                if (!folder)
@@ -378,10 +386,10 @@ do_cache:
                                done (1);
 
                /*
                                done (1);
 
                /*
-                * Set the SELECT_UNSEEN bit for all the SELECTED messages,
-                * since we will use that as a tag to know which messages
-                * to remove from the "unseen" sequence.
-                */
+               ** Set the SELECT_UNSEEN bit for all the SELECTED messages,
+               ** since we will use that as a tag to know which messages
+               ** to remove from the "unseen" sequence.
+               */
                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
                        if (is_selected(mp, msgnum))
                                set_unseen (mp, msgnum);
                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
                        if (is_selected(mp, msgnum))
                                set_unseen (mp, msgnum);
@@ -389,13 +397,14 @@ do_cache:
                seq_setprev (mp);  /* set the Previous-Sequence */
                seq_setunseen (mp, 1);  /* unset the Unseen-Sequence */
 
                seq_setprev (mp);  /* set the Previous-Sequence */
                seq_setunseen (mp, 1);  /* unset the Unseen-Sequence */
 
-               if (!(cts = (CT *) calloc ((size_t) (mp->numsel + 1), sizeof(*cts))))
+               if (!(cts = (CT *) calloc ((size_t) (mp->numsel + 1),
+                               sizeof(*cts))))
                        adios (NULL, "out of memory");
                ctp = cts;
 
                /*
                        adios (NULL, "out of memory");
                ctp = cts;
 
                /*
-                * Parse all the SELECTED messages.
-                */
+               ** Parse all the SELECTED messages.
+               */
                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
                        if (is_selected(mp, msgnum)) {
                                char *msgnam;
                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
                        if (is_selected(mp, msgnum)) {
                                char *msgnam;
@@ -415,8 +424,8 @@ do_cache:
        SIGNAL (SIGPIPE, pipeser);
 
        /*
        SIGNAL (SIGPIPE, pipeser);
 
        /*
-        * Get the associated umask for the relevant contents.
-        */
+       ** Get the associated umask for the relevant contents.
+       */
        for (ctp = cts; *ctp; ctp++) {
                struct stat st;
 
        for (ctp = cts; *ctp; ctp++) {
                struct stat st;
 
@@ -430,8 +439,8 @@ do_cache:
        }
 
        /*
        }
 
        /*
-        * Show the message content
-        */
+       ** Show the message content
+       */
        show_all_messages (cts);
 
        /* Now free all the structures for the content */
        show_all_messages (cts);
 
        /* Now free all the structures for the content */