|
libmobi
C library for handling MOBI format ebook documents
|
Functions for reading and parsing of MOBI document. More...
#include <stdio.h>#include <stdlib.h>#include <string.h>#include "read.h"#include "util.h"#include "index.h"#include "debug.h"Functions | |
| MOBI_RET | mobi_load_pdbheader (MOBIData *m, FILE *file) |
| Read palm database header from file into MOBIData structure (MOBIPdbHeader) More... | |
| MOBI_RET | mobi_load_reclist (MOBIData *m, FILE *file) |
| Read list of database records from file into MOBIData structure (MOBIPdbRecord) More... | |
| MOBI_RET | mobi_load_rec (MOBIData *m, FILE *file) |
| Read record data and size from file into MOBIData structure (MOBIPdbRecord) More... | |
| MOBI_RET | mobi_load_recdata (MOBIPdbRecord *rec, FILE *file) |
| Read record data from file into MOBIPdbRecord structure. More... | |
| MOBI_RET | mobi_parse_extheader (MOBIData *m, MOBIBuffer *buf) |
| Parse EXTH header from Record 0 into MOBIData structure (MOBIExthHeader) More... | |
| MOBI_RET | mobi_parse_mobiheader (MOBIData *m, MOBIBuffer *buf) |
| Parse MOBI header from Record 0 into MOBIData structure (MOBIMobiHeader) More... | |
| MOBI_RET | mobi_parse_record0 (MOBIData *m, const size_t seqnumber) |
| Parse Record 0 into MOBIData structure. More... | |
| size_t | mobi_get_record_extrasize (const MOBIPdbRecord *record, const uint16_t flags) |
| Calculate the size of extra bytes at the end of text record. More... | |
| size_t | mobi_get_record_mb_extrasize (const MOBIPdbRecord *record, const uint16_t flags) |
| Calculate the size of extra multibyte section at the end of text record. More... | |
| MOBI_RET | mobi_parse_huff (MOBIHuffCdic *huffcdic, const MOBIPdbRecord *record) |
| Parse HUFF record into MOBIHuffCdic structure. More... | |
| MOBI_RET | mobi_parse_cdic (MOBIHuffCdic *huffcdic, const MOBIPdbRecord *record, const size_t num) |
| Parse CDIC record into MOBIHuffCdic structure. More... | |
| MOBI_RET | mobi_parse_huffdic (const MOBIData *m, MOBIHuffCdic *huffcdic) |
| Parse a set of HUFF and CDIC records into MOBIHuffCdic structure. More... | |
| MOBI_RET | mobi_parse_fdst (const MOBIData *m, MOBIRawml *rawml) |
| Parse FDST record into MOBIRawml structure (MOBIFdst member) More... | |
| MOBI_RET | mobi_load_file (MOBIData *m, FILE *file) |
| Read MOBI document from file into MOBIData structure. More... | |
| MOBI_RET | mobi_load_filename (MOBIData *m, const char *path) |
| Read MOBI document from a path into MOBIData structure. More... | |
Functions for reading and parsing of MOBI document.
Copyright (c) 2014 Bartek Fabiszewski http://www.fabiszewski.net
This file is part of libmobi. Licensed under LGPL, either version 3, or any later. See http://www.gnu.org/licenses/
Read palm database header from file into MOBIData structure (MOBIPdbHeader)
| [in,out] | m | MOBIData structure to be filled with read data |
| [in] | file | Filedescriptor to read from |
Read record data and size from file into MOBIData structure (MOBIPdbRecord)
| [in,out] | m | MOBIData structure to be filled with read data |
| [in] | file | Filedescriptor to read from |
| MOBI_RET mobi_load_recdata | ( | MOBIPdbRecord * | rec, |
| FILE * | file | ||
| ) |
Read record data from file into MOBIPdbRecord structure.
| [in,out] | rec | MOBIPdbRecord structure to be filled with read data |
| [in] | file | Filedescriptor to read from |
Read list of database records from file into MOBIData structure (MOBIPdbRecord)
| [in,out] | m | MOBIData structure to be filled with read data |
| [in] | file | Filedescriptor to read from |
| MOBI_RET mobi_parse_cdic | ( | MOBIHuffCdic * | huffcdic, |
| const MOBIPdbRecord * | record, | ||
| const size_t | num | ||
| ) |
Parse CDIC record into MOBIHuffCdic structure.
| [in,out] | huffcdic | MOBIHuffCdic structure to be filled with parsed data |
| [in] | record | MOBIPdbRecord structure containing the record |
| [in] | num | Number of CDIC record in a set, starting from zero |
| MOBI_RET mobi_parse_extheader | ( | MOBIData * | m, |
| MOBIBuffer * | buf | ||
| ) |
Parse EXTH header from Record 0 into MOBIData structure (MOBIExthHeader)
| [in,out] | m | MOBIData structure to be filled with parsed data |
| [in] | buf | MOBIBuffer buffer to read from |
| MOBI_RET mobi_parse_huff | ( | MOBIHuffCdic * | huffcdic, |
| const MOBIPdbRecord * | record | ||
| ) |
Parse HUFF record into MOBIHuffCdic structure.
| [in,out] | huffcdic | MOBIHuffCdic structure to be filled with parsed data |
| [in] | record | MOBIPdbRecord structure containing the record |
| MOBI_RET mobi_parse_huffdic | ( | const MOBIData * | m, |
| MOBIHuffCdic * | huffcdic | ||
| ) |
Parse a set of HUFF and CDIC records into MOBIHuffCdic structure.
| [in] | m | MOBIData structure with loaded MOBI document |
| [in,out] | huffcdic | MOBIHuffCdic structure to be filled with parsed data |
| MOBI_RET mobi_parse_mobiheader | ( | MOBIData * | m, |
| MOBIBuffer * | buf | ||
| ) |
Parse MOBI header from Record 0 into MOBIData structure (MOBIMobiHeader)
| [in,out] | m | MOBIData structure to be filled with parsed data |
| [in] | buf | MOBIBuffer buffer to read from |
Parse Record 0 into MOBIData structure.
This function will parse MOBIRecord0Header, MOBIMobiHeader and MOBIExthHeader
| [in,out] | m | MOBIData structure to be filled with parsed data |
| [in] | seqnumber | Sequential number of the palm database record |