home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
bbs
/
dlp100.zip
/
MA.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-07-07
|
790b
|
35 lines
#include <stdio.h>
#include <stdlib.h>
#include "ra.h"
main()
{
char Path[128];
char WorkName[41];
char Line[80];
unsigned int MessageNum=0;
int i, j;
struct MESSAGE MessageRec;
RAEnvr = getenv("RA");
strcpy (Path, RAEnvr);
strcat (Path, "\\MESSAGES.RA");
if((MESSAGES_RA=fopen(Path,"rb"))==NULL)
{ printf("\n\nUnable to open %s!\n", Path);
getch();
return(1);
}
fprintf (stdout, " %s %s\n\n", "Area ", "Name");
while(fread(&MessageRec, sizeof(MessageRec), 1, MESSAGES_RA)==1)
{ MessageNum++;
if(MessageRec.NameSize)
{ strncpy (WorkName, MessageRec.Name, MessageRec.NameSize);
WorkName[MessageRec.NameSize]='\0';
fprintf(stdout, "%5u\) %s\n", MessageNum, WorkName);
}
}
fclose(MESSAGES_RA);
}