Source:NetHack 3.4.3/src/mail.c

From NetHackWiki
Jump to: navigation, search

Below is the full text to src/mail.c from NetHack 3.4.3. To link to a particular line, write [[mail.c#line123]], for example.

Top of file[edit]

  1. /*	SCCS Id: @(#)mail.c	3.4	2002/01/13	*/
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

  1. #include "hack.h"
  2.  
  3. #ifdef MAIL
  4. #include "mail.h"
  5.  
  6. /*
  7. * Notify user when new mail has arrived.  Idea by Merlyn Leroy.
  8. *
  9. * The mail daemon can move with less than usual restraint.  It can:
  10. *	- move diagonally from a door
  11. *	- use secret and closed doors
  12. *	- run through a monster ("Gangway!", etc.)
  13. *	- run over pools & traps
  14. *
  15. * Possible extensions:
  16. *	- Open the file MAIL and do fstat instead of stat for efficiency.
  17. *	  (But sh uses stat, so this cannot be too bad.)
  18. *	- Examine the mail and produce a scroll of mail named "From somebody".
  19. *	- Invoke MAILREADER in such a way that only this single letter is read.
  20. *	- Do something to the text when the scroll is enchanted or cancelled.
  21. *	- Make the daemon always appear at a stairwell, and have it find a
  22. *	  path to the hero.
  23. *
  24. * Note by Olaf Seibert: On the Amiga, we usually don't get mail.  So we go
  25. *			 through most of the effects at 'random' moments.
  26. * Note by Paul Winner:  The MSDOS port also 'fakes' the mail daemon at
  27. *			 random intervals.
  28. */
  29.  
  30. STATIC_DCL boolean FDECL(md_start,(coord *));
  31. STATIC_DCL boolean FDECL(md_stop,(coord *, coord *));
  32. STATIC_DCL boolean FDECL(md_rush,(struct monst *,int,int));
  33. STATIC_DCL void FDECL(newmail, (struct mail_info *));
  34.  
  35. extern char *viz_rmin, *viz_rmax;	/* line-of-sight limits (vision.c) */
  36.  
  37. #ifdef OVL0
  38.  
  39. # if !defined(UNIX) && !defined(VMS) && !defined(LAN_MAIL)
  40. int mustgetmail = -1;
  41. # endif
  42.  
  43. #endif /* OVL0 */
  44. #ifdef OVLB
  45.  
  46. # ifdef UNIX
  47. #include <sys/stat.h>
  48. #include <pwd.h>
  49. /* DON'T trust all Unices to declare getpwuid() in <pwd.h> */
  50. #  if !defined(_BULL_SOURCE) && !defined(__sgi) && !defined(_M_UNIX)
  51. #   if !defined(SUNOS4) && !(defined(ULTRIX) && defined(__GNUC__))
  52. /* DO trust all SVR4 to typedef uid_t in <sys/types.h> (probably to a long) */
  53. #    if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
  54. extern struct passwd *FDECL(getpwuid,(uid_t));
  55. #    else
  56. extern struct passwd *FDECL(getpwuid,(int));
  57. #    endif
  58. #   endif
  59. #  endif
  60. static struct stat omstat,nmstat;
  61. static char *mailbox = (char *)0;
  62. static long laststattime;
  63.  
  64. # if !defined(MAILPATH) && defined(AMS)	/* Just a placeholder for AMS */
  65. #  define MAILPATH "/dev/null"
  66. # endif
  67. # if !defined(MAILPATH) && (defined(LINUX) || defined(__osf__))
  68. #  define MAILPATH "/var/spool/mail/"
  69. # endif
  70. # if !defined(MAILPATH) && defined(__FreeBSD__)
  71. #  define MAILPATH "/var/mail/"
  72. # endif
  73. # if !defined(MAILPATH) && (defined(BSD) || defined(ULTRIX))
  74. #  define MAILPATH "/usr/spool/mail/"
  75. # endif
  76. # if !defined(MAILPATH) && (defined(SYSV) || defined(HPUX))
  77. #  define MAILPATH "/usr/mail/"
  78. # endif

getmailstatus[edit]

  1. void
  2. getmailstatus()
  3. {
  4. 	if(!mailbox && !(mailbox = nh_getenv("MAIL"))) {
  5. #  ifdef MAILPATH
  6. #   ifdef AMS
  7. 	        struct passwd ppasswd;
  8.  
  9. 		(void) memcpy(&ppasswd, getpwuid(getuid()), sizeof(struct passwd));
  10. 		if (ppasswd.pw_dir) {
  11. 		     mailbox = (char *) alloc((unsigned) strlen(ppasswd.pw_dir)+sizeof(AMS_MAILBOX));
  12. 		     Strcpy(mailbox, ppasswd.pw_dir);
  13. 		     Strcat(mailbox, AMS_MAILBOX);
  14. 		} else
  15. 		  return;
  16. #   else
  17. 		const char *pw_name = getpwuid(getuid())->pw_name;
  18. 		mailbox = (char *) alloc(sizeof(MAILPATH)+strlen(pw_name));
  19. 		Strcpy(mailbox, MAILPATH);
  20. 		Strcat(mailbox, pw_name);
  21. #  endif /* AMS */
  22. #  else
  23. 		return;
  24. #  endif
  25. 	}
  26. 	if(stat(mailbox, &omstat)){
  27. #  ifdef PERMANENT_MAILBOX
  28. 		pline("Cannot get status of MAIL=\"%s\".", mailbox);
  29. 		mailbox = 0;
  30. #  else
  31. 		omstat.st_mtime = 0;
  32. #  endif
  33. 	}
  34. }
  35. # endif /* UNIX */
  36.  
  37. #endif /* OVLB */

md_start[edit]

  1. #ifdef OVL0
  2.  
  3. /*
  4. * Pick coordinates for a starting position for the mail daemon.  Called
  5. * from newmail() and newphone().
  6. */
  7. STATIC_OVL boolean
  8. md_start(startp)
  9. coord *startp;
  10. {
  11. coord testcc;	/* scratch coordinates */
  12. int row;		/* current row we are checking */
  13. int lax;		/* if TRUE, pick a position in sight. */
  14. int dd;		/* distance to current point */
  15. int max_distance;	/* max distance found so far */
  16.  
  17. /*
  18. * If blind and not telepathic, then it doesn't matter what we pick ---
  19. * the hero is not going to see it anyway.  So pick a nearby position.
  20. */
  21. if (Blind && !Blind_telepat) {
  22. 	if (!enexto(startp, u.ux, u.uy, (struct permonst *) 0))
  23. 	    return FALSE;	/* no good posiitons */
  24. 	return TRUE;
  25. }
  26.  
  27. /*
  28. * Arrive at an up or down stairwell if it is in line of sight from the
  29. * hero.
  30. */
  31. if (couldsee(upstair.sx, upstair.sy)) {
  32. 	startp->x = upstair.sx;
  33. 	startp->y = upstair.sy;
  34. 	return TRUE;
  35. }
  36. if (couldsee(dnstair.sx, dnstair.sy)) {
  37. 	startp->x = dnstair.sx;
  38. 	startp->y = dnstair.sy;
  39. 	return TRUE;
  40. }
  41.  
  42. /*
  43. * Try to pick a location out of sight next to the farthest position away
  44. * from the hero.  If this fails, try again, just picking the farthest
  45. * position that could be seen.  What we really ought to be doing is
  46. * finding a path from a stairwell...
  47. *
  48. * The arrays viz_rmin[] and viz_rmax[] are set even when blind.  These
  49. * are the LOS limits for each row.
  50. */
  51. lax = 0;	/* be picky */
  52. max_distance = -1;
  53. retry:
  54. for (row = 0; row < ROWNO; row++) {
  55. 	if (viz_rmin[row] < viz_rmax[row]) {
  56. 	    /* There are valid positions on this row. */
  57. 	    dd = distu(viz_rmin[row],row);
  58. 	    if (dd > max_distance) {
  59. 		if (lax) {
  60. 		    max_distance = dd;
  61. 		    startp->y = row;
  62. 		    startp->x = viz_rmin[row];
  63.  
  64. 		} else if (enexto(&testcc, (xchar)viz_rmin[row], row,
  65. 						(struct permonst *) 0) &&
  66. 			   !cansee(testcc.x, testcc.y) &&
  67. 			   couldsee(testcc.x, testcc.y)) {
  68. 		    max_distance = dd;
  69. 		    *startp = testcc;
  70. 		}
  71. 	    }
  72. 	    dd = distu(viz_rmax[row],row);
  73. 	    if (dd > max_distance) {
  74. 		if (lax) {
  75. 		    max_distance = dd;
  76. 		    startp->y = row;
  77. 		    startp->x = viz_rmax[row];
  78.  
  79. 		} else if (enexto(&testcc, (xchar)viz_rmax[row], row,
  80. 						(struct permonst *) 0) &&
  81. 			   !cansee(testcc.x,testcc.y) &&
  82. 			   couldsee(testcc.x, testcc.y)) {
  83.  
  84. 		    max_distance = dd;
  85. 		    *startp = testcc;
  86. 		}
  87. 	    }
  88. 	}
  89. }
  90.  
  91. if (max_distance < 0) {
  92. 	if (!lax) {
  93. 	    lax = 1;		/* just find a position */
  94. 	    goto retry;
  95. 	}
  96. 	return FALSE;
  97. }
  98.  
  99. return TRUE;
  100. }

md_stop[edit]

  1. /*
  2. * Try to choose a stopping point as near as possible to the starting
  3. * position while still adjacent to the hero.  If all else fails, try
  4. * enexto().  Use enexto() as a last resort because enexto() chooses
  5. * its point randomly, which is not what we want.
  6. */
  7. STATIC_OVL boolean
  8. md_stop(stopp, startp)
  9. coord *stopp;	/* stopping position (we fill it in) */
  10. coord *startp;	/* starting positon (read only) */
  11. {
  12. int x, y, distance, min_distance = -1;
  13.  
  14. for (x = u.ux-1; x <= u.ux+1; x++)
  15. 	for (y = u.uy-1; y <= u.uy+1; y++) {
  16. 	    if (!isok(x, y) || (x == u.ux && y == u.uy)) continue;
  17.  
  18. 	    if (ACCESSIBLE(levl[x][y].typ) && !MON_AT(x,y)) {
  19. 		distance = dist2(x,y,startp->x,startp->y);
  20. 		if (min_distance < 0 || distance < min_distance ||
  21. 			(distance == min_distance && rn2(2))) {
  22. 		    stopp->x = x;
  23. 		    stopp->y = y;
  24. 		    min_distance = distance;
  25. 		}
  26. 	    }
  27. 	}
  28.  
  29. /* If we didn't find a good spot, try enexto(). */
  30. if (min_distance < 0 &&
  31. 		!enexto(stopp, u.ux, u.uy, &mons[PM_MAIL_DAEMON]))
  32. 	return FALSE;
  33.  
  34. return TRUE;
  35. }

md_rush[edit]

  1. /* Let the mail daemon have a larger vocabulary. */
  2. static NEARDATA const char *mail_text[] = {
  3. "Gangway!",
  4. "Look out!",
  5. "Pardon me!"
  6. };
  7. #define md_exclamations()	(mail_text[rn2(3)])
  8.  
  9. /*
  10. * Make the mail daemon run through the dungeon.  The daemon will run over
  11. * any monsters that are in its path, but will replace them later.  Return
  12. * FALSE if the md gets stuck in a position where there is a monster.  Return
  13. * TRUE otherwise.
  14. */
  15. STATIC_OVL boolean
  16. md_rush(md,tx,ty)
  17. struct monst *md;
  18. register int tx, ty;		/* destination of mail daemon */
  19. {
  20. struct monst *mon;			/* displaced monster */
  21. register int dx, dy;		/* direction counters */
  22. int fx = md->mx, fy = md->my;	/* current location */
  23. int nfx = fx, nfy = fy,		/* new location */
  24. 	d1, d2;				/* shortest distances */
  25.  
  26. /*
  27. * It is possible that the monster at (fx,fy) is not the md when:
  28. * the md rushed the hero and failed, and is now starting back.
  29. */
  30. if (m_at(fx, fy) == md) {
  31. 	remove_monster(fx, fy);		/* pick up from orig position */
  32. 	newsym(fx, fy);
  33. }
  34.  
  35. /*
  36. * At the beginning and exit of this loop, md is not placed in the
  37. * dungeon.
  38. */
  39. while (1) {
  40. 	/* Find a good location next to (fx,fy) closest to (tx,ty). */
  41. 	d1 = dist2(fx,fy,tx,ty);
  42. 	for (dx = -1; dx <= 1; dx++) for(dy = -1; dy <= 1; dy++)
  43. 	    if ((dx || dy) && isok(fx+dx,fy+dy) &&
  44. 				       !IS_STWALL(levl[fx+dx][fy+dy].typ)) {
  45. 		d2 = dist2(fx+dx,fy+dy,tx,ty);
  46. 		if (d2 < d1) {
  47. 		    d1 = d2;
  48. 		    nfx = fx+dx;
  49. 		    nfy = fy+dy;
  50. 		}
  51. 	    }
  52.  
  53. 	/* Break if the md couldn't find a new position. */
  54. 	if (nfx == fx && nfy == fy) break;
  55.  
  56. 	fx = nfx;			/* this is our new position */
  57. 	fy = nfy;
  58.  
  59. 	/* Break if the md reaches its destination. */
  60. 	if (fx == tx && fy == ty) break;
  61.  
  62. 	if ((mon = m_at(fx,fy)) != 0)	/* save monster at this position */
  63. 	    verbalize(md_exclamations());
  64. 	else if (fx == u.ux && fy == u.uy)
  65. 	    verbalize("Excuse me.");
  66.  
  67. 	place_monster(md,fx,fy);	/* put md down */
  68. 	newsym(fx,fy);			/* see it */
  69. 	flush_screen(0);		/* make sure md shows up */
  70. 	delay_output();			/* wait a little bit */
  71.  
  72. 	/* Remove md from the dungeon.  Restore original mon, if necessary. */
  73. 	if (mon) {
  74. 	    if ((mon->mx != fx) || (mon->my != fy))
  75. 		place_worm_seg(mon, fx, fy);
  76. 	    else
  77. 		place_monster(mon, fx, fy);
  78. 	} else
  79. 	    remove_monster(fx, fy);
  80. 	newsym(fx,fy);
  81. }
  82.  
  83. /*
  84. * Check for a monster at our stopping position (this is possible, but
  85. * very unlikely).  If one exists, then have the md leave in disgust.
  86. */
  87. if ((mon = m_at(fx, fy)) != 0) {
  88. 	place_monster(md, fx, fy);	/* display md with text below */
  89. 	newsym(fx, fy);
  90. 	verbalize("This place's too crowded.  I'm outta here.");
  91.  
  92. 	if ((mon->mx != fx) || (mon->my != fy))	/* put mon back */
  93. 	    place_worm_seg(mon, fx, fy);
  94. 	else
  95. 	    place_monster(mon, fx, fy);
  96.  
  97. 	newsym(fx, fy);
  98. 	return FALSE;
  99. }
  100.  
  101. place_monster(md, fx, fy);	/* place at final spot */
  102. newsym(fx, fy);
  103. flush_screen(0);
  104. delay_output();			/* wait a little bit */
  105.  
  106. return TRUE;
  107. }

newmail[edit]

  1. /* Deliver a scroll of mail. */
  2. /*ARGSUSED*/
  3. STATIC_OVL void
  4. newmail(info)
  5. struct mail_info *info;
  6. {
  7. struct monst *md;
  8. coord start, stop;
  9. boolean message_seen = FALSE;
  10.  
  11. /* Try to find good starting and stopping places. */
  12. if (!md_start(&start) || !md_stop(&stop,&start)) goto give_up;
  13.  
  14. /* Make the daemon.  Have it rush towards the hero. */
  15. if (!(md = makemon(&mons[PM_MAIL_DAEMON], start.x, start.y, NO_MM_FLAGS)))
  16. 	 goto give_up;
  17. if (!md_rush(md, stop.x, stop.y)) goto go_back;
  18.  
  19. message_seen = TRUE;
  20. verbalize("%s, %s!  %s.", Hello(md), plname, info->display_txt);
  21.  
  22. if (info->message_typ) {
  23. 	struct obj *obj = mksobj(SCR_MAIL, FALSE, FALSE);
  24. 	if (distu(md->mx,md->my) > 2)
  25. 	    verbalize("Catch!");
  26. 	display_nhwindow(WIN_MESSAGE, FALSE);
  27. 	if (info->object_nam) {
  28. 	    obj = oname(obj, info->object_nam);
  29. 	    if (info->response_cmd) {	/*(hide extension of the obj name)*/
  30. 		int namelth = info->response_cmd - info->object_nam - 1;
  31. 		if ( namelth <= 0 || namelth >= (int) obj->onamelth )
  32. 		    impossible("mail delivery screwed up");
  33. 		else
  34. 		    *(ONAME(obj) + namelth) = '\0';
  35. 		/* Note: renaming object will discard the hidden command. */
  36. 	    }
  37. 	}
  38. 	obj = hold_another_object(obj, "Oops!",
  39. 				  (const char *)0, (const char *)0);
  40. }
  41.  
  42. /* zip back to starting location */
  43. go_back:
  44. (void) md_rush(md, start.x, start.y);
  45. mongone(md);
  46. /* deliver some classes of messages even if no daemon ever shows up */
  47. give_up:
  48. if (!message_seen && info->message_typ == MSG_OTHER)
  49. 	pline("Hark!  \"%s.\"", info->display_txt);
  50. }

Miscellaneous systems[edit]

  1. # if !defined(UNIX) && !defined(VMS) && !defined(LAN_MAIL)

ckmailstatus on miscellaneous systems[edit]

  1. void
  2. ckmailstatus()
  3. {
  4. 	if (u.uswallow || !flags.biff) return;
  5. 	if (mustgetmail < 0) {
  6. #if defined(AMIGA) || defined(MSDOS) || defined(TOS)
  7. 	    mustgetmail=(moves<2000)?(100+rn2(2000)):(2000+rn2(3000));
  8. #endif
  9. 	    return;
  10. 	}
  11. 	if (--mustgetmail <= 0) {
  12. 		static struct mail_info
  13. 			deliver = {MSG_MAIL,"I have some mail for you",0,0};
  14. 		newmail(&deliver);
  15. 		mustgetmail = -1;
  16. 	}
  17. }

readmail on miscellaneous systems[edit]

  1. /*ARGSUSED*/
  2. void
  3. readmail(otmp)
  4. struct obj *otmp;
  5. {
  6. static char *junk[] = {
  7. "Please disregard previous letter.",
  8. "Welcome to NetHack.",
  9. #ifdef AMIGA
  10. "Only Amiga makes it possible.",
  11. "CATS have all the answers.",
  12. #endif
  13. "Report bugs to <devteam@nethack.org>.",
  14. "Invitation: Visit the NetHack web site at http://www.nethack.org!"
  15. };
  16.  
  17. if (Blind) {
  18. 	pline("Unfortunately you cannot see what it says.");
  19. } else
  20. 	pline("It reads:  \"%s\"", junk[rn2(SIZE(junk))]);
  21.  
  22. }
  23.  
  24. # endif /* !UNIX && !VMS && !LAN_MAIL */

UNIX[edit]

  1. # ifdef UNIX

ckmailstatus on UNIX[edit]

  1. void
  2. ckmailstatus()
  3. {
  4. 	if(!mailbox || u.uswallow || !flags.biff
  5. #  ifdef MAILCKFREQ
  6. 		    || moves < laststattime + MAILCKFREQ
  7. #  endif
  8. 							)
  9. 		return;
  10.  
  11. 	laststattime = moves;
  12. 	if(stat(mailbox, &nmstat)){
  13. #  ifdef PERMANENT_MAILBOX
  14. 		pline("Cannot get status of MAIL=\"%s\" anymore.", mailbox);
  15. 		mailbox = 0;
  16. #  else
  17. 		nmstat.st_mtime = 0;
  18. #  endif
  19. 	} else if(nmstat.st_mtime > omstat.st_mtime) {
  20. 		if (nmstat.st_size) {
  21. 		    static struct mail_info deliver = {
  22. #  ifndef NO_MAILREADER
  23. 			MSG_MAIL, "I have some mail for you",
  24. #  else
  25. 			/* suppress creation and delivery of scroll of mail */
  26. 			MSG_OTHER, "You have some mail in the outside world",
  27. #  endif
  28. 			0, 0
  29. 		    };
  30. 		    newmail(&deliver);
  31. 		}
  32. 		getmailstatus();	/* might be too late ... */
  33. 	}
  34. }

readmail on UNIX[edit]

  1. /*ARGSUSED*/
  2. void
  3. readmail(otmp)
  4. struct obj *otmp;
  5. {
  6. #  ifdef DEF_MAILREADER			/* This implies that UNIX is defined */
  7. 	register const char *mr = 0;
  8.  
  9. 	display_nhwindow(WIN_MESSAGE, FALSE);
  10. 	if(!(mr = nh_getenv("MAILREADER")))
  11. 		mr = DEF_MAILREADER;
  12.  
  13. 	if(child(1)){
  14. 		(void) execl(mr, mr, (char *)0);
  15. 		terminate(EXIT_FAILURE);
  16. 	}
  17. #  else
  18. #   ifndef AMS				/* AMS mailboxes are directories */
  19. 	display_file(mailbox, TRUE);
  20. #   endif /* AMS */
  21. #  endif /* DEF_MAILREADER */
  22.  
  23. 	/* get new stat; not entirely correct: there is a small time
  24. 	   window where we do not see new mail */
  25. 	getmailstatus();
  26. }
  27.  
  28. # endif /* UNIX */

VMS[edit]

  1. # ifdef VMS
  2.  
  3. extern NDECL(struct mail_info *parse_next_broadcast);
  4.  
  5. volatile int broadcasts = 0;

ckmailstatus on VMS[edit]

  1. void
  2. ckmailstatus()
  3. {
  4. struct mail_info *brdcst;
  5.  
  6. if (u.uswallow || !flags.biff) return;
  7.  
  8. while (broadcasts > 0) {	/* process all trapped broadcasts [until] */
  9. 	broadcasts--;
  10. 	if ((brdcst = parse_next_broadcast()) != 0) {
  11. 	    newmail(brdcst);
  12. 	    break;		/* only handle one real message at a time */
  13. 	}
  14. }
  15. }

readmail on VMS[edit]

  1. void
  2. readmail(otmp)
  3. struct obj *otmp;
  4. {
  5. #  ifdef SHELL	/* can't access mail reader without spawning subprocess */
  6. const char *txt, *cmd;
  7. char *p, buf[BUFSZ], qbuf[BUFSZ];
  8. int len;
  9.  
  10. /* there should be a command hidden beyond the object name */
  11. txt = otmp->onamelth ? ONAME(otmp) : "";
  12. len = strlen(txt);
  13. cmd = (len + 1 < otmp->onamelth) ? txt + len + 1 : (char *) 0;
  14. if (!cmd || !*cmd) cmd = "SPAWN";
  15.  
  16. Sprintf(qbuf, "System command (%s)", cmd);
  17. getlin(qbuf, buf);
  18. if (*buf != '\033') {
  19. 	for (p = eos(buf); p > buf; *p = '\0')
  20. 	    if (*--p != ' ') break;	/* strip trailing spaces */
  21. 	if (*buf) cmd = buf;		/* use user entered command */
  22. 	if (!strcmpi(cmd, "SPAWN") || !strcmp(cmd, "!"))
  23. 	    cmd = (char *) 0;		/* interactive escape */
  24.  
  25. 	vms_doshell(cmd, TRUE);
  26. 	(void) sleep(1);
  27. }
  28. #  endif /* SHELL */
  29. }
  30.  
  31. # endif /* VMS */

LAN mail[edit]

  1. # ifdef LAN_MAIL

ckmailstatus with LAN mail[edit]

  1. void
  2. ckmailstatus()
  3. {
  4. 	static int laststattime = 0;
  5.  
  6. 	if(u.uswallow || !flags.biff
  7. #  ifdef MAILCKFREQ
  8. 		    || moves < laststattime + MAILCKFREQ
  9. #  endif
  10. 							)
  11. 		return;
  12.  
  13. 	laststattime = moves;
  14. 	if (lan_mail_check()) {
  15. 		    static struct mail_info deliver = {
  16. #  ifndef NO_MAILREADER
  17. 			MSG_MAIL, "I have some mail for you",
  18. #  else
  19. 			/* suppress creation and delivery of scroll of mail */
  20. 			MSG_OTHER, "You have some mail in the outside world",
  21. #  endif
  22. 			0, 0
  23. 		    };
  24. 		    newmail(&deliver);
  25. 	}
  26. }

readmail with LAN mail[edit]

  1. /*ARGSUSED*/
  2. void
  3. readmail(otmp)
  4. struct obj *otmp;
  5. {
  6. 	lan_mail_read(otmp);
  7. }
  8.  
  9. # endif /* LAN_MAIL */
  10.  
  11. #endif /* OVL0 */
  12.  
  13. #endif /* MAIL */
  14.  
  15. /*mail.c*/