lib: rename stdlib surface to Hare names; add endian/math
Sweeping rename so the lib/ surface mirrors Hare's stdlib spellings. - ascii: rune-taking predicates; ishex -> isxdigit - bufio: rinit -> init; take1/takeline -> readbyte/readline - bytes: indexsub -> index - encoding/utf8: runelen -> runesz - errors: eEOF/eShortRead/... -> eof/underread/... - fmt: errln -> errorln; println/fprintln return i64 - os: readfull/writefull -> readall/writeall; unlink -> remove - path: isabs -> abs; drop lastindex (now strings.rbyteindex) - strconv: u64toa/i64toa -> u64tos/i64tos; parse64/parseu64 -> stoi64/stou64 - strings: drop len/isempty; equal -> compare; indexbyte -> byteindex; +rbyteindex - types: drop numeric helpers (moved to math) - new lib/endian (htonu16/ntohu16), lib/math (absi32/absi64) - net: drop htons (use endian.htonu16) Callers in selfhost/, lib/ww/, cmd/w6c/cgen.c, and test/wcc/700_e2e.c updated to match.
This commit is contained in:
@@ -42,7 +42,6 @@ export fn listen(fd: i32, backlog: i32) i32 = {
|
||||
return syscall3(SYS_LISTEN, fd: i64, backlog: i64, 0): i32;
|
||||
};
|
||||
|
||||
// htons-equivalent: byte-swap a 16-bit port into network order.
|
||||
export fn htons(p: u16) u16 = {
|
||||
return ((p << 8) | (p >> 8)) & 0xffff;
|
||||
};
|
||||
// Byte-order conversions live in lib/endian (Hare's endian::htonu16
|
||||
// is the canonical name). Use `endian.htonu16` to put a port into
|
||||
// network order.
|
||||
|
||||
Reference in New Issue
Block a user