date and time created 83/02/11 15:44:29 by rrh
[unix-history] / usr / src / usr.bin / mail / aux.c
index 33991dc..cac91df 100644 (file)
@@ -10,7 +10,7 @@
  * Auxiliary functions.
  */
 
  * Auxiliary functions.
  */
 
-static char *SccsId = "@(#)aux.c       2.4 %G%";
+static char *SccsId = "@(#)aux.c       2.8 %G%";
 
 /*
  * Return a pointer to a dynamic copy of the argument.
 
 /*
  * Return a pointer to a dynamic copy of the argument.
@@ -122,20 +122,6 @@ isdir(name)
        return((sbuf.st_mode & S_IFMT) == S_IFDIR);
 }
 
        return((sbuf.st_mode & S_IFMT) == S_IFDIR);
 }
 
-/*
- * Compute the size in characters of the passed message
- */
-
-unsigned int
-msize(messp)
-       struct message *messp;
-{
-       register struct message *mp;
-
-       mp = messp;
-       return(mp->m_size);
-}
-
 /*
  * Count the number of arguments in the given string raw list.
  */
 /*
  * Count the number of arguments in the given string raw list.
  */
@@ -372,6 +358,21 @@ icequal(s1, s2)
        return(0);
 }
 
        return(0);
 }
 
+/*
+ * Copy a string, lowercasing it as we go.
+ */
+istrcpy(dest, src)
+       char *dest, *src;
+{
+       register char *cp, *cp2;
+
+       cp2 = dest;
+       cp = src;
+       do {
+               *cp2++ = little(*cp);
+       } while (*cp++ != 0);
+}
+
 /*
  * The following code deals with input stacking to do source
  * commands.  All but the current file pointer are saved on
 /*
  * The following code deals with input stacking to do source
  * commands.  All but the current file pointer are saved on
@@ -607,7 +608,7 @@ name1(mp, reptype)
        register FILE *ibuf;
        int first = 1;
 
        register FILE *ibuf;
        int first = 1;
 
-#ifndef DELIVERMAIL
+#ifndef SENDMAIL
        if ((cp = hfield("from", mp)) != NOSTR)
                return(cp);
        if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR)
        if ((cp = hfield("from", mp)) != NOSTR)
                return(cp);
        if (reptype == 0 && (cp = hfield("sender", mp)) != NOSTR)
@@ -753,3 +754,20 @@ strncmp(as1, as2, an)
        return(n<0 ? 0 : *s1 - *--s2);
 }
 
        return(n<0 ? 0 : *s1 - *--s2);
 }
 
+/*
+ * See if the given header field is supposed to be ignored.
+ */
+isign(field)
+       char *field;
+{
+       char realfld[BUFSIZ];
+       register int h;
+       register struct ignore *igp;
+
+       istrcpy(realfld, field);
+       h = hash(realfld);
+       for (igp = ignore[h]; igp != 0; igp = igp->i_link)
+               if (strcmp(igp->i_field, realfld) == 0)
+                       return(1);
+       return(0);
+}