feature(c/libuv): Add idle and check

This commit is contained in:
赵英杰
2024-08-29 14:59:24 +08:00
parent 4d268f67ae
commit 24cffb2a69
2 changed files with 54 additions and 0 deletions

27
c/libuv/check.go Normal file
View File

@@ -0,0 +1,27 @@
package libuv
import (
_ "unsafe"
"github.com/goplus/llgo/c"
)
/* Handle types. */
type Check struct {
Unused [120]byte
}
/* Function type */
// llgo:type C
type CheckCb func(Check *Check)
//go:linkname InitCheck C.uv_check_init
func InitCheck(loop *Loop, Check *Check) c.Int
// llgo:link (*Check).Start C.uv_check_start
func (Check *Check) Start(CheckCb CheckCb) c.Int { return 0 }
// llgo:link (*Check).Stop C.uv_check_stop
func (Check *Check) Stop() c.Int { return 0 }

27
c/libuv/idle.go Normal file
View File

@@ -0,0 +1,27 @@
package libuv
import (
_ "unsafe"
"github.com/goplus/llgo/c"
)
/* Handle types. */
type Idle struct {
Unused [120]byte
}
/* Function type */
// llgo:type C
type IdleCb func(idle *Idle)
//go:linkname InitIdle C.uv_idle_init
func InitIdle(loop *Loop, idle *Idle) c.Int
// llgo:link (*Idle).Start C.uv_idle_start
func (idle *Idle) Start(idleCb IdleCb) c.Int { return 0 }
// llgo:link (*Idle).Stop C.uv_idle_stop
func (idle *Idle) Stop() c.Int { return 0 }