setup home directory for globbing
[unix-history] / usr / src / usr.bin / mail / cmd1.c
index a682726..942d5db 100644 (file)
@@ -8,7 +8,7 @@
  * User commands.
  */
 
  * User commands.
  */
 
-static char *SccsId = "@(#)cmd1.c      2.7 %G%";
+static char *SccsId = "@(#)cmd1.c      2.10 %G%";
 
 /*
  * Print the current active headings.
 
 /*
  * Print the current active headings.
@@ -55,6 +55,36 @@ headers(msgvec)
        return(0);
 }
 
        return(0);
 }
 
+/*
+ * Set the list of alternate names for out host.
+ */
+local(namelist)
+       char **namelist;
+{
+       register int c;
+       register char **ap, **ap2, *cp;
+
+       c = argcount(namelist) + 1;
+       if (c == 1) {
+               if (localnames == 0)
+                       return(0);
+               for (ap = localnames; *ap; ap++)
+                       printf("%s ", *ap);
+               printf("\n");
+               return(0);
+       }
+       if (localnames != 0)
+               cfree((char *) localnames);
+       localnames = (char **) calloc(c, sizeof (char *));
+       for (ap = namelist, ap2 = localnames; *ap; ap++, ap2++) {
+               cp = (char *) calloc(strlen(*ap) + 1, sizeof (char));
+               strcpy(cp, *ap);
+               *ap2 = cp;
+       }
+       *ap2 = 0;
+       return(0);
+}
+
 /*
  * Scroll to the next/previous screen
  */
 /*
  * Scroll to the next/previous screen
  */
@@ -181,7 +211,7 @@ printhead(mesg)
        if (mp->m_flag & MBOX)
                dispc = 'M';
        parse(headline, &hl, pbuf);
        if (mp->m_flag & MBOX)
                dispc = 'M';
        parse(headline, &hl, pbuf);
-       sprintf(wcount, " %d/%d", mp->m_lines, mp->m_size);
+       sprintf(wcount, " %d/%ld", mp->m_lines, mp->m_size);
        s = strlen(wcount);
        cp = wcount + s;
        while (s < 7)
        s = strlen(wcount);
        cp = wcount + s;
        while (s < 7)
@@ -231,12 +261,31 @@ pcmdlist()
 }
 
 /*
 }
 
 /*
- * Type out the messages requested.
+ * Type out messages, honor ignored fields.
+ */
+type(msgvec)
+       int *msgvec;
+{
+
+       return(type1(msgvec, 1));
+}
+
+/*
+ * Type out messages, even printing ignored fields.
  */
  */
+Type(msgvec)
+       int *msgvec;
+{
+
+       return(type1(msgvec, 0));
+}
 
 
+/*
+ * Type out the messages requested.
+ */
 jmp_buf        pipestop;
 
 jmp_buf        pipestop;
 
-type(msgvec)
+type1(msgvec, doign)
        int *msgvec;
 {
        register *ip;
        int *msgvec;
 {
        register *ip;
@@ -276,7 +325,7 @@ type(msgvec)
                touch(mesg);
                mp = &message[mesg-1];
                dot = mp;
                touch(mesg);
                mp = &message[mesg-1];
                dot = mp;
-               print(mp, obuf);
+               print(mp, obuf, doign);
        }
        if (obuf != stdout) {
                pipef = NULL;
        }
        if (obuf != stdout) {
                pipef = NULL;
@@ -305,7 +354,7 @@ brokpipe()
  * Print the indicated message on standard output.
  */
 
  * Print the indicated message on standard output.
  */
 
-print(mp, obuf)
+print(mp, obuf, doign)
        register struct message *mp;
        FILE *obuf;
 {
        register struct message *mp;
        FILE *obuf;
 {
@@ -313,7 +362,7 @@ print(mp, obuf)
        if (value("quiet") == NOSTR)
                fprintf(obuf, "Message %2d:\n", mp - &message[0] + 1);
        touch(mp - &message[0] + 1);
        if (value("quiet") == NOSTR)
                fprintf(obuf, "Message %2d:\n", mp - &message[0] + 1);
        touch(mp - &message[0] + 1);
-       send(mp, obuf);
+       send(mp, obuf, doign);
 }
 
 /*
 }
 
 /*