Changeset 57
- Timestamp:
- 05/13/07 11:59:33 (2 years ago)
- Location:
- Mulberry/trunk/Sources_Common/Utilities
- Files:
-
- 2 modified
-
CStringUtils.cp (modified) (5 diffs)
-
CStringUtils.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Mulberry/trunk/Sources_Common/Utilities/CStringUtils.cp
r19 r57 24 24 // S T R I N G F U N C T I O N S 25 25 26 #ifndef __GNUC__26 #ifndef strdup 27 27 // Duplicate string 28 28 char* strdup(const char* s1) … … 39 39 #endif 40 40 41 #ifndef strndup 41 42 // Duplicate string a fixed length 42 43 char* strndup(const char* s1, size_t len) … … 52 53 return NULL; 53 54 } 55 #endif 54 56 55 57 // Convert to lowercase … … 60 62 if (s1) 61 63 while(*s1) 62 *s1++ = tolower(*s1); 64 { 65 *s1 = tolower(*s1); 66 s1++; 67 } 63 68 #else 64 69 if (s1--) … … 75 80 if (s1) 76 81 while(*s1) 77 *s1++ = toupper(*s1); 82 { 83 *s1 = toupper(*s1); 84 s1++; 85 } 78 86 #else 79 87 if (s1--) -
Mulberry/trunk/Sources_Common/Utilities/CStringUtils.h
r19 r57 57 57 const char* tokens); // Duplicate possibly quoted string without destroying end 58 58 59 #ifndef __GNUC__59 #ifndef strdup 60 60 char* strdup(const char* s1); // Duplicate a string 61 61 #endif 62 #ifndef strndup 62 63 char* strndup(const char* s1, size_t len); // Duplicate len chars of string 64 #endif 63 65 64 66 void strlower(char* s1); // Convert to lowercase