From 8fcac42f34966d40d1fb6d241af93db9466d1d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E8=8B=B1=E6=9D=B0?= <2635879218@qq.com> Date: Thu, 15 Aug 2024 10:57:29 +0800 Subject: [PATCH] c/libuv: Add multiple struct size --- c/libuv/net.go | 18 ++++++++++++------ c/libuv/timer.go | 6 +++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/c/libuv/net.go b/c/libuv/net.go index fe38973c..fcf50690 100644 --- a/c/libuv/net.go +++ b/c/libuv/net.go @@ -83,18 +83,21 @@ type Tcp struct { Unused [256]byte } +// TODO(spongehah): Udp type Udp struct { - Unused [0]byte + Unused [224]byte } /* Request types. */ +// TODO(spongehah): Req type Req struct { - Unused [0]byte + Unused [64]byte } +// TODO(spongehah): UdpSend type UdpSend struct { - Unused [0]byte + Unused [320]byte } // TODO(spongehah): Write @@ -109,16 +112,19 @@ type Connect struct { Unused [88]byte } +// TODO(spongehah): GetAddrInfo type GetAddrInfo struct { - Unused [0]byte + Unused [160]byte } +// TODO(spongehah): GetNameInfo type GetNameInfo struct { - Unused [0]byte + Unused [1320]byte } +// TODO(spongehah): Shutdown type Shutdown struct { - Unused [0]byte + Unused [80]byte } // ---------------------------------------------- diff --git a/c/libuv/timer.go b/c/libuv/timer.go index 0c31cb95..566d9a22 100644 --- a/c/libuv/timer.go +++ b/c/libuv/timer.go @@ -12,12 +12,12 @@ import ( // TODO(spongehah): Timer type Timer struct { - Unused [0]byte + Unused [152]byte } // ---------------------------------------------- -// llgo:type Cgit +// llgo:type C type TimerCb func(timer *Timer) // ---------------------------------------------- @@ -28,7 +28,7 @@ type TimerCb func(timer *Timer) 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 { +func (timer *Timer) Start(cb TimerCb, timeoutMs uint64, repeat uint64) c.Int { return 0 }