date and time created 80/10/08 09:52:17 by kas
authorKurt A. Schoens <kas@ucbvax.Berkeley.EDU>
Thu, 9 Oct 1980 01:52:17 +0000 (17:52 -0800)
committerKurt A. Schoens <kas@ucbvax.Berkeley.EDU>
Thu, 9 Oct 1980 01:52:17 +0000 (17:52 -0800)
SCCS-vsn: usr.bin/mail/v7.local.c 1.1

usr/src/usr.bin/mail/v7.local.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/mail/v7.local.c b/usr/src/usr.bin/mail/v7.local.c
new file mode 100644 (file)
index 0000000..efbcc1b
--- /dev/null
@@ -0,0 +1,56 @@
+#
+
+/*
+ * Mail -- a mail program
+ *
+ * Version 7
+ *
+ * Local routines that are installation dependent.
+ */
+
+#include "rcv.h"
+
+static char *SccsId = "@(#)v7.local.c  1.1 %G%";
+
+/*
+ * Locate the user's mailbox file (ie, the place where new, unread
+ * mail is queued).  In Version 7, it is in /usr/spool/mail/name.
+ */
+
+findmail()
+{
+       register char *cp;
+
+       cp = copy("/usr/spool/mail/", mailname);
+       copy(myname, cp);
+       if (isdir(mailname)) {
+               stradd(mailname, '/');
+               strcat(mailname, myname);
+       }
+}
+
+/*
+ * Get rid of the queued mail.
+ */
+
+demail()
+{
+
+       remove(mailname);
+}
+
+/*
+ * Discover user login name.
+ */
+
+username(uid, namebuf)
+       char namebuf[];
+{
+       register char *np;
+
+       if (uid == getuid() && (np = getenv("USER")) != NOSTR) {
+               strncpy(namebuf, np, 9);
+               return(0);
+       }
+       return(getname(uid, namebuf));
+}