Documentation
¶
Index ¶
- Constants
- Variables
- func AppendRecord(filename string, data interface{}, theSize uintptr) (err error)
- func FindRecordStartIdx(dirFilename string, total int, createTime types.Time4, ...) (startIdx ptttype.SortIdx, err error)
- func GetHoroscope(m int, d int) int
- func GetNumRecords(filename string, size uintptr) int
- func GetRecords(boardID *ptttype.BoardID_t, filename string, startIdx ptttype.SortIdx, n int, ...) (summaries []*ptttype.ArticleSummaryRaw, err error)
- func IsLeapYear(year int) bool
- func PttLock(file *os.File, offset int64, theSize uintptr, mode int) (err error)
- func StringHash(theBytes []byte) uint32
- func StringHashWithHashBits(theBytes []byte) uint32
- func StripAnsi(src []byte, flag StripAnsiFlag) (dst []byte)
- func StripBlank(theBytes []byte) []byte
- func StripNoneBig5(str_out []byte) (sanitizedStr []byte)
- func SubstituteRecord(filename string, data interface{}, theSize uintptr, idxInStore int32) (err error)
- type StripAnsiFlag
Constants ¶
View Source
const ( //https://github.com/ptt/pttbbs/blob/master/include/fnv_hash.h //commit: 6bdd36898bde207683a441cdffe2981e95de5b20 FNV1_32_INIT uint32 = 33554467 FNV1_64_INIT uint64 = 0xcbf29ce484222325 FNV_32_PRIME uint32 = 0x01000193 FNV_64_PRIME uint64 = 0x100000001b3 )
View Source
const (
N_ITER_PTTLOCK = 10
)
Variables ¶
View Source
var (
ESCAPE_FLAG = []uint8{}/* 256 elements not displayed */
)
View Source
var (
ErrPttLock = errors.New("unable to ptt-lock")
)
Functions ¶
func AppendRecord ¶ added in v0.11.1
func FindRecordStartIdx ¶ added in v0.10.0
func FindRecordStartIdx(dirFilename string, total int, createTime types.Time4, filename *ptttype.Filename_t, isDesc bool) (startIdx ptttype.SortIdx, err error)
FindRecordStartIdx
startIdx should be 1-total.
func GetNumRecords ¶
func GetRecords ¶ added in v0.3.0
func IsLeapYear ¶
func PttLock ¶ added in v0.11.1
PttLock
XXX https://github.com/ptt/pttbbs/issues/100 Need to sync with ptt-code.
func StringHash ¶
func StringHashWithHashBits ¶
func StripAnsi ¶ added in v0.5.0
func StripAnsi(src []byte, flag StripAnsiFlag) (dst []byte)
func StripBlank ¶ added in v0.9.0
func StripNoneBig5 ¶ added in v0.5.0
StringNoneBig5
https://github.com/ptt/pttbbs/issues/94 str is modified.
Types ¶
type StripAnsiFlag ¶ added in v0.5.0
type StripAnsiFlag int
const ( STRIP_ANSI_ALL StripAnsiFlag = iota STRIP_ANSI_ONLY_COLOR // allow only colors (ESC [ .. m) STRIP_ANSI_NO_RELOAD // allow all known (color+move) )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.