feat(c/libuv): Add tcp, udp, poll, core, stream, err features
feat(c/io): add libuv async io with io, tcp, udp, timer, dns, loop
feat(c/io): add libuv async io with stream, req, handle
feat(c/libuv): rename c/io to c/libuv, and improve errro, net, handle, stream
feat(c/libuv): Add a libuv demo: echo_server
refactor(c/libuv): Adjust comments and file names to accommodate merge
2024-07-19 15:17:20 +08:00
|
|
|
package libuv
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
_ "unsafe"
|
2024-07-26 09:37:17 +08:00
|
|
|
|
|
|
|
|
"github.com/goplus/llgo/c"
|
feat(c/libuv): Add tcp, udp, poll, core, stream, err features
feat(c/io): add libuv async io with io, tcp, udp, timer, dns, loop
feat(c/io): add libuv async io with stream, req, handle
feat(c/libuv): rename c/io to c/libuv, and improve errro, net, handle, stream
feat(c/libuv): Add a libuv demo: echo_server
refactor(c/libuv): Adjust comments and file names to accommodate merge
2024-07-19 15:17:20 +08:00
|
|
|
)
|
|
|
|
|
|
2024-07-22 18:02:09 +08:00
|
|
|
// ----------------------------------------------
|
|
|
|
|
|
|
|
|
|
/* Handle types. */
|
|
|
|
|
|
|
|
|
|
type Timer struct {
|
|
|
|
|
Unused [0]byte
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------
|
|
|
|
|
|
2024-07-23 11:43:02 +08:00
|
|
|
// llgo:type Cgit
|
feat(c/libuv): Add tcp, udp, poll, core, stream, err features
feat(c/io): add libuv async io with io, tcp, udp, timer, dns, loop
feat(c/io): add libuv async io with stream, req, handle
feat(c/libuv): rename c/io to c/libuv, and improve errro, net, handle, stream
feat(c/libuv): Add a libuv demo: echo_server
refactor(c/libuv): Adjust comments and file names to accommodate merge
2024-07-19 15:17:20 +08:00
|
|
|
type TimerCb func(timer *Timer)
|
|
|
|
|
|
2024-07-22 18:02:09 +08:00
|
|
|
// ----------------------------------------------
|
|
|
|
|
|
|
|
|
|
/* Timer related function and method */
|
feat(c/libuv): Add tcp, udp, poll, core, stream, err features
feat(c/io): add libuv async io with io, tcp, udp, timer, dns, loop
feat(c/io): add libuv async io with stream, req, handle
feat(c/libuv): rename c/io to c/libuv, and improve errro, net, handle, stream
feat(c/libuv): Add a libuv demo: echo_server
refactor(c/libuv): Adjust comments and file names to accommodate merge
2024-07-19 15:17:20 +08:00
|
|
|
|
|
|
|
|
//go:linkname InitTimer C.uv_timer_init
|
|
|
|
|
func InitTimer(loop *Loop, timer *Timer) c.Int
|
|
|
|
|
|
|
|
|
|
// llgo:link (*Timer).Start C.uv_timer_start
|
|
|
|
|
func (timer *Timer) Start(cb TimerCb, timeout uint64, repeat uint64) c.Int {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// llgo:link (*Timer).Stop C.uv_timer_stop
|
|
|
|
|
func (timer *Timer) Stop() c.Int {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// llgo:link (*Timer).Again C.uv_timer_again
|
|
|
|
|
func (timer *Timer) Again() c.Int {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// llgo:link (*Timer).SetRepeat C.uv_timer_set_repeat
|
|
|
|
|
func (timer *Timer) SetRepeat(repeat uint64) {}
|
|
|
|
|
|
|
|
|
|
// llgo:link (*Timer).GetRepeat C.uv_timer_get_repeat
|
|
|
|
|
func (timer *Timer) GetRepeat() uint64 {
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// llgo:link (*Timer).GetDueIn C.uv_timer_get_due_in
|
|
|
|
|
func (timer *Timer) GetDueIn() uint64 {
|
|
|
|
|
return 0
|
|
|
|
|
}
|