home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / TELECOM / OSKBox.lzh / MAILBOX / CC / beacon.c next >
C/C++ Source or Header  |  1991-02-14  |  893b  |  45 lines

  1. #include <stdio.h>
  2. #include "mailbox.h"
  3.  
  4.  
  5. #define MAXCALL 100
  6.  
  7. struct userstruct user;
  8.  
  9. main (argc, argv)
  10. char *argv[];
  11. {
  12.     struct msg_header *head;
  13.     int path;
  14.     int time;
  15.     char calls[MAXCALL][8];
  16.     int i, max, flag;
  17.     char line[MAXCALL*10], *p;
  18.  
  19.     chdir (HOME);
  20.     strcpy (user.uscall, "SYSOP");
  21.     user.usopt = ISSUPER;
  22.     flag = max = 0;
  23.     open_mail ();
  24.     while ((head = next_mail (is_new)) != NULL && max < MAXCALL) {
  25.         if (*head->mhbbs && !is_at (head, MYCALL))
  26.             continue;
  27.         if (is_to (head, MYCALL) || is_to (head, "WP") || is_to (head, "WPAGE"))
  28.             continue;
  29.         for (i = 0; i < max; i++)
  30.             if (is_to (head, calls[i])) break;
  31.         if (i == max)
  32.             strcpy (calls[max++], head->mhto);
  33.         flag = 1;
  34.         }
  35.     close_mail ();
  36.     if (flag) {
  37.         p = line;
  38.         p += sprintf (p, "Mail for:");
  39.         for (i = 0; i < max; i++)
  40.             p += sprintf (p, " %s", calls[i]);
  41.         p += sprintf (p, "\n");
  42.         writeln (1, line, p-line);
  43.         }
  44.     }
  45.