Skip to content

Use Input/Output IDs instead of passing pointers through C #1286

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 8 additions & 6 deletions crates/bridge_core/cbindgen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ cpp_compat = true
style = "type"
include_guard = "TECTONIC_BRIDGE_CORE_GENERATED_H"
after_includes = """
typedef struct ttbc_input_handle_t ttbc_input_handle_t;
typedef struct ttbc_output_handle_t ttbc_output_handle_t;
typedef ttbc_input_handle_t *rust_input_handle_t;
typedef ttbc_output_handle_t *rust_output_handle_t;
typedef uintptr_t rust_input_handle_t;
typedef uintptr_t rust_output_handle_t;
typedef rust_input_handle_t Option_InputId;
typedef rust_output_handle_t Option_OutputId;
#define INVALID_HANDLE ((uintptr_t)0)
"""

[enum]
prefix_with_name = true

[export]
exclude = ["Option_OutputId", "Option_InputId"]

[export.rename]
"CoreBridgeState" = "ttbc_state_t"
"Diagnostic" = "ttbc_diagnostic_t"
"FileFormat" = "ttbc_file_format"
"InputHandle" = "ttbc_input_handle_t"
"OutputHandle" = "ttbc_output_handle_t"
Loading
Loading