@yuuang/ffi-rs-darwin-x64
Advanced tools
Comparing version 1.0.59 to 1.0.60
{ | ||
"name": "@yuuang/ffi-rs-darwin-x64", | ||
"version": "1.0.59", | ||
"version": "1.0.60", | ||
"os": [ | ||
@@ -5,0 +5,0 @@ "darwin" |
@@ -25,3 +25,4 @@ # ffi-rs | ||
- Support modify data in place 🥸 | ||
- Provide many ways to handle pointer type directly | ||
- Provide many ways to handle pointer type directly 🐮 | ||
- Support output [errno](#errno) info 🤔️ | ||
@@ -79,3 +80,3 @@ ## benchmark | ||
If you want to call C++ function, see [tutorial](#C++) | ||
If you want to call C++ function whose argument type is class, you can use `pointer` type, see [tutorial](#C++) | ||
@@ -103,3 +104,3 @@ ## Support Platform | ||
### write C/C++ code | ||
### write foreign function code | ||
@@ -647,1 +648,19 @@ Note: The return value type of a function must be of type c | ||
``` | ||
## errno | ||
By default, `ffi-rs` will not output [errno](https://man7.org/linux/man-pages/man3/errno.3.html) info, developers can get it by pass `errno: true` when call open method like | ||
```js | ||
load({ | ||
library: 'libnative', | ||
funcName: 'setsockopt', | ||
retType: DataType.I32, | ||
paramsType: [DataType.I32, DataType.I32, DataType.I32, DataType.External, DataType.I32], | ||
paramsValue: [socket._handle.fd, level, option, pointer[0], 4], | ||
errno: true // set errno as true | ||
}) | ||
// The above code will return a object include three fields include errnoCode, errnoMessage, and the foreign function return value | ||
// { errnoCode: 22, errnoMessage: 'Invalid argument (os error 22)', value: -1 } | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
603295
663