1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file.
7 #ifndef BASE_STRING_UTIL_POSIX_H_
8 #define BASE_STRING_UTIL_POSIX_H_
15 #include "base/logging.h"
19 // Chromium code style is to not use malloc'd strings; this is only for use
20 // for interaction with APIs that require it.
21 inline char* strdup(const char* str
) { return ::strdup(str
); }
23 inline int strcasecmp(const char* string1
, const char* string2
) {
24 return ::strcasecmp(string1
, string2
);
27 inline int strncasecmp(const char* string1
, const char* string2
, size_t count
) {
28 return ::strncasecmp(string1
, string2
, count
);
31 inline int vsnprintf(char* buffer
, size_t size
, const char* format
,
33 return ::vsnprintf(buffer
, size
, format
, arguments
);
36 inline int vswprintf(wchar_t* buffer
, size_t size
, const wchar_t* format
,
38 DCHECK(IsWprintfFormatPortable(format
));
39 return ::vswprintf(buffer
, size
, format
, arguments
);
44 #endif // BASE_STRING_UTIL_POSIX_H_