tor-browser

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

cbindgen.toml (1886B)


      1 header = """/* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 /* The MozURL type is implemented in Rust code, and uses extern "C" FFI calls to
      6 * operate on the internal data structure. This file contains C declarations of
      7 * these files.
      8 
      9 * WARNING: DO NOT CALL ANY OF THESE FUNCTIONS. USE |MozURL| INSTEAD! */
     10 """
     11 autogen_warning = """/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen. */
     12 
     13 namespace mozilla {
     14 namespace net {
     15 class MozURL;
     16 }  // namespace net
     17 }  // namespace mozilla
     18 
     19 extern "C" {
     20 
     21 // FFI-compatible string slice struct used internally by MozURL.
     22 // Coerces to nsDependentCSubstring.
     23 struct MozURLSpecSlice {
     24  char* mData;
     25  uint32_t mLen;
     26 
     27  operator nsDependentCSubstring() {
     28    return nsDependentCSubstring(mData, mLen);
     29  }
     30 };
     31 
     32 nsresult mozurl_new(mozilla::net::MozURL** aResult, const nsACString* aSpec,
     33                    /* optional */ const mozilla::net::MozURL* aBase);
     34 
     35 void mozurl_clone(const mozilla::net::MozURL* aThis,
     36                  mozilla::net::MozURL** aResult);
     37 
     38 nsresult mozurl_common_base(const mozilla::net::MozURL* aUrl1,
     39                            const mozilla::net::MozURL* aUrl2,
     40                            mozilla::net::MozURL** aResult);
     41 }
     42 
     43 """
     44 
     45 include_guard = "mozilla_net_MozURL_ffi_h"
     46 include_version = true
     47 braces = "SameLine"
     48 line_length = 100
     49 tab_width = 2
     50 language = "C++"
     51 namespaces = []
     52 includes = ["nsError.h", "nsString.h"]
     53 
     54 [export]
     55 exclude = ["Gecko_StrictFileOriginPolicy", "MozURL", "SpecSlice", "mozurl_new", "mozurl_clone", "mozurl_common_base"]
     56 item_types = ["globals", "enums", "structs", "unions", "typedefs", "opaque", "functions", "constants"]
     57 
     58 
     59 [export.rename]
     60 "SpecSlice" = "MozURLSpecSlice"
     61 "MozURL" = "mozilla::net::MozURL"