Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cbindgen config #51

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 45 additions & 83 deletions rust/pact_matching_ffi/cbindgen.toml
Original file line number Diff line number Diff line change
@@ -1,108 +1,70 @@
# This is a template cbindgen.toml file with all of the default values.
# Some values are commented out because their absence is the real default.
#==============================================================================
#
# See https://github.com/eqrion/cbindgen/blob/master/docs.md#cbindgentoml
# for detailed documentation of every option here.
# cbindgen configuration for Pact Matching FFI
#
# For more information on cbindgen configuration, see:
# https://github.com/eqrion/cbindgen/blob/master/docs.md#cbindgentoml
#
#==============================================================================

# Generate bindings for the C language.
language = "C"

############## Options for Wrapping the Contents of the Header #################
# Wrap generated file in an include guard.
include_guard = "pact_matching_ffi_h"

# Note the version of cbindgen used to generate the header.
include_version = true

# Wrap generated file in C++ compatibility code.
cpp_compat = true

# Generate documentation in Doxygen style.
documentation_style = "doxy"

# Generate C structs as `typedef struct MyType {} MyType;`.
style = "both"

# Header to put at the top of the file (required by Doxygen).
header = """
/**
* @file
* @brief "An FFI interface to the `pact_matching` library, enabling cross-language use of Pact's core matching functionality."
*/
"""
# trailer = "/* Text to put at the end of the generated file */"
include_guard = "pact_matching_ffi_h"
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
include_version = true
# namespace = ""
namespaces = []
using_namespaces = []
sys_includes = []
includes = []
no_includes = false
cpp_compat = true

############################ Code Style Options ################################

braces = "SameLine"
line_length = 100
tab_width = 2
documentation_style = "doxy"

############################# Codegen Options ##################################
# Warning to include saying the file is autogenerated.
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"

style = "both"

[defines]
# "target_os = freebsd" = "DEFINE_FREEBSD"
# "feature = serde" = "DEFINE_SERDE"

[export]
include = []
exclude = []
# prefix = "CAPI_"
item_types = []
renaming_overrides_prefixing = false

[export.rename]

[export.body]

[fn]
rename_args = "None"
# must_use = "MUST_USE_FUNC"
# prefix = "START_FUNC"
# postfix = "END_FUNC"
args = "auto"
sort_by = "None"

[struct]
rename_fields = "None"
# must_use = "MUST_USE_STRUCT"
derive_constructor = false
derive_eq = false
derive_neq = false
derive_lt = false
derive_lte = false
derive_gt = false
derive_gte = false
#==============================================================================
# Enum Rules
#------------------------------------------------------------------------------

[enum]
rename_variants = "None"
# must_use = "MUST_USE_ENUM"
add_sentinel = false
prefix_with_name = true
derive_helper_methods = false
derive_const_casts = false
derive_mut_casts = false
# cast_assert_name = "ASSERT"
derive_tagged_enum_destructor = false
derive_tagged_enum_copy_constructor = false
enum_class = true
private_default_tagged_enum_constructor = false

[const]
allow_static_const = true
allow_constexpr = false
# Prefix enum variants with the name of the overall type.
prefix_with_name = true

[macro_expansion]
bitflags = false

############## Options for How Your Rust library Should Be Parsed ##############
#==============================================================================
# Parsing Rules
#------------------------------------------------------------------------------

[parse]

# Parse dependencies.
parse_deps = true

# Only include `pact_matching` (nothing else).
include = ["pact_matching"]
exclude = []
clean = false
extra_bindings = []


#==============================================================================
# Macro Expansion Rules
#------------------------------------------------------------------------------

[parse.expand]
crates = []
all_features = false
default_features = true
features = []

# Expand macros for `pact_matching_ffi`.
crates = ["pact_matching_ffi"]
10 changes: 6 additions & 4 deletions rust/pact_matching_ffi/src/log/target.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
//! The special log target to use for logs from this crate.

/// The log target to use through the crate. Note that normally the logging macros would
/// pull the module path of the code calling the logger, but in this case everything ends up
/// in a flat namespace on the C side anyway, and the logging makes clear what's being called.
/// So having a singular log target is fine.
// The log target to use through the crate. Note that normally the logging macros would
// pull the module path of the code calling the logger, but in this case everything ends up
// in a flat namespace on the C side anyway, and the logging makes clear what's being called.
// So having a singular log target is fine.

/// cbindgen:ignore
pub(crate) const TARGET: &str = "pact::matching::ffi";