(Page 3 of 14 in this chapter)
typedef struct
{
int count ;
struct AGM_FILE_STATS
{
BOOL found ;
char spec[AGM_MAX_FILESPEC] ;
DWORD size ;
char date[50] ;
} file[AGM_MAX_FILES] ;
} AGM_FILE_INFO ;
|
Field
|
Description
|
|---|---|
|
count
|
The number of files.
|
|
file[]
|
A data structure for each file.
|
|
Field
|
Description
|
|---|---|
|
found
|
TRUE if the file was found.
|
|
spec
|
The pathname of the file.
|
|
size
|
The size of the file in bytes.
|
|
date
|
The file's timestamp, in text form.
|
int main (int argc, char **argv)
{
AGMHD agmhd;
DWORD boardmask;
AGM_FILE_INFO fileinfo;
DWORD ret;
int n;
/* Open AGM Handle */
...
/* Load AG Device Drivers, Open AG Device Drivers */
...
/* Check AG configuration file against installed hardware */
ret = agmCheckConfig (agmhd, &boardmask, &fileinfo);
for (n=0; n<AGM_MAX_BOARDS; n++)
if (boardmask & (1<<n))
printf ("Board %d checked out.\n", n);
for (n=0; n<fileinfo.count; n++)
{
if (fileinfo.file[n].found)
printf ("File found: %s\n", fileinfo.file[n].spec);
else
printf ("File not found: %s\n", fileinfo.file[n].spec);
}
if (ret != SUCCESS)
{
puts ("agmCheckConfig failed.");
exit (-1);
}
/* Boot and download boards, etc. */
...
}
(Page 3 of 14 in this chapter)