home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / bbs / dlp100.zip / MA.C < prev    next >
C/C++ Source or Header  |  1993-07-07  |  790b  |  35 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include "ra.h"
  4. main()
  5. {
  6.      char Path[128];
  7.      char WorkName[41];
  8.      char Line[80];
  9. unsigned int MessageNum=0;
  10.      int i, j;
  11.  
  12. struct MESSAGE MessageRec;
  13.  
  14. RAEnvr = getenv("RA");
  15. strcpy (Path, RAEnvr);
  16. strcat (Path, "\\MESSAGES.RA");
  17.  
  18. if((MESSAGES_RA=fopen(Path,"rb"))==NULL)
  19.    { printf("\n\nUnable to open %s!\n", Path);
  20.      getch();
  21.      return(1);
  22.    }
  23. fprintf (stdout, "  %s %s\n\n", "Area ", "Name");
  24.  
  25. while(fread(&MessageRec, sizeof(MessageRec), 1, MESSAGES_RA)==1)
  26.      { MessageNum++;
  27.        if(MessageRec.NameSize)
  28.       { strncpy (WorkName, MessageRec.Name, MessageRec.NameSize);
  29.         WorkName[MessageRec.NameSize]='\0';
  30.         fprintf(stdout, "%5u\)  %s\n", MessageNum, WorkName);
  31.       }
  32.      }
  33. fclose(MESSAGES_RA);
  34. }
  35.