michael@0: // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef BASE_STRING_UTIL_POSIX_H_ michael@0: #define BASE_STRING_UTIL_POSIX_H_ michael@0: michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: #include "base/logging.h" michael@0: michael@0: namespace base { michael@0: michael@0: // Chromium code style is to not use malloc'd strings; this is only for use michael@0: // for interaction with APIs that require it. michael@0: inline char* strdup(const char* str) { michael@0: return ::strdup(str); michael@0: } michael@0: michael@0: inline int strcasecmp(const char* string1, const char* string2) { michael@0: return ::strcasecmp(string1, string2); michael@0: } michael@0: michael@0: inline int strncasecmp(const char* string1, const char* string2, size_t count) { michael@0: return ::strncasecmp(string1, string2, count); michael@0: } michael@0: michael@0: inline int vsnprintf(char* buffer, size_t size, michael@0: const char* format, va_list arguments) { michael@0: return ::vsnprintf(buffer, size, format, arguments); michael@0: } michael@0: michael@0: inline int vswprintf(wchar_t* buffer, size_t size, michael@0: const wchar_t* format, va_list arguments) { michael@0: DCHECK(IsWprintfFormatPortable(format)); michael@0: return ::vswprintf(buffer, size, format, arguments); michael@0: } michael@0: michael@0: } // namespace base michael@0: michael@0: #endif // BASE_STRING_UTIL_POSIX_H_