comparison src/video/ps2gs/SDL_gsevents.c @ 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
76 return; 76 return;
77 } 77 }
78 78
79 /* Load all the keysym mappings */ 79 /* Load all the keysym mappings */
80 for ( map=0; map<NUM_VGAKEYMAPS; ++map ) { 80 for ( map=0; map<NUM_VGAKEYMAPS; ++map ) {
81 memset(vga_keymap[map], 0, NR_KEYS*sizeof(Uint16)); 81 SDL_memset(vga_keymap[map], 0, NR_KEYS*sizeof(Uint16));
82 for ( i=0; i<NR_KEYS; ++i ) { 82 for ( i=0; i<NR_KEYS; ++i ) {
83 entry.kb_table = map; 83 entry.kb_table = map;
84 entry.kb_index = i; 84 entry.kb_index = i;
85 if ( ioctl(fd, KDGKBENT, &entry) == 0 ) { 85 if ( ioctl(fd, KDGKBENT, &entry) == 0 ) {
86 /* fill keytemp. This replaces SDL_fbkeys.h */ 86 /* fill keytemp. This replaces SDL_fbkeys.h */
336 sprintf(path, "/proc/%s/status", entry->d_name); 336 sprintf(path, "/proc/%s/status", entry->d_name);
337 status=fopen(path, "r"); 337 status=fopen(path, "r");
338 if ( status ) { 338 if ( status ) {
339 name[0] = '\0'; 339 name[0] = '\0';
340 fscanf(status, "Name: %s", name); 340 fscanf(status, "Name: %s", name);
341 if ( strcmp(name, wanted_name) == 0 ) { 341 if ( SDL_strcmp(name, wanted_name) == 0 ) {
342 pid = atoi(entry->d_name); 342 pid = atoi(entry->d_name);
343 } 343 }
344 fclose(status); 344 fclose(status);
345 } 345 }
346 } 346 }
371 cmdline = open(path, O_RDONLY, 0); 371 cmdline = open(path, O_RDONLY, 0);
372 if ( cmdline >= 0 ) { 372 if ( cmdline >= 0 ) {
373 len = read(cmdline, args, sizeof(args)); 373 len = read(cmdline, args, sizeof(args));
374 arg = args; 374 arg = args;
375 while ( len > 0 ) { 375 while ( len > 0 ) {
376 if ( strcmp(arg, "-R") == 0 ) { 376 if ( SDL_strcmp(arg, "-R") == 0 ) {
377 available = 1; 377 available = 1;
378 } 378 }
379 arglen = strlen(arg)+1; 379 arglen = SDL_strlen(arg)+1;
380 len -= arglen; 380 len -= arglen;
381 arg += arglen; 381 arg += arglen;
382 } 382 }
383 close(cmdline); 383 close(cmdline);
384 } 384 }
433 { 433 {
434 int imps2; 434 int imps2;
435 435
436 imps2 = 0; 436 imps2 = 0;
437 437
438 if ( getenv("SDL_MOUSEDEV_IMPS2") ) { 438 if ( SDL_getenv("SDL_MOUSEDEV_IMPS2") ) {
439 imps2 = 1; 439 imps2 = 1;
440 } 440 }
441 if ( ! imps2 ) { 441 if ( ! imps2 ) {
442 Uint8 query_ps2 = 0xF2; 442 Uint8 query_ps2 = 0xF2;
443 fd_set fdset; 443 fd_set fdset;
485 { 485 {
486 int i; 486 int i;
487 const char *mousedev; 487 const char *mousedev;
488 const char *mousedrv; 488 const char *mousedrv;
489 489
490 mousedrv = getenv("SDL_MOUSEDRV"); 490 mousedrv = SDL_getenv("SDL_MOUSEDRV");
491 mousedev = getenv("SDL_MOUSEDEV"); 491 mousedev = SDL_getenv("SDL_MOUSEDEV");
492 mouse_fd = -1; 492 mouse_fd = -1;
493 493
494 /* STD MICE */ 494 /* STD MICE */
495 495
496 if ( mousedev == NULL ) { 496 if ( mousedev == NULL ) {
750 break; 750 break;
751 } 751 }
752 GS_vgamousecallback(button, dx, dy); 752 GS_vgamousecallback(button, dx, dy);
753 } 753 }
754 if ( i < nread ) { 754 if ( i < nread ) {
755 memcpy(mousebuf, &mousebuf[i], (nread-i)); 755 SDL_memcpy(mousebuf, &mousebuf[i], (nread-i));
756 start = (nread-i); 756 start = (nread-i);
757 } else { 757 } else {
758 start = 0; 758 start = 0;
759 } 759 }
760 return; 760 return;