mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
docs: add doc.go files and godoc comments to all packages
Add package-level documentation (doc.go) to all 22 first-party packages and godoc comments to ~150 previously undocumented exported symbols across common/, network/, and server/.
This commit is contained in:
4
common/pascalstring/doc.go
Normal file
4
common/pascalstring/doc.go
Normal file
@@ -0,0 +1,4 @@
|
||||
// Package pascalstring writes length-prefixed, null-terminated strings into a
|
||||
// ByteFrame. The prefix width is selectable (uint8, uint16, or uint32) and
|
||||
// strings are optionally encoded to Shift-JIS before writing.
|
||||
package pascalstring
|
||||
@@ -6,6 +6,8 @@ import (
|
||||
"golang.org/x/text/transform"
|
||||
)
|
||||
|
||||
// Uint8 writes x as a null-terminated string with a uint8 length prefix. If t
|
||||
// is true the string is first encoded to Shift-JIS.
|
||||
func Uint8(bf *byteframe.ByteFrame, x string, t bool) {
|
||||
if t {
|
||||
e := japanese.ShiftJIS.NewEncoder()
|
||||
@@ -20,6 +22,8 @@ func Uint8(bf *byteframe.ByteFrame, x string, t bool) {
|
||||
bf.WriteNullTerminatedBytes([]byte(x))
|
||||
}
|
||||
|
||||
// Uint16 writes x as a null-terminated string with a uint16 length prefix. If
|
||||
// t is true the string is first encoded to Shift-JIS.
|
||||
func Uint16(bf *byteframe.ByteFrame, x string, t bool) {
|
||||
if t {
|
||||
e := japanese.ShiftJIS.NewEncoder()
|
||||
@@ -34,6 +38,8 @@ func Uint16(bf *byteframe.ByteFrame, x string, t bool) {
|
||||
bf.WriteNullTerminatedBytes([]byte(x))
|
||||
}
|
||||
|
||||
// Uint32 writes x as a null-terminated string with a uint32 length prefix. If
|
||||
// t is true the string is first encoded to Shift-JIS.
|
||||
func Uint32(bf *byteframe.ByteFrame, x string, t bool) {
|
||||
if t {
|
||||
e := japanese.ShiftJIS.NewEncoder()
|
||||
|
||||
Reference in New Issue
Block a user