lib: split endian into network/big/little per ref/hare/endian

hton/ntoh -> network.ww (ref/hare/endian/network.ha:5-36); be* byte
get/put -> big.ww (ref/hare/endian/big.ha:5-48); le* -> little.ww
(ref/hare/endian/little.ha:5-48). ww does not port endian.ha's host
dispatch, so no host file appears.

Pure move: every fn is byte-identical; the three section banner
lines are deleted (file names now carry them). The module-doc header
rides with network.ww — its amd64-is-LE sentence is the WHY for
hton being a swap.

Consumers: Makefile WWFIXTURE_SRC entry replaced in place. The
byteid roster is untouched: lib/endian is enrolled as an
import-probe keyed on `package endian;`, which every new file
still declares.
This commit is contained in:
2026-08-08 16:42:35 +09:00
parent 4c0d2d33e3
commit 8539343de4
5 changed files with 138 additions and 141 deletions

View File

@@ -70,7 +70,8 @@ WWFIXTURE_SRC = cmd/wwfixture/wwfixture.ww \
lib/ascii/ascii.ww lib/bytes/bytes.ww \
lib/crypto/math/math.ww lib/crypto/sha256/sha256.ww \
lib/encoding/hex/hex.ww lib/encoding/utf8/utf8.ww \
lib/endian/endian.ww lib/errors/errors.ww lib/fmt/fmt.ww \
lib/endian/big.ww lib/endian/little.ww lib/endian/network.ww \
lib/errors/errors.ww lib/fmt/fmt.ww \
lib/fnmatch/fnmatch.ww lib/hash/hash.ww \
lib/io/empty.ww lib/io/io.ww lib/io/stream.ww lib/io/types.ww \
lib/math/floats.ww lib/math/math.ww lib/memio/memio.ww \