]> diplodocus.org Git - nmh/blobdiff - uip/show.c
h/prototypes.h: Remove mhlsbr() prototype; no such function.
[nmh] / uip / show.c
index 25ede029d4b8e35571a0dd7c3428f7cf7c924488..699b77b0b8170eb3bb80bd238da6ab5706af1f9c 100644 (file)
@@ -5,10 +5,35 @@
  * complete copyright information.
  */
 
  * complete copyright information.
  */
 
-#include <h/mh.h>
-#include <h/mime.h>
+#include "h/mh.h"
+#include "mhlsbr.h"
+#include "sbr/m_name.h"
+#include "sbr/m_getfld.h"
+#include "sbr/getarguments.h"
+#include "sbr/seq_setunseen.h"
+#include "sbr/seq_setprev.h"
+#include "sbr/seq_setcur.h"
+#include "sbr/seq_save.h"
+#include "sbr/smatch.h"
+#include "sbr/r1bindex.h"
+#include "sbr/uprf.h"
+#include "sbr/check_charset.h"
+#include "sbr/m_draft.h"
+#include "sbr/m_convert.h"
+#include "sbr/getfolder.h"
+#include "sbr/folder_read.h"
+#include "sbr/context_save.h"
+#include "sbr/context_replace.h"
+#include "sbr/context_find.h"
+#include "sbr/ambigsw.h"
+#include "sbr/path.h"
+#include "sbr/print_version.h"
+#include "sbr/print_help.h"
+#include "sbr/arglist.h"
+#include "sbr/error.h"
+#include "h/mime.h"
 #include "h/done.h"
 #include "h/done.h"
-#include <h/utils.h>
+#include "h/utils.h"
 #include "sbr/m_maildir.h"
 
 #define SHOW_SWITCHES \
 #include "sbr/m_maildir.h"
 
 #define SHOW_SWITCHES \
@@ -66,8 +91,11 @@ static int is_nontext(char *);
 int
 main (int argc, char **argv)
 {
 int
 main (int argc, char **argv)
 {
-    int draftsw = 0, headersw = 1;
-    int nshow = 0, checkmime = 1, mime = 0;
+    bool draftsw = false;
+    bool headersw = true;
+    bool nshow = false;
+    bool checkmime = true;
+    bool mime = false;
     int isdf = 0, mode = SHOW, msgnum;
     char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
     char buf[BUFSIZ], **argp, **arguments;
     int isdf = 0, mode = SHOW, msgnum;
     char *cp, *maildir, *file = NULL, *folder = NULL, *proc, *program;
     char buf[BUFSIZ], **argp, **arguments;
@@ -93,10 +121,10 @@ main (int argc, char **argv)
                    done (1);
 
                case HEADSW:
                    done (1);
 
                case HEADSW:
-                   headersw = 1;
+                   headersw = true;
                    goto non_mhl_switches;
                case NHEADSW:
                    goto non_mhl_switches;
                case NHEADSW:
-                   headersw = 0;
+                   headersw = false;
                    /* FALLTHRU */
                case CONCATSW:
                case NCONCATSW:
                    /* FALLTHRU */
                case CONCATSW:
                case NCONCATSW:
@@ -124,7 +152,7 @@ non_mhl_switches:
                case DRFTSW:
                    if (file)
                        die("only one file at a time!");
                case DRFTSW:
                    if (file)
                        die("only one file at a time!");
-                   draftsw++;
+                   draftsw = true;
                    if (mode == SHOW)
                        continue;
 usage:
                    if (mode == SHOW)
                        continue;
 usage:
@@ -166,22 +194,22 @@ usage:
                case SHOWSW:
                    if (!(showproc = *argp++) || *showproc == '-')
                        die("missing argument to %s", argp[-2]);
                case SHOWSW:
                    if (!(showproc = *argp++) || *showproc == '-')
                        die("missing argument to %s", argp[-2]);
-                   nshow = 0;
+                   nshow = false;
                    continue;
                case NSHOWSW:
                    continue;
                case NSHOWSW:
-                   nshow++;
+                   nshow = true;
                    continue;
 
                case SHOWMIMESW:
                    if (!(showmimeproc = *argp++) || *showmimeproc == '-')
                        die("missing argument to %s", argp[-2]);
                    continue;
 
                case SHOWMIMESW:
                    if (!(showmimeproc = *argp++) || *showmimeproc == '-')
                        die("missing argument to %s", argp[-2]);
-                   nshow = 0;
+                   nshow = false;
                    continue;
                case CHECKMIMESW:
                    continue;
                case CHECKMIMESW:
-                   checkmime++;
+                   checkmime = true;
                    continue;
                case NOCHECKMIMESW:
                    continue;
                case NOCHECKMIMESW:
-                   checkmime = 0;
+                   checkmime = false;
                    continue;
            }
        }
                    continue;
            }
        }
@@ -206,7 +234,7 @@ usage:
            app_msgarg(&vec, mh_xstrdup(m_draft(folder, NULL, 1, &isdf)));
        else
            app_msgarg(&vec, file);
            app_msgarg(&vec, mh_xstrdup(m_draft(folder, NULL, 1, &isdf)));
        else
            app_msgarg(&vec, file);
-       headersw = 0;
+       headersw = false;
        goto go_to_it;
     }
 
        goto go_to_it;
     }
 
@@ -279,13 +307,13 @@ go_to_it: ;
                /* loop through selected messages and check for MIME */
                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
                    if (is_selected (mp, msgnum) && is_nontext (m_name (msgnum))) {
                /* loop through selected messages and check for MIME */
                for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
                    if (is_selected (mp, msgnum) && is_nontext (m_name (msgnum))) {
-                       mime = 1;
+                       mime = true;
                        break;
                    }
            } else {
                /* check the file or draft for MIME */
                if (is_nontext (vec.msgs[vec.size - 1]))
                        break;
                    }
            } else {
                /* check the file or draft for MIME */
                if (is_nontext (vec.msgs[vec.size - 1]))
-                   mime = 1;
+                   mime = true;
            }
        }
 
            }
        }