comparison src/joystick/linux/SDL_sysjoystick.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
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /* This is the system specific header for the SDL joystick API */ 23 /* This is the system specific header for the SDL joystick API */
24 24
25 #include <stdio.h> /* For the definition of NULL */
26 #include <stdlib.h> /* For SDL_getenv() prototype */
27 #include <string.h>
28 #include <sys/stat.h> 25 #include <sys/stat.h>
29 #include <unistd.h> 26 #include <unistd.h>
30 #include <fcntl.h> 27 #include <fcntl.h>
31 #include <sys/ioctl.h> 28 #include <sys/ioctl.h>
32 #include <limits.h> /* For the definition of PATH_MAX */ 29 #include <limits.h> /* For the definition of PATH_MAX */
36 #include <linux/joystick.h> 33 #include <linux/joystick.h>
37 #ifdef USE_INPUT_EVENTS 34 #ifdef USE_INPUT_EVENTS
38 #include <linux/input.h> 35 #include <linux/input.h>
39 #endif 36 #endif
40 37
38 #include "SDL_stdlib.h"
39 #include "SDL_string.h"
41 #include "SDL_error.h" 40 #include "SDL_error.h"
42 #include "SDL_joystick.h" 41 #include "SDL_joystick.h"
43 #include "SDL_sysjoystick.h" 42 #include "SDL_sysjoystick.h"
44 #include "SDL_joystick_c.h" 43 #include "SDL_joystick_c.h"
45 44
323 } 322 }
324 } 323 }
325 324
326 for ( i=0; i<SDL_TABLESIZE(joydev_pattern); ++i ) { 325 for ( i=0; i<SDL_TABLESIZE(joydev_pattern); ++i ) {
327 for ( j=0; j < MAX_JOYSTICKS; ++j ) { 326 for ( j=0; j < MAX_JOYSTICKS; ++j ) {
328 sprintf(path, joydev_pattern[i], j); 327 SDL_snprintf(path, SDL_arraysize(path), joydev_pattern[i], j);
329 328
330 /* rcg06302000 replaced access(F_OK) call with stat(). 329 /* rcg06302000 replaced access(F_OK) call with stat().
331 * stat() will fail if the file doesn't exist, so it's 330 * stat() will fail if the file doesn't exist, so it's
332 * equivalent behaviour. 331 * equivalent behaviour.
333 */ 332 */