Home | History | Annotate | Download | only in bsdi

Lines Matching defs:drive

76 static const char *SDL_SYS_CDName(int drive);
77 static int SDL_SYS_CDOpen(int drive);
188 /* Check a drive to see if it is a CD-ROM */
189 static int CheckDrive(char *drive, struct stat *stbuf)
195 if ( stat(drive, stbuf) < 0 ) {
200 cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0);
210 /* Add a CD-ROM drive to our list of valid drives */
211 static void AddDrive(char *drive, struct stat *stbuf)
217 This can happen when we see a drive via symbolic link.
222 fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]);
228 /* Add this drive to our list */
230 SDL_cdlist[i] = SDL_strdup(drive);
238 fprintf(stderr, "Added CD-ROM drive: %s\n", drive);
251 char drive[32];
266 /* Look in the environment for our CD-ROM drive list */
304 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
305 insert = SDL_strchr(drive, '?');
309 switch (CheckDrive(drive, &stbuf)) {
310 /* Drive exists and is a CD-ROM */
312 AddDrive(drive, &stbuf);
314 /* Drive exists, but isn't a CD-ROM */
317 /* Drive doesn't exist */
324 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
325 if ( CheckDrive(drive, &stbuf) > 0 ) {
326 AddDrive(drive, &stbuf);
333 static const char *SDL_SYS_CDName(int drive)
335 return(SDL_cdlist[drive]);
338 static int SDL_SYS_CDOpen(int drive)
340 return(open(SDL_cdlist[drive], O_RDONLY | O_NONBLOCK | O_EXCL, 0));