Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv): optimize functions Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv): mv name Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv): modify libs Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv): use new buffer arg Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv/demo): optimize code style with go style Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv): optimize code and add comment Signed-off-by: hackerchai <i@hackerchai.com> fix(c/libuv): fix TranslateSysError Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv): remove go wrapper Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv/demo): refactor c style Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/liobuv/demo): Some adjustments after removing go wrapper refactor(c/libuv/demo): add print in echo_server Signed-off-by: hackerchai <i@hackerchai.com> doc(c/libuv): add README.md for c/libuv Signed-off-by: hackerchai <i@hackerchai.com> feat(c/libuv): implement poll_init_socket Signed-off-by: hackerchai <i@hackerchai.com> refactor(c/libuv): mv poll_init_socket function Signed-off-by: hackerchai <i@hackerchai.com> refactor(demo): remove libuv demo Signed-off-by: hackerchai <i@hackerchai.com>
55 lines
1.1 KiB
Go
55 lines
1.1 KiB
Go
package libuv
|
|
|
|
import (
|
|
"github.com/goplus/llgo/c"
|
|
_ "unsafe"
|
|
)
|
|
|
|
// ----------------------------------------------
|
|
|
|
/* Handle types. */
|
|
|
|
type Timer struct {
|
|
Unused [0]byte
|
|
}
|
|
|
|
// ----------------------------------------------
|
|
|
|
// llgo:type Cgit
|
|
type TimerCb func(timer *Timer)
|
|
|
|
// ----------------------------------------------
|
|
|
|
/* Timer related function and method */
|
|
|
|
//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
|
|
}
|