/* * bootdisk.c */ #include #include #include #include"adflib.h" void MyVer(char *msg) { fprintf(stderr,"Verbose [%s]\n",msg); } /* * * */ int main(int argc, char *argv[]) { struct Device *hd; struct Volume *vol; struct List *list, *cell; adfEnvInitDefault(); hd = adfMountDev( argv[1],FALSE ); if (!hd) { fprintf(stderr, "can't mount device\n"); adfEnvCleanUp(); exit(1); } adfDeviceInfo(hd); /* mount the 2 partitions */ vol = adfMount(hd, 0, FALSE); if (!vol) { adfUnMountDev(hd); fprintf(stderr, "can't mount volume\n"); adfEnvCleanUp(); exit(1); } adfVolumeInfo(vol); cell = list = adfGetDirEnt(vol,vol->curDirPtr); while(cell) { printEntry(cell->content); cell = cell->next; } adfFreeDirList(list); /* unmounts */ adfUnMount(vol); adfUnMountDev(hd); adfEnvCleanUp(); return 0; }