Skip to content

Commit ddf9764

Browse files
committed
docs: update readme.md
1 parent a3f29a1 commit ddf9764

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ffi-rs
22

33
<div>
4-
<a href="https://github.com/zhangyuang/node-ffi-rs/blob/master/README.md">English</a> | <a href="https://github.com/zhangyuang/node-ffi-rs/blob/master/README_Zh.md">简体中文</a>
4+
<a href="./README.md">English</a> | <a href="./README_Zh.md">简体中文</a>
55
</div>
66

77
A module written in Rust and N-API provides interface (FFI) features for Node.js
@@ -536,9 +536,9 @@ freePointer({
536536

537537
To create a C struct or get a C struct as a return type, you need to define the types of the parameters strictly in the order in which the fields of the C structure are defined.
538538

539-
`ffi-rs` provides a C struct named `Person` with many types of fields in [sum.cpp](https://github.com/zhangyuang/node-ffi-rs/blob/master/cpp/sum.cpp#L48)
539+
`ffi-rs` provides a C struct named `Person` with many types of fields in [sum.cpp](./cpp/sum.cpp#L48)
540540

541-
The example call method about how to call a foreign function to create a `Person` struct or use `Person` struct as a return value is [here](https://github.com/zhangyuang/node-ffi-rs/blob/master/test.ts#L289)
541+
The example call method about how to call a foreign function to create a `Person` struct or use `Person` struct as a return value is [here](./test.ts#L289)
542542

543543
#### Use array in struct
544544

@@ -769,7 +769,7 @@ If you set freeResultMemory to false, `ffi-rs` will not release the return resul
769769

770770
* Use `DataType.External` as paramsType or retType
771771

772-
If developers use `DataType.External` as paramsType or retType, please use `freePointer` to release the memory of the pointer when this memory is no longer in use. ref [test.ts](./test.ts#170)
772+
If developers use `DataType.External` as paramsType or retType, please use `freePointer` to release the memory of the pointer when this memory is no longer in use. ref [test.ts](./test.ts#L170)
773773

774774
## runInNewThread
775775

README_Zh.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ffi-rs
22

33
<div>
4-
<a href="https://github.com/zhangyuang/node-ffi-rs/blob/master/README.md">English</a> | <a href="https://github.com/zhangyuang/node-ffi-rs/blob/master/README_Zh.md">简体中文</a>
4+
<a href="./README.md">English</a> | <a href="./README_Zh.md">简体中文</a>
55
</div>
66

77
一个用Rust和N-API编写的模块, 为Node.js提供外部函数接口(FFI)功能,中文文档的更新不一定及时,建议阅读[英文文档](./README.md)以便获取最新的信息
@@ -518,7 +518,7 @@ deepStrictEqual(restoreData, [
518518

519519
* 使用`DataType.External`作为paramsType或retType
520520

521-
如果开发者使用 `DataType.External` 作为paramsType或retType, 请使用 `freePointer` 释放指针的内存。参考[test.ts](./test.ts#170)
521+
如果开发者使用 `DataType.External` 作为paramsType或retType, 请使用 `freePointer` 释放指针的内存。参考[test.ts](./test.ts#L170)
522522

523523
#### wrapPointer
524524

@@ -566,9 +566,9 @@ const unwrapPtr = unwrapPointer([ptr])[0]
566566

567567
要创建c结构体或获取c结构体作为返回类型, 你需要严格按照c结构体字段定义的顺序定义参数类型。
568568

569-
`ffi-rs`[sum.cpp](https://github.com/zhangyuang/node-ffi-rs/blob/master/cpp/sum.cpp#L48)中提供了一个名为 `Person` 的c结构体, 包含多种类型的字段
569+
`ffi-rs`[sum.cpp](./cpp/sum.cpp#L48)中提供了一个名为 `Person` 的c结构体, 包含多种类型的字段
570570

571-
关于如何调用外部函数来创建 `Person` 结构体或使用 `Person` 结构体作为返回值的示例调用方法在[这里](https://github.com/zhangyuang/node-ffi-rs/blob/master/test.ts#L289)
571+
关于如何调用外部函数来创建 `Person` 结构体或使用 `Person` 结构体作为返回值的示例调用方法在[这里](./test.ts#L289)
572572

573573
#### 在结构体中使用数组
574574

@@ -800,7 +800,7 @@ load({
800800

801801
* 使用`DataType.External`作为paramsType或retType
802802

803-
如果开发者使用 `DataType.External` 作为paramsType或retType, 请在不再使用此内存时使用 `freePointer` 释放指针的内存。参考[test.ts](./test.ts#170)
803+
如果开发者使用 `DataType.External` 作为paramsType或retType, 请在不再使用此内存时使用 `freePointer` 释放指针的内存。参考[test.ts](./test.ts#L170)
804804

805805
## runInNewThread
806806

0 commit comments

Comments
 (0)