Stream_t *open_root_dir(unsigned char drive, int flags, int *isRop) { Stream_t *Fs; init_streamcache(); drive = toupper(drive); /* open the drive */ if(fss[drive]) Fs = fss[drive]; else { Fs = fs_init(drive, flags, isRop); if (!Fs){ fprintf(stderr, "Cannot initialize '%c:'\n", drive); return NULL; } fss[drive] = Fs; } return OpenRoot(Fs); }
Stream_t *open_root_dir(char *drive, int flags) { Stream_t *Fs; int i, k; init_streamcache(); k = -1; for(i=0; i<256; i++) { if (fss[i] == NULL || strcmp(getDrive(fss[i]), drive) == 0) { k = i; break; } } if(k == -1) { fprintf(stderr, "Cannot initialize '%s:', out of table space\n", drive); return NULL; } /* open the drive */ if(fss[k]) Fs = fss[k]; else { Fs = fs_init(drive, flags); if (!Fs){ fprintf(stderr, "Cannot initialize '%s:'\n", drive); return NULL; } fss[k] = Fs; } return OpenRoot(Fs); }