From b81ecb01b6849dcec796efc0bc92df165fe1c85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sz=2E=20Kov=C3=A1cs=20Roland?= Date: Sun, 7 Jul 2024 15:10:39 +0200 Subject: [PATCH] feat: add basic fiber functions --- README.md | 21 +--------- cbindgen.toml | 105 ++++++++++++++++++-------------------------------- 2 files changed, 39 insertions(+), 87 deletions(-) diff --git a/README.md b/README.md index 9e34c3d..a443c04 100644 --- a/README.md +++ b/README.md @@ -1,20 +1 @@ -Steps: - -cargo install - force cbindgen or brew install cbindgen -cbindgen - lang c - output include/munchausen.h - -rustup target add aarch64-apple-darwin -rustup target add x86_64-apple-darwin -rustup target add aarch64-apple-ios -rustup target add aarch64-apple-ios-sim -rustup target add x86_64-apple-ios - -make macos - -xcodebuild -create-xcframework \ --library libs/libmunchausen-macos.a \ --headers ./include/ \ --output Munchausen.xcframework - -zip -r bundle.zip Munchausen.xcframework -openssl dgst -sha256 bundle.zip \ No newline at end of file +# FFI interface for low level Fiber syscalls \ No newline at end of file diff --git a/cbindgen.toml b/cbindgen.toml index 2f3fd06..5ae691b 100644 --- a/cbindgen.toml +++ b/cbindgen.toml @@ -1,85 +1,56 @@ language = "C" -############## Options for Wrapping the Contents of the Header ################# -include_version = false -namespaces = [] -using_namespaces = [] -sys_includes = [] +after_includes = "" includes = [] +namespaces = [] no_includes = false -after_includes = "" +sys_includes = [] +using_namespaces = [] ############################ Code Style Options ################################ -braces = "SameLine" -line_length = 100 -tab_width = 4 -documentation = true -documentation_style = "auto" -documentation_length = "full" +braces = "SameLine" +documentation = true +documentation_length = "full" +documentation_style = "auto" line_endings = "LF" # also "CR", "CRLF", "Native" +line_length = 100 +tab_width = 4 -############################# Codegen Options ################################## - -style = "both" -sort_by = "Name" # default for `fn.sort_by` and `const.sort_by` -usize_is_size_t = true - -[export] -include = [] -exclude = [] -item_types = [] -renaming_overrides_prefixing = false +# Whether to add a `#pragma once` guard +# default: doesn't emit a `#pragma once` +pragma_once = true -[export.rename] +# An optional string of text to output between major sections of the generated +# file as a warning against manual editing +# +# default: doesn't emit anything +autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" -[export.body] +# Whether to include a comment with the version of cbindgen used to generate the file +# default: false +include_version = true -[export.mangle] - -[fn] -rename_args = "None" -args = "auto" -sort_by = "Name" - -[struct] -rename_fields = "None" -derive_constructor = false -derive_eq = false -derive_neq = false -derive_lt = false -derive_lte = false -derive_gt = false -derive_gte = false +[parse] +parse_deps = true -[enum] -rename_variants = "None" -add_sentinel = false -prefix_with_name = false -derive_helper_methods = false -derive_const_casts = false -derive_mut_casts = false -derive_tagged_enum_destructor = false -derive_tagged_enum_copy_constructor = false -enum_class = true -private_default_tagged_enum_constructor = false +[parse.expand] +# A list of crate names that should be run through `cargo expand` before +# parsing to expand any macros. Note that if a crate is named here, it +# will always be parsed, even if the blacklist/whitelist says it shouldn't be. +# +# default: [] +crates = ["fiber_ffi"] [const] +# Whether a generated constant can be a static const in C++ mode. I have no +# idea why you would turn this off. +# +# default: true allow_static_const = true -allow_constexpr = false -sort_by = "Name" - -[macro_expansion] -bitflags = false -[parse] -parse_deps = false -exclude = [] -clean = false -extra_bindings = [] +[export] +item_types = ["globals", "enums", "structs", "unions", "typedefs", "opaque", "functions", "constants"] -[parse.expand] -crates = [] -all_features = false -default_features = true -features = [] \ No newline at end of file +[macro_expansion] +bitflags = true