diff src/stdlib/SDL_string.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 450721ad5436
children 604d73db6802
line wrap: on
line diff
--- a/src/stdlib/SDL_string.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/stdlib/SDL_string.c	Tue Feb 07 06:59:48 2006 +0000
@@ -375,7 +375,7 @@
 #ifndef HAVE_STRRCHR
 char *SDL_strrchr(const char *string, int c)
 {
-    const char *bufp = string + strlen(string) - 1;
+    const char *bufp = string + SDL_strlen(string) - 1;
     while ( bufp >= string ) {
         if ( *bufp == c ) {
             return (char *)bufp;
@@ -388,9 +388,9 @@
 #ifndef HAVE_STRSTR
 char *SDL_strstr(const char *haystack, const char *needle)
 {
-    size_t length = strlen(needle);
+    size_t length = SDL_strlen(needle);
     while ( *haystack ) {
-        if ( strncmp(haystack, needle, length) == 0 ) {
+        if ( SDL_strncmp(haystack, needle, length) == 0 ) {
             return (char *)haystack;
         }
     }
@@ -429,9 +429,9 @@
 
     /* The numbers went into the string backwards. :) */
     if ( *string == '-' ) {
-        _strrev(string+1);
+        SDL_strrev(string+1);
     } else {
-        _strrev(string);
+        SDL_strrev(string);
     }
 
     return string;
@@ -454,7 +454,7 @@
     *bufp = '\0';
 
     /* The numbers went into the string backwards. :) */
-    _strrev(string);
+    SDL_strrev(string);
 
     return string;
 }
@@ -497,9 +497,9 @@
 
     /* The numbers went into the string backwards. :) */
     if ( *string == '-' ) {
-        _strrev(string+1);
+        SDL_strrev(string+1);
     } else {
-        _strrev(string);
+        SDL_strrev(string);
     }
 
     return string;
@@ -522,7 +522,7 @@
     *bufp = '\0';
 
     /* The numbers went into the string backwards. :) */
-    _strrev(string);
+    SDL_strrev(string);
 
     return string;
 }
@@ -878,12 +878,12 @@
     char num[130];
     size_t size;
 
-    _ltoa(value, num, radix);
+    SDL_ltoa(value, num, radix);
     size = SDL_strlen(num);
     if ( size > maxlen ) {
         size = maxlen;
     }
-    strncpy(text, num, size);
+    SDL_strncpy(text, num, size);
 
     return size;
 }
@@ -892,12 +892,12 @@
     char num[130];
     size_t size;
 
-    _ultoa(value, num, radix);
+    SDL_ultoa(value, num, radix);
     size = SDL_strlen(num);
     if ( size > maxlen ) {
         size = maxlen;
     }
-    strncpy(text, num, size);
+    SDL_strncpy(text, num, size);
 
     return size;
 }
@@ -907,12 +907,12 @@
     char num[130];
     size_t size;
 
-    _i64toa(value, num, radix);
+    SDL_lltoa(value, num, radix);
     size = SDL_strlen(num);
     if ( size > maxlen ) {
         size = maxlen;
     }
-    strncpy(text, num, size);
+    SDL_strncpy(text, num, size);
 
     return size;
 }
@@ -921,12 +921,12 @@
     char num[130];
     size_t size;
 
-    _ui64toa(value, num, radix);
+    SDL_ulltoa(value, num, radix);
     size = SDL_strlen(num);
     if ( size > maxlen ) {
         size = maxlen;
     }
-    strncpy(text, num, size);
+    SDL_strncpy(text, num, size);
 
     return size;
 }
@@ -1076,7 +1076,7 @@
                                 break;
                         }
                         if ( do_lowercase ) {
-                            _strlwr(text);
+                            SDL_strlwr(text);
                         }
                         done = SDL_TRUE;
                         break;