Annotation of 41BSD/cmd/ucbmail/v6.local.c, revision 1.1.1.1

1.1       root        1: #
                      2: 
                      3: /*
                      4:  * Mail -- a mail program
                      5:  *
                      6:  * Unix version 6.0
                      7:  *
                      8:  * Local routines that are installation dependent.
                      9:  * All fiddlers please note:  if you make careful note of
                     10:  * what you change here, I will incorporate your changes and
                     11:  * you won't have to remake them each release.
                     12:  */
                     13: 
                     14: #include "rcv.h"
                     15: 
                     16: /*
                     17:  * Locate the user's mailbox file (ie, the place where new, unread
                     18:  * mail is queued).  In Version 6, it is in ~/.mail
                     19:  */
                     20: 
                     21: findmail()
                     22: {
                     23:        register char *cp;
                     24: 
                     25:        cp = copy(homedir, mailname);
                     26:        copy("/.mail", cp);
                     27: }
                     28: 
                     29: /*
                     30:  * Get rid of the queued mail.
                     31:  */
                     32: 
                     33: demail()
                     34: {
                     35:        close(creat(mailname, 0666));
                     36:        alter(mailname);
                     37: }
                     38: 
                     39: /*
                     40:  * Get an environment variable.  At present, we only support
                     41:  * "SHELL" and "HOME".  This routine makes use of the getpw
                     42:  * routine in the neighboring getname.c stuff.
                     43:  */
                     44: 
                     45: char *
                     46: getenv(name)
                     47:        char name[];
                     48: {
                     49:        char pwline[LINESIZE];
                     50:        static char val[30];
                     51:        register char *cp, *dp;
                     52:        register int cc;
                     53: 
                     54:        if (equal(name, "SHELL"))
                     55:                cc = 6;
                     56:        else if (equal(name, "HOME"))
                     57:                cc = 5;
                     58:        else
                     59:                return(NOSTR);
                     60:        if (getpw(uid, pwline) < 0)
                     61:                return(NOSTR);
                     62:        for (cp = pwline; *cp && cc > 0;)
                     63:                if (*cp++ == ':')
                     64:                        cc--;
                     65:        dp = cp;
                     66:        while (*cp != ':' && *cp != '\0')
                     67:                cp++;
                     68:        *cp = '\0';
                     69:        if (*dp == '\0')
                     70:                return(NOSTR);
                     71:        copy(dp, val);
                     72:        return(val);
                     73: }
                     74: 
                     75: /*
                     76:  * Lock and unlock retrofits which are only
                     77:  * significant in version 7.
                     78:  */
                     79: 
                     80: lock(name)
                     81:        char *name;
                     82: {
                     83: 
                     84:        return(0);
                     85: }
                     86: 
                     87: unlock()
                     88: {
                     89: 
                     90:        return(0);
                     91: }
                     92: 
                     93: /*
                     94:  * Discover user login name.
                     95:  */
                     96: 
                     97: username(uid, namebuf)
                     98:        char namebuf[];
                     99: {
                    100: 
                    101:        return(getname(uid, namebuf));
                    102: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.