@yuuang/ffi-rs-linux-arm64-musl
Advanced tools
Comparing version 1.0.61 to 1.0.62
{ | ||
"name": "@yuuang/ffi-rs-linux-arm64-musl", | ||
"version": "1.0.61", | ||
"version": "1.0.62", | ||
"os": [ | ||
@@ -5,0 +5,0 @@ "linux" |
@@ -143,5 +143,7 @@ # ffi-rs | ||
Suggested develop with typescript to get type hints | ||
```js | ||
const { equal } = require('assert') | ||
const { load, DataType, open, close, arrayConstructor } = require('ffi-rs') | ||
const { load, DataType, open, close, arrayConstructor, define } = require('ffi-rs') | ||
const a = 1 | ||
@@ -167,2 +169,19 @@ const b = 100 | ||
// use define function to define a function signature | ||
const res = define({ | ||
sum: { | ||
library: "libsum", | ||
retType: DataType.I32, | ||
paramsType: [DataType.I32, DataType.I32], | ||
}, | ||
atoi: { | ||
library: "libnative", | ||
retType: DataType.I32, | ||
paramsType: [DataType.String], | ||
paramsValue: ["1000"], | ||
} | ||
}) | ||
equal(res.sum([1, 2]), 3) | ||
equal(res.atoi(["1000"]), 1000) | ||
``` | ||
@@ -169,0 +188,0 @@ |
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
615523
682