File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,21 @@ buffer with:
7474
7575Arrays and strings must be passed as pointers.
7676
77- ## Installation
77+ ### Structs
7878
79- Installation requires that [ ` cmake ` ] ( https://cmake.org/ ) is installed. Other
80- than that, this should install as an npm module without issue.
79+ For now, ` sbfffi ` doesn't have any built-in support for structs. That being
80+ said, there are some helpful libraries like
81+ [ ` shared-structs ` ] ( https://www.npmjs.com/package/shared-structs ) and
82+ [ ` ref-napi ` ] ( https://www.npmjs.com/package/ref-napi ) (and its family of
83+ modules). As long as you can build up a C struct into a Buffer, you can pass
84+ pointers to them into C functions. Non-pointer struct arguments or return values
85+ are not supported.
86+
87+ ## Development
88+
89+ Using a non-release version of ` sbffi ` requires that
90+ [ ` cmake ` ] ( https://cmake.org/ ) is installed in order to compile the native
91+ addon.
8192
8293## Benchmarks
8394
Original file line number Diff line number Diff line change 11* Support var args (` va_list ` )
22* Test with actual threads.
3- * Build or recommend a library for dealing with C structs/enums/unions.
You can’t perform that action at this time.
0 commit comments