1: #
   2: 
   3: #include "rcv.h"
   4: 
   5: /*
   6:  * Mail -- a mail program
   7:  *
   8:  * Give names to all the temporary files that we will need.
   9:  */
  10: 
  11: static char *SccsId = "@(#)temp.c	2.2 6/24/82";
  12: 
  13: char    tempMail[14];
  14: char    tempQuit[14];
  15: char    tempEdit[14];
  16: char    tempSet[14];
  17: char    tempResid[14];
  18: char    tempMesg[14];
  19: 
  20: tinit()
  21: {
  22:     register char *cp, *cp2;
  23:     char uname[PATHSIZE];
  24:     register int err = 0;
  25:     register int pid;
  26: 
  27:     pid = getpid();
  28:     sprintf(tempMail, "/tmp/Rs%05d", pid);
  29:     sprintf(tempResid, "/tmp/Rq%05d", pid);
  30:     sprintf(tempQuit, "/tmp/Rm%05d", pid);
  31:     sprintf(tempEdit, "/tmp/Re%05d", pid);
  32:     sprintf(tempSet, "/tmp/Rx%05d", pid);
  33:     sprintf(tempMesg, "/tmp/Rx%05d", pid);
  34: 
  35:     if (strlen(myname) != 0) {
  36:         uid = getuserid(myname);
  37:         if (uid == -1) {
  38:             printf("\"%s\" is not a user of this system\n",
  39:                 myname);
  40:             exit(1);
  41:         }
  42:     }
  43:     else {
  44:         uid = getuid() & UIDMASK;
  45:         if (username(uid, uname) < 0) {
  46:             copy("ubluit", myname);
  47:             err++;
  48:             if (rcvmode) {
  49:                 printf("Who are you!?\n");
  50:                 exit(1);
  51:             }
  52:         }
  53:         else
  54:             copy(uname, myname);
  55:     }
  56:     cp = value("HOME");
  57:     if (cp == NOSTR)
  58:         cp = ".";
  59:     copy(cp, homedir);
  60:     findmail();
  61:     cp = copy(homedir, mbox);
  62:     copy("/mbox", cp);
  63:     cp = copy(homedir, mailrc);
  64:     copy("/.mailrc", cp);
  65:     cp = copy(homedir, deadletter);
  66:     copy("/dead.letter", cp);
  67:     if (debug) {
  68:         printf("uid = %d, user = %s, mailname = %s\n",
  69:             uid, myname, mailname);
  70:         printf("deadletter = %s, mailrc = %s, mbox = %s\n",
  71:             deadletter, mailrc, mbox);
  72:     }
  73: }

Defined functions

tinit defined in line 20; used 1 times

Defined variables

SccsId defined in line 11; never used
tempEdit defined in line 15; used 1 times
  • in line 31
tempMail defined in line 13; used 1 times
  • in line 28
tempMesg defined in line 18; used 1 times
  • in line 33
tempQuit defined in line 14; used 1 times
  • in line 30
tempResid defined in line 17; used 1 times
  • in line 29
tempSet defined in line 16; used 1 times
  • in line 32
Last modified: 1982-06-25
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 856
Valid CSS Valid XHTML 1.0 Strict