Skip to content

Commit

Permalink
feat: add basic fiber functions
Browse files Browse the repository at this point in the history
  • Loading branch information
szkabaroli committed Jul 7, 2024
1 parent 74381ff commit b81ecb0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 87 deletions.
21 changes: 1 addition & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
# FFI interface for low level Fiber syscalls
105 changes: 38 additions & 67 deletions cbindgen.toml
Original file line number Diff line number Diff line change
@@ -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 = []
[macro_expansion]
bitflags = true

0 comments on commit b81ecb0

Please sign in to comment.