Mercurial > sdl-ios-xcode
comparison src/cdrom/bsdi/SDL_syscdrom.c @ 1338:604d73db6802
Removed uses of stdlib.h and string.h
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 09:29:18 +0000 |
parents | 3692456e7b0f |
children | c71e05b4dc2e |
comparison
equal
deleted
inserted
replaced
1337:c687f06c7473 | 1338:604d73db6802 |
---|---|
27 * | 27 * |
28 * Steven Schultz - sms@to.gd-es.com | 28 * Steven Schultz - sms@to.gd-es.com |
29 */ | 29 */ |
30 | 30 |
31 #include <sys/types.h> | 31 #include <sys/types.h> |
32 #include <stdlib.h> | |
33 #include <sys/stat.h> | 32 #include <sys/stat.h> |
34 #include <fcntl.h> | 33 #include <fcntl.h> |
35 #include <stdio.h> | |
36 #include <string.h> | |
37 #include <errno.h> | |
38 #include <err.h> | 34 #include <err.h> |
39 #include <unistd.h> | 35 #include <unistd.h> |
40 #include <sys/ioctl.h> | 36 #include <sys/ioctl.h> |
41 #include </sys/dev/scsi/scsi.h> | 37 #include </sys/dev/scsi/scsi.h> |
42 #include </sys/dev/scsi/scsi_ioctl.h> | 38 #include </sys/dev/scsi/scsi_ioctl.h> |
43 | 39 |
40 #include "SDL_stdlib.h" | |
41 #include "SDL_string.h" | |
44 #include "SDL_error.h" | 42 #include "SDL_error.h" |
45 #include "SDL_cdrom.h" | 43 #include "SDL_cdrom.h" |
46 #include "SDL_syscdrom.h" | 44 #include "SDL_syscdrom.h" |
47 | 45 |
48 /* | 46 /* |
301 for ( i=0; checklist[i]; ++i ) { | 299 for ( i=0; checklist[i]; ++i ) { |
302 if ( checklist[i][0] == '?' ) { | 300 if ( checklist[i][0] == '?' ) { |
303 char *insert; | 301 char *insert; |
304 exists = 1; | 302 exists = 1; |
305 for ( j=checklist[i][1]; exists; ++j ) { | 303 for ( j=checklist[i][1]; exists; ++j ) { |
306 sprintf(drive, "/dev/%sc", &checklist[i][3]); | 304 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]); |
307 insert = SDL_strchr(drive, '?'); | 305 insert = SDL_strchr(drive, '?'); |
308 if ( insert != NULL ) { | 306 if ( insert != NULL ) { |
309 *insert = j; | 307 *insert = j; |
310 } | 308 } |
311 switch (CheckDrive(drive, &stbuf)) { | 309 switch (CheckDrive(drive, &stbuf)) { |
321 exists = 0; | 319 exists = 0; |
322 break; | 320 break; |
323 } | 321 } |
324 } | 322 } |
325 } else { | 323 } else { |
326 sprintf(drive, "/dev/%s", checklist[i]); | 324 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]); |
327 if ( CheckDrive(drive, &stbuf) > 0 ) { | 325 if ( CheckDrive(drive, &stbuf) > 0 ) { |
328 AddDrive(drive, &stbuf); | 326 AddDrive(drive, &stbuf); |
329 } | 327 } |
330 } | 328 } |
331 } | 329 } |