Skip to content

Commit

Permalink
chore: setup cbindgen to generate C Header
Browse files Browse the repository at this point in the history
Inspired by PR at: Ciantic#54
  • Loading branch information
Lej77 committed Sep 14, 2024
1 parent 825b7fb commit 620646d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@

/examples

# cbindgen generated header file:
VirtualDesktopAccessor.h

_*
47 changes: 47 additions & 0 deletions dll/cbindgen.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See https://github.com/eqrion/cbindgen/blob/master/docs.md#cbindgentoml
# for detailed documentation of every option here.

# Initial version of this file is from https://github.com/Ciantic/VirtualDesktopAccessor/pull/54
# Use this config to generate a C header by:
# - Installing cbindgen: cargo install cbindgen
# - Running it inside the "dll" folder: cbindgen --config cbindgen.toml --crate dll --output VirtualDesktopAccessor.h

language = "C++"

############## Options for Wrapping the Contents of the Header #################

# header = "/* Text to put at the beginning of the generated file. Probably a license. */"
# trailer = "/* Text to put at the end of the generated file */"
include_guard = "VirtualDesktopAccessor_h"
#pragma_once = true
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
include_version = true
namespace = "VirtualDesktopAccessor"
sys_includes = ["cstdint", "Windows.h"]
includes = []
no_includes = true
after_includes = ""

documentation_length = "short"
line_endings = "CRLF" # also "CR", "CRLF", "Native"

style = "both"
cpp_compat = true

[defines]

[export]
include = []
exclude = ["Lazy", "HWND", "GUID"]

[fn]
prefix = "__declspec(dllimport)"

[parse]
parse_deps = false
clean = true

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

0 comments on commit 620646d

Please sign in to comment.