home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume36 / uqwk / part01 / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-11  |  832 b   |  43 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "uqwk.h"
  4.  
  5. #define QWK_MAGIC "Produced by Qmail...Copyright (c) 1987 by Sparkware.  All rights Reserved"
  6.  
  7. InitStuff()
  8. /*
  9.  *  Initialize stuff
  10.  */
  11. {
  12.     char msg_fname[PATH_LEN];
  13.     int n;
  14.  
  15.     /* Mail, conference, etc. lists */
  16.     mail_list = NULL;
  17.     conf_list = NULL;
  18.     last_conf = NULL;
  19.     act_list = NULL;
  20.     nrc_list = NULL;
  21.  
  22.     /* Message and conference counts */
  23.     msg_cnt = 0;
  24.     conf_cnt = 0;
  25.  
  26.     /* Open MESSAGES.DAT */
  27.     strcpy (msg_fname, home_dir);
  28.     strcat (msg_fname, "/");
  29.     strcat (msg_fname, "messages.dat");
  30.  
  31.     if (NULL == (msg_fd = fopen (msg_fname, "w")))
  32.     {
  33.         fprintf (stderr, "%s: can't open %s\n", progname, msg_fname);
  34.         exit (0);
  35.     }
  36.  
  37.     /* Write magic string to MESSAGES.DAT */
  38.     fprintf (msg_fd, QWK_MAGIC);
  39.     n = 128 - strlen (QWK_MAGIC);
  40.     while (n--) fputc (' ', msg_fd);
  41.     blk_cnt = 2;
  42. }
  43.