comparison src/cdrom/openbsd/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
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 <sys/ioctl.h> 26 #include <sys/ioctl.h>
27 #include <stdlib.h>
28 #include <sys/stat.h> 27 #include <sys/stat.h>
29 #include <fcntl.h> 28 #include <fcntl.h>
30 #include <stdio.h>
31 #include <string.h>
32 #include <errno.h> 29 #include <errno.h>
33 #include <unistd.h> 30 #include <unistd.h>
34 #include <sys/ioctl.h> 31 #include <sys/ioctl.h>
35 #include <sys/cdio.h> 32 #include <sys/cdio.h>
36 33
34 #include "SDL_stdlib.h"
35 #include "SDL_string.h"
37 #include "SDL_error.h" 36 #include "SDL_error.h"
38 #include "SDL_cdrom.h" 37 #include "SDL_cdrom.h"
39 #include "SDL_syscdrom.h" 38 #include "SDL_syscdrom.h"
40 39
41 40
196 for ( i=0; checklist[i]; ++i ) { 195 for ( i=0; checklist[i]; ++i ) {
197 if ( checklist[i][0] == '?' ) { 196 if ( checklist[i][0] == '?' ) {
198 char *insert; 197 char *insert;
199 exists = 1; 198 exists = 1;
200 for ( j=checklist[i][1]; exists; ++j ) { 199 for ( j=checklist[i][1]; exists; ++j ) {
201 sprintf(drive, "/dev/%s", &checklist[i][3]); 200 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
202 insert = SDL_strchr(drive, '?'); 201 insert = SDL_strchr(drive, '?');
203 if ( insert != NULL ) { 202 if ( insert != NULL ) {
204 *insert = j; 203 *insert = j;
205 } 204 }
206 switch (CheckDrive(drive, &stbuf)) { 205 switch (CheckDrive(drive, &stbuf)) {
216 exists = 0; 215 exists = 0;
217 break; 216 break;
218 } 217 }
219 } 218 }
220 } else { 219 } else {
221 sprintf(drive, "/dev/%s", checklist[i]); 220 SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
222 if ( CheckDrive(drive, &stbuf) > 0 ) { 221 if ( CheckDrive(drive, &stbuf) > 0 ) {
223 AddDrive(drive, &stbuf); 222 AddDrive(drive, &stbuf);
224 } 223 }
225 } 224 }
226 } 225 }