OLD | NEW |
1 // Copyright 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_POSIX_H_ | 5 #ifndef MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_POSIX_H_ |
6 #define MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_POSIX_H_ | 6 #define MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_POSIX_H_ |
7 | 7 |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 | 9 |
10 #include <stdio.h> | 10 #include <stdio.h> |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 | 13 |
14 inline int vsnprintf(char* buffer, | 14 inline int vsnprintf(char* buffer, |
15 size_t size, | 15 size_t size, |
16 const char* format, va_list arguments) { | 16 const char* format, va_list arguments) { |
17 return ::vsnprintf(buffer, size, format, arguments); | 17 return ::vsnprintf(buffer, size, format, arguments); |
18 } | 18 } |
19 | 19 |
| 20 // Chromium code style is to not use malloc'd strings; this is only for use |
| 21 // for interaction with APIs that require it. |
| 22 inline char* strdup(const char* str) { |
| 23 return ::strdup(str); |
| 24 } |
| 25 |
| 26 inline int strcasecmp(const char* string1, const char* string2) { |
| 27 return ::strcasecmp(string1, string2); |
| 28 } |
| 29 |
| 30 inline int strncasecmp(const char* string1, const char* string2, size_t count) { |
| 31 return ::strncasecmp(string1, string2, count); |
| 32 } |
| 33 |
20 } // namespace base | 34 } // namespace base |
21 | 35 |
22 #endif // MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_POSIX_H_ | 36 #endif // MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_POSIX_H_ |
OLD | NEW |