home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
bbs
/
dlp100.zip
/
FGFA.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-23
|
2KB
|
66 lines
#include <stdio.h>
#include <stdlib.h>
#include "ra.h"
main()
{
char Path[128];
char WorkName[41];
char Line[80];
unsigned int GroupNum=0, AreaNum=0;
int i, j;
struct GROUP FGroupRec;
struct FILES FilesRec;
RAEnvr = getenv("RA");
strcpy (Path, RAEnvr);
strcat (Path, "\\FGROUPS.RA");
if((FGROUP_RA=fopen(Path,"rb"))==NULL)
{ printf("\n\nUnable to open %s!\n", Path);
getch();
return(1);
}
strcpy (Path, RAEnvr);
strcat (Path, "\\FILES.RA");
if((FILES_RA=fopen(Path,"rb"))==NULL)
{ printf("\n\nUnable to open %s!\n", Path);
getch();
return(1);
}
while(fread(&FGroupRec, sizeof(FGroupRec), 1, FGROUP_RA)==1)
{ GroupNum++;
if(FGroupRec.NameSize)
{ strncpy (WorkName, FGroupRec.Name, FGroupRec.NameSize);
WorkName[FGroupRec.NameSize]='\0';
fprintf(stdout, "%5u\) %-40s\n", GroupNum, WorkName);
fseek(FILES_RA, 0, SEEK_SET);
AreaNum=0;
fprintf (stdout, "%s %-40s %s\n", " File ", "Name", " Group Alt1 Alt2 Alt3");
while(fread(&FilesRec, sizeof(FilesRec), 1, FILES_RA)==1)
{ AreaNum++;
if(FilesRec.FilePathSize)
if(GroupNum == FilesRec.Group ||
GroupNum == FilesRec.AltGroup[0] ||
GroupNum == FilesRec.AltGroup[1] ||
GroupNum == FilesRec.AltGroup[2])
{ strncpy (WorkName, FilesRec.Name, FilesRec.NameSize);
WorkName[FilesRec.NameSize]='\0';
fprintf(stdout, " %5u\) %-40s %5u %5u %5u %5u\n",
AreaNum, WorkName,
FilesRec.Group,
FilesRec.AltGroup[0],
FilesRec.AltGroup[1],
FilesRec.AltGroup[2]);
}
}
}
}
fclose(FGROUP_RA);
fclose(FILES_RA);
}