tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

string_util_posix.h (1362B)


      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.
      6 
      7 #ifndef BASE_STRING_UTIL_POSIX_H_
      8 #define BASE_STRING_UTIL_POSIX_H_
      9 
     10 #include <stdarg.h>
     11 #include <stdio.h>
     12 #include <string.h>
     13 #include <wchar.h>
     14 
     15 #include "base/logging.h"
     16 
     17 namespace base {
     18 
     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); }
     22 
     23 inline int strcasecmp(const char* string1, const char* string2) {
     24  return ::strcasecmp(string1, string2);
     25 }
     26 
     27 inline int strncasecmp(const char* string1, const char* string2, size_t count) {
     28  return ::strncasecmp(string1, string2, count);
     29 }
     30 
     31 inline int vsnprintf(char* buffer, size_t size, const char* format,
     32                     va_list arguments) {
     33  return ::vsnprintf(buffer, size, format, arguments);
     34 }
     35 
     36 inline int vswprintf(wchar_t* buffer, size_t size, const wchar_t* format,
     37                     va_list arguments) {
     38  DCHECK(IsWprintfFormatPortable(format));
     39  return ::vswprintf(buffer, size, format, arguments);
     40 }
     41 
     42 }  // namespace base
     43 
     44 #endif  // BASE_STRING_UTIL_POSIX_H_