Documentation ¶
Overview ¶
Package types contains types and constants to create MOBI formatted books.
Index ¶
- Constants
- Variables
- type EXTHEntryHeader
- type EXTHEntryType
- type EXTHHeader
- type FCISRecord
- type FDSTEntry
- type FDSTHeader
- type FLISRecord
- type IDXTHeader
- type IDXTSingleHeader
- type INDXHeader
- type KF8Header
- type MOBIHeader
- type PalmDocHeader
- type TAGXHeader
- type TAGXSingleHeader
- type TAGXTag
- type TAGXTagTable
Constants ¶
View Source
const ( CBNCXSingle byte = 15 // 0x0F CBNCXParent byte = 111 // 0x6F CBNCXChild byte = 31 // 0x1F CBSkeleton byte = 10 // 0x0A )
View Source
const EOFRecordLength = 4
View Source
const EXTHEntryHeaderLength = 8 // 0x08
View Source
const EXTHHeaderLength = 12 // 0x0C
View Source
const FCISRecordLength = 52
View Source
const FDSTEntryLength = 8 // 0x08
View Source
const FDSTHeaderLength = 12 // 0x0C
View Source
const FLISRecordLength = 36
View Source
const IDXTHeaderLength = 4 // 0x04
View Source
const IDXTSingleHeaderLength = 6 // 0x06
View Source
const INDXHeaderLength = 192 // 0xC0
View Source
const KF8HeaderLength = MOBIHeaderLength + 32
View Source
const MOBIHeaderLength = 232 // 0xE8
View Source
const PalmDocHeaderLength = 16 // 0x10
View Source
const TAGXHeaderLength = 12 // 0x0C
View Source
const TAGXSingleHeaderLength = 32 // 0x20
View Source
const TAGXTagLength = 4 // 0x04
Variables ¶
View Source
var EOFRecord = pdb.RawRecord{0xE9, 0x8E, 0x0D, 0x0A}
View Source
var TAGXTableChunk = TAGXTagTable{ TAGXTagChunkCNCXOffset, TAGXTagChunkFileNumber, TAGXTagChunkSequenceNumber, TAGXTagChunkGeometry, TAGXTagEnd, }
View Source
var TAGXTableGuide = TAGXTagTable{ TAGXTagGuideTitle, TAGXTagGuidePosFid, TAGXTagEnd, }
View Source
var TAGXTableNCXSingle = TAGXTagTable{ TAGXTagEntryPosition, TAGXTagEntryLength, TAGXTagEntryNameOffset, TAGXTagEntryDepthLevel, TAGXTagEnd, }
View Source
var TAGXTableSkeleton = TAGXTagTable{ TAGXTagSkeletonChunkCount, TAGXTagSkeletonGeometry, TAGXTagEnd, }
Functions ¶
This section is empty.
Types ¶
type EXTHEntryHeader ¶
type EXTHEntryHeader struct { RecordType EXTHEntryType RecordLength uint32 }
func NewEXTHEntryHeader ¶
func NewEXTHEntryHeader(RecordType EXTHEntryType, RecordLength uint32) EXTHEntryHeader
type EXTHEntryType ¶
type EXTHEntryType uint32
const ( EXTHDRMServer EXTHEntryType = 1 EXTHDRMCommerce EXTHEntryType = 2 EXTHDRMEbookBase EXTHEntryType = 3 EXTHTitle EXTHEntryType = 99 EXTHAuthor EXTHEntryType = 100 EXTHPublisher EXTHEntryType = 101 EXTHImprint EXTHEntryType = 102 EXTHDescription EXTHEntryType = 103 EXTHISBN EXTHEntryType = 104 EXTHSubject EXTHEntryType = 105 EXTHPublishingDate EXTHEntryType = 106 EXTHReview EXTHEntryType = 107 EXTHContributor EXTHEntryType = 108 EXTHRights EXTHEntryType = 109 EXTHSubjectCode EXTHEntryType = 110 EXTHType_ EXTHEntryType = 111 EXTHSource EXTHEntryType = 112 EXTHASIN EXTHEntryType = 113 EXTHVersion EXTHEntryType = 114 EXTHSample EXTHEntryType = 115 EXTHStartReading EXTHEntryType = 116 EXTHAdult EXTHEntryType = 117 EXTHPrice EXTHEntryType = 118 EXTHCurrency EXTHEntryType = 119 EXTHKF8Boundary EXTHEntryType = 121 EXTHFixedLayout EXTHEntryType = 122 EXTHBookType EXTHEntryType = 123 EXTHOrientationLock EXTHEntryType = 124 EXTHKF8CountResources EXTHEntryType = 125 EXTHOrigResolution EXTHEntryType = 126 EXTHZeroGutter EXTHEntryType = 127 EXTHZeroMargin EXTHEntryType = 128 EXTHKF8CoverURI EXTHEntryType = 129 EXTHKF8UnidentifiedCount EXTHEntryType = 131 EXTHRegionMagnification EXTHEntryType = 132 EXTHDictName EXTHEntryType = 200 EXTHCoverOffset EXTHEntryType = 201 EXTHThumbOffset EXTHEntryType = 202 EXTHHasFakeCover EXTHEntryType = 203 EXTHCreatorSoftware EXTHEntryType = 204 EXTHCreatorMajor EXTHEntryType = 205 EXTHCreatorMinor EXTHEntryType = 206 EXTHCreatorBuild EXTHEntryType = 207 EXTHWatermark EXTHEntryType = 208 EXTHTamperKeys EXTHEntryType = 209 EXTHFontSignature EXTHEntryType = 300 EXTHClippingLimit3XX EXTHEntryType = 301 EXTHClippingLimit EXTHEntryType = 401 EXTHPublisherLimit EXTHEntryType = 402 EXTHTtsDisable EXTHEntryType = 404 EXTHRental EXTHEntryType = 406 EXTHDocType EXTHEntryType = 501 EXTHLastUpdate EXTHEntryType = 502 EXTHUpdatedTitle EXTHEntryType = 503 EXTHASIN5XX EXTHEntryType = 504 EXTHTitleFurigana EXTHEntryType = 508 EXTHCreatorFurigana EXTHEntryType = 517 EXTHPublisherFurigana EXTHEntryType = 522 EXTHLanguage EXTHEntryType = 524 EXTHPrimaryWritingMode EXTHEntryType = 525 EXTHPageProgressionDirection EXTHEntryType = 527 EXTHOverrideFonts EXTHEntryType = 528 EXTHSourceDescription EXTHEntryType = 529 EXTHDictLangInput EXTHEntryType = 531 EXTHDictLangOutput EXTHEntryType = 532 EXTHInputSourceType EXTHEntryType = 534 EXTHCreatorBuildRev EXTHEntryType = 535 EXTHContainerInfo EXTHEntryType = 536 EXTHContainerResolution EXTHEntryType = 538 EXTHContainerMimetype EXTHEntryType = 539 EXTHContainerID EXTHEntryType = 543 )
type EXTHHeader ¶
func NewEXTHHeader ¶
func NewEXTHHeader(HeaderLength uint32, EntryCount uint32) EXTHHeader
type FCISRecord ¶
type FCISRecord struct { FCIS [4]byte Fixed1 uint32 Fixed2 uint32 Fixed3 uint32 Fixed4 uint32 TextLength uint32 Fixed5 uint32 Fixed6 uint32 Fixed7 uint32 Fixed8 uint32 Fixed9 uint32 Fixed10 uint16 Fixed11 uint16 Fixed12 uint32 }
func NewFCISRecord ¶
func NewFCISRecord(TextLength uint32) FCISRecord
type FDSTHeader ¶
func NewFDSTHeader ¶
func NewFDSTHeader() FDSTHeader
type FLISRecord ¶
type FLISRecord struct { FLIS [4]byte Fixed1 uint32 Fixed2 uint16 Fixed3 uint16 Fixed4 uint32 Fixed5 uint32 Fixed6 uint16 Fixed7 uint16 Fixed8 uint32 Fixed9 uint32 Fixed10 uint32 }
func NewFLISRecord ¶
func NewFLISRecord() FLISRecord
type IDXTHeader ¶
type IDXTHeader struct {
IDXT [4]byte
}
func NewIDXTHeader ¶
func NewIDXTHeader() IDXTHeader
type IDXTSingleHeader ¶
func NewIDXTSingleHeader ¶
func NewIDXTSingleHeader(Offset uint16) IDXTSingleHeader
type INDXHeader ¶
type INDXHeader struct { INDX [4]byte HeaderLength uint32 Unknown1 [4]byte HeaderType uint32 IndexType uint32 IDXTStart uint32 IndexRecordCount uint32 IndexEncoding uint32 IndexLanguage uint32 IndexEntryCount uint32 ORDTStart uint32 LIGTStart uint32 LIGTCount uint32 CNCXCount uint32 Unknown2 [124]byte TAGXOffset uint32 Unknown3 [8]byte }
func NewINDXHeader ¶
func NewINDXHeader(RecordCount uint32, EntryCount uint32) INDXHeader
type KF8Header ¶
type KF8Header struct { MOBIHeader ChunkIndex uint32 // SECT SkeletonIndex uint32 // SKEL HuffmanTableIndex uint32 // DATP GuideIndex uint32 // OTH Unknown [16]byte }
func NewKF8Header ¶
func NewKF8Header() KF8Header
type MOBIHeader ¶
type MOBIHeader struct { MOBI [4]byte HeaderLength uint32 MOBIType uint32 TextEncoding uint32 UniqueID uint32 FileVersion uint32 OrthographicIndex uint32 InflectionIndex uint32 IndexNames uint32 IndexKeys uint32 ExtraIndex0 uint32 ExtraIndex1 uint32 ExtraIndex2 uint32 ExtraIndex3 uint32 ExtraIndex4 uint32 ExtraIndex5 uint32 FirstNonBookIndex uint32 FullNameOffset uint32 FullNameLength uint32 Locale uint32 InputLanguage uint32 OutputLanguage uint32 MinVersion uint32 FirstImageIndex uint32 HuffmanRecordOffset uint32 HuffmanRecordCount uint32 HuffmanTableOffset uint32 HuffmanTableLength uint32 EXTHFlags uint32 Unknown1 [32]byte DRMOffset uint32 DRMCount uint32 DRMSize uint32 DRMFlags uint32 Unknown2 [12]byte FirstContentRecordNumberOrFDSTNumberMSB uint16 LastContentRecordNumberOrFDSTNumberLSB uint16 Unknown3OrFDSTEntryCount uint32 FCISRecordNumber uint32 FCISRecordCount uint32 FLISRecordNumber uint32 FLISRecordCount uint32 Unknown4 uint64 Unknown5 uint32 FirstCompilationSectionCount uint32 CompilationSectionCount uint32 Unknown6 uint32 ExtraRecordDataFlags uint32 INDXRecordOffset uint32 }
func NewMOBIHeader ¶
func NewMOBIHeader() MOBIHeader
type PalmDocHeader ¶
type PalmDocHeader struct { Compression uint16 Unused1 uint16 TextLength uint32 TextRecordCount uint16 RecordSize uint16 Encryption uint16 Unknown1 uint16 }
func NewPalmDocHeader ¶
func NewPalmDocHeader() PalmDocHeader
type TAGXHeader ¶
func NewTAGXHeader ¶
func NewTAGXHeader() TAGXHeader
type TAGXSingleHeader ¶
type TAGXSingleHeader struct { TAGX [4]byte HeaderLength uint32 ControlByteCount uint32 TagTable [5]TAGXTag }
func NewTAGXSingleHeader ¶
func NewTAGXSingleHeader() TAGXSingleHeader
type TAGXTag ¶
type TAGXTag uint32
const ( TAGXTagEntryPosition TAGXTag = 0x01010100 TAGXTagEntryLength TAGXTag = 0x02010200 TAGXTagEntryNameOffset TAGXTag = 0x03010400 TAGXTagEntryDepthLevel TAGXTag = 0x04010800 TAGXTagEntryParent TAGXTag = 0x15011000 TAGXTagEntryChild1 TAGXTag = 0x16012000 TAGXTagEntryChildN TAGXTag = 0x17014000 TAGXTagEntryPosFid TAGXTag = 0x06028000 TAGXTagSkeletonChunkCount TAGXTag = 0x01010300 TAGXTagSkeletonGeometry TAGXTag = 0x06020C00 TAGXTagChunkCNCXOffset TAGXTag = 0x02010100 TAGXTagChunkFileNumber TAGXTag = 0x03010200 TAGXTagChunkSequenceNumber TAGXTag = 0x04010400 TAGXTagChunkGeometry TAGXTag = 0x06020800 TAGXTagGuideTitle TAGXTag = 0x01010100 TAGXTagGuidePosFid TAGXTag = 0x06020200 TAGXTagEnd TAGXTag = 0x00000001 )
type TAGXTagTable ¶
type TAGXTagTable []TAGXTag
Click to show internal directories.
Click to hide internal directories.