style: Re-arranged procs.

This commit is contained in:
2026-07-08 16:59:40 -04:00
parent 27b3c68df7
commit 18491ad83e
+5 -6
View File
@@ -2,7 +2,6 @@ package zmq
import "core:c"
import "core:os"
import "core:strings"
foreign import lib "system:zmq"
@@ -152,12 +151,8 @@ send_string :: proc(s: Socket, buf: string, flags: Flags = {}) -> (int, Error) {
}
send_const :: proc {
send_const_string,
send_const_bytes,
}
send_const_string :: proc(s: Socket, $str: string, flags: Flags = {}) -> (int, Error) {
return send_const_bytes(s, transmute([]byte)str, flags)
send_const_string,
}
// buf must have @(rodata) or global lifetime.
@@ -170,6 +165,10 @@ send_const_bytes :: proc(s: Socket, buf: []byte, flags: Flags = {}) -> (int, Err
return int(n), nil
}
send_const_string :: proc(s: Socket, $str: string, flags: Flags = {}) -> (int, Error) {
return send_const_bytes(s, transmute([]byte)str, flags)
}
recv :: proc(s: Socket, buf: []u8, flags: Flags = Flags{}) -> (int, Error) {
n := _recv(s, rawptr(&buf[0]), c.size_t(len(buf)), flags)
if n < 0 {