feat(c/libuv/demo): Add libuv async_fs demo

Signed-off-by: hackerchai <i@hackerchai.com>

fix(c/libuv): fix fs demo

Signed-off-by: hackerchai <i@hackerchai.com>

refactor(c/libuv): neat comment and adapt merge

Signed-off-by: hackerchai <i@hackerchai.com>
This commit is contained in:
hackerchai
2024-07-23 11:01:28 +08:00
parent db6930d9e4
commit 545f9f2cca
4 changed files with 163 additions and 21 deletions

View File

@@ -27,10 +27,6 @@ type Loop struct {
Unused [0]byte
}
type Handle struct {
Unused [0]byte
}
type Buf struct {
Base *c.Char
Len uintptr
@@ -45,6 +41,8 @@ type WalkCb func(handle *Handle, arg c.Pointer)
// ----------------------------------------------
/* Loop related functions and method. */
//go:linkname LoopSize C.uv_loop_size
func LoopSize() uintptr
@@ -122,20 +120,9 @@ func (l *Loop) BackendTimeout() int {
return 0
}
// llgo:link (*Handle).Ref C.uv_ref
func (h *Handle) Ref() {
return
}
// ----------------------------------------------
// llgo:link (*Handle).Unref C.uv_unref
func (h *Handle) Unref() {
return
}
// llgo:link (*Handle).HasRef C.uv_has_ref
func (h *Handle) HasRef() int {
return 0
}
/* Buf related functions and method. */
//go:linkname InitBuf C.uv_buf_init
func InitBuf(base *c.Char, len c.Uint) Buf