Mercurial > sdl-ios-xcode
comparison src/cdrom/beos/SDL_syscdrom.cc @ 1336:3692456e7b0f
Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 06:59:48 +0000 |
parents | c9b51268668f |
children | 604d73db6802 |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
114 int i; | 114 int i; |
115 | 115 |
116 if ( SDL_numcds < MAX_DRIVES ) { | 116 if ( SDL_numcds < MAX_DRIVES ) { |
117 /* Add this drive to our list */ | 117 /* Add this drive to our list */ |
118 i = SDL_numcds; | 118 i = SDL_numcds; |
119 SDL_cdlist[i] = (char *)malloc(strlen(drive)+1); | 119 SDL_cdlist[i] = (char *)SDL_malloc(SDL_strlen(drive)+1); |
120 if ( SDL_cdlist[i] == NULL ) { | 120 if ( SDL_cdlist[i] == NULL ) { |
121 SDL_OutOfMemory(); | 121 SDL_OutOfMemory(); |
122 return; | 122 return; |
123 } | 123 } |
124 strcpy(SDL_cdlist[i], drive); | 124 SDL_strcpy(SDL_cdlist[i], drive); |
125 ++SDL_numcds; | 125 ++SDL_numcds; |
126 #ifdef CDROM_DEBUG | 126 #ifdef CDROM_DEBUG |
127 fprintf(stderr, "Added CD-ROM drive: %s\n", drive); | 127 fprintf(stderr, "Added CD-ROM drive: %s\n", drive); |
128 #endif | 128 #endif |
129 } | 129 } |
163 SDL_CDcaps.Stop = SDL_SYS_CDStop; | 163 SDL_CDcaps.Stop = SDL_SYS_CDStop; |
164 SDL_CDcaps.Eject = SDL_SYS_CDEject; | 164 SDL_CDcaps.Eject = SDL_SYS_CDEject; |
165 SDL_CDcaps.Close = SDL_SYS_CDClose; | 165 SDL_CDcaps.Close = SDL_SYS_CDClose; |
166 | 166 |
167 /* Look in the environment for our CD-ROM drive list */ | 167 /* Look in the environment for our CD-ROM drive list */ |
168 SDLcdrom = getenv("SDL_CDROM"); /* ':' separated list of devices */ | 168 SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ |
169 if ( SDLcdrom != NULL ) { | 169 if ( SDLcdrom != NULL ) { |
170 char *cdpath, *delim; | 170 char *cdpath, *delim; |
171 cdpath = (char *)malloc(strlen(SDLcdrom)+1); | 171 cdpath = (char *)SDL_malloc(SDL_strlen(SDLcdrom)+1); |
172 if ( cdpath != NULL ) { | 172 if ( cdpath != NULL ) { |
173 strcpy(cdpath, SDLcdrom); | 173 SDL_strcpy(cdpath, SDLcdrom); |
174 SDLcdrom = cdpath; | 174 SDLcdrom = cdpath; |
175 do { | 175 do { |
176 delim = strchr(SDLcdrom, ':'); | 176 delim = SDL_strchr(SDLcdrom, ':'); |
177 if ( delim ) { | 177 if ( delim ) { |
178 *delim++ = '\0'; | 178 *delim++ = '\0'; |
179 } | 179 } |
180 if ( CheckDrive(SDLcdrom) > 0 ) { | 180 if ( CheckDrive(SDLcdrom) > 0 ) { |
181 AddDrive(SDLcdrom); | 181 AddDrive(SDLcdrom); |
184 SDLcdrom = delim; | 184 SDLcdrom = delim; |
185 } else { | 185 } else { |
186 SDLcdrom = NULL; | 186 SDLcdrom = NULL; |
187 } | 187 } |
188 } while ( SDLcdrom ); | 188 } while ( SDLcdrom ); |
189 free(cdpath); | 189 SDL_free(cdpath); |
190 } | 190 } |
191 | 191 |
192 /* If we found our drives, there's nothing left to do */ | 192 /* If we found our drives, there's nothing left to do */ |
193 if ( SDL_numcds > 0 ) { | 193 if ( SDL_numcds > 0 ) { |
194 return(0); | 194 return(0); |
221 | 221 |
222 if(entry.GetRef(&e) != B_NO_ERROR) | 222 if(entry.GetRef(&e) != B_NO_ERROR) |
223 continue; | 223 continue; |
224 | 224 |
225 if(entry.IsDirectory()) { | 225 if(entry.IsDirectory()) { |
226 if(strcmp(e.name, "floppy") == 0) | 226 if(SDL_strcmp(e.name, "floppy") == 0) |
227 continue; /* ignore floppy (it is not silent) */ | 227 continue; /* ignore floppy (it is not silent) */ |
228 int devfd = try_dir(name); | 228 int devfd = try_dir(name); |
229 if(devfd >= 0) | 229 if(devfd >= 0) |
230 return devfd; | 230 return devfd; |
231 } | 231 } |
232 else { | 232 else { |
233 int devfd; | 233 int devfd; |
234 device_geometry g; | 234 device_geometry g; |
235 | 235 |
236 if(strcmp(e.name, "raw") != 0) | 236 if(SDL_strcmp(e.name, "raw") != 0) |
237 continue; /* ignore partitions */ | 237 continue; /* ignore partitions */ |
238 | 238 |
239 devfd = open(name, O_RDONLY); | 239 devfd = open(name, O_RDONLY); |
240 if(devfd < 0) | 240 if(devfd < 0) |
241 continue; | 241 continue; |
399 { | 399 { |
400 int i; | 400 int i; |
401 | 401 |
402 if ( SDL_numcds > 0 ) { | 402 if ( SDL_numcds > 0 ) { |
403 for ( i=0; i<SDL_numcds; ++i ) { | 403 for ( i=0; i<SDL_numcds; ++i ) { |
404 free(SDL_cdlist[i]); | 404 SDL_free(SDL_cdlist[i]); |
405 } | 405 } |
406 SDL_numcds = 0; | 406 SDL_numcds = 0; |
407 } | 407 } |
408 } | 408 } |
409 | 409 |