comparison src/cdrom/freebsd/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
21 */ 21 */
22 22
23 /* Functions for system-level CD-ROM audio control */ 23 /* Functions for system-level CD-ROM audio control */
24 24
25 #include <sys/types.h> 25 #include <sys/types.h>
26 #include <stdlib.h>
27 #include <sys/stat.h> 26 #include <sys/stat.h>
28 #include <fcntl.h> 27 #include <fcntl.h>
29 #include <stdio.h>
30 #include <string.h>
31 #include <errno.h> 28 #include <errno.h>
32 #include <unistd.h> 29 #include <unistd.h>
33 #include <sys/cdio.h> 30 #include <sys/cdio.h>
34 31
32 #include "SDL_stdlib.h"
33 #include "SDL_string.h"
35 #include "SDL_error.h" 34 #include "SDL_error.h"
36 #include "SDL_cdrom.h" 35 #include "SDL_cdrom.h"
37 #include "SDL_syscdrom.h" 36 #include "SDL_syscdrom.h"
38 37
39 38
187 for ( i=0; checklist[i]; ++i ) { 186 for ( i=0; checklist[i]; ++i ) {
188 if ( checklist[i][0] == '?' ) { 187 if ( checklist[i][0] == '?' ) {
189 char *insert; 188 char *insert;
190 exists = 1; 189 exists = 1;
191 for ( j=checklist[i][1]; exists; ++j ) { 190 for ( j=checklist[i][1]; exists; ++j ) {
192 sprintf(drive, "/dev/%sc", &checklist[i][3]); 191 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
193 insert = SDL_strchr(drive, '?'); 192 insert = SDL_strchr(drive, '?');
194 if ( insert != NULL ) { 193 if ( insert != NULL ) {
195 *insert = j; 194 *insert = j;
196 } 195 }
197 switch (CheckDrive(drive, &stbuf)) { 196 switch (CheckDrive(drive, &stbuf)) {
207 exists = 0; 206 exists = 0;
208 break; 207 break;
209 } 208 }
210 } 209 }
211 } else { 210 } else {
212 sprintf(drive, "/dev/%s", checklist[i]); 211 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
213 if ( CheckDrive(drive, &stbuf) > 0 ) { 212 if ( CheckDrive(drive, &stbuf) > 0 ) {
214 AddDrive(drive, &stbuf); 213 AddDrive(drive, &stbuf);
215 } 214 }
216 } 215 }
217 } 216 }