16 #ifndef libmobi_mobi_h
17 #define libmobi_mobi_h
25 #if defined (__CYGWIN__) || defined (__MINGW32__)
26 #define MOBI_EXPORT __attribute__((visibility("default"))) __declspec(dllexport) extern
27 #elif defined (_WIN32)
28 #define MOBI_EXPORT __declspec(dllexport)
30 #define MOBI_EXPORT __attribute__((__visibility__("default")))
37 #define MOBI_NOTSET UINT32_MAX
39 #define MOBI_ENCRYPTION_NONE 0
40 #define MOBI_ENCRYPTION_V1 1
41 #define MOBI_ENCRYPTION_V2 2
43 #define MOBI_COMPRESSION_NONE 1
44 #define MOBI_COMPRESSION_PALMDOC 2
45 #define MOBI_COMPRESSION_HUFFCDIC 17480
94 EXTH_DRMEBOOKBASE = 3,
117 EXTH_KF8BOUNDARY = 121,
121 EXTH_COUNTRESOURCES = 125,
125 EXTH_KF8COVERURI = 129,
126 EXTH_RESCOFFSET = 131,
131 EXTH_THUMBOFFSET = 202,
132 EXTH_HASFAKECOVER = 203,
133 EXTH_CREATORSOFT = 204,
134 EXTH_CREATORMAJOR = 205,
135 EXTH_CREATORMINOR = 206,
136 EXTH_CREATORBUILD = 207,
137 EXTH_WATERMARK = 208,
138 EXTH_TAMPERKEYS = 209,
140 EXTH_FONTSIGNATURE = 300,
142 EXTH_CLIPPINGLIMIT = 401,
143 EXTH_PUBLISHERLIMIT = 402,
145 EXTH_TTSDISABLE = 404,
146 EXTH_READFORFREE = 405,
155 EXTH_LASTUPDATE = 502,
156 EXTH_UPDATEDTITLE = 503,
158 EXTH_TITLEFILEAS = 508,
159 EXTH_CREATORFILEAS = 517,
160 EXTH_PUBLISHERFILEAS = 522,
163 EXTH_CREATORSTRING = 526,
166 EXTH_SORCEDESC = 529,
167 EXTH_DICTLANGIN = 531,
168 EXTH_DICTLANGOUT = 532,
169 EXTH_INPUTSOURCE = 534,
170 EXTH_CREATORBUILDREV = 535,
611 const MOBIExthTag *tamperkeys,
const size_t tamperkeys_count);
MOBI_RET
Error codes returned by functions.
Definition: mobi.h:59
MOBIFiletype
Types of files stored in database records.
Definition: mobi.h:176
MOBIExthType
EXTH record types.
Definition: mobi.h:82
MOBIExthTag
EXTH record tags.
Definition: mobi.h:91
MOBIEncoding
Encoding types in MOBI header (offset 28)
Definition: mobi.h:215
@ MOBI_DATA_CORRUPT
Definition: mobi.h:63
@ MOBI_DRM_RANDOM_ERR
Definition: mobi.h:76
@ MOBI_ERROR
Definition: mobi.h:61
@ MOBI_DRM_KEYNOTFOUND
Definition: mobi.h:72
@ MOBI_DRM_PIDINV
Definition: mobi.h:71
@ MOBI_DRM_UNSUPPORTED
Definition: mobi.h:73
@ MOBI_SUCCESS
Definition: mobi.h:60
@ MOBI_PARAM_ERR
Definition: mobi.h:62
@ MOBI_BUFFER_END
Definition: mobi.h:69
@ MOBI_WRITE_FAILED
Definition: mobi.h:74
@ MOBI_DRM_EXPIRED
Definition: mobi.h:75
@ MOBI_FILE_UNSUPPORTED
Definition: mobi.h:66
@ MOBI_XML_ERR
Definition: mobi.h:70
@ MOBI_FILE_ENCRYPTED
Definition: mobi.h:65
@ MOBI_MALLOC_FAILED
Definition: mobi.h:67
@ MOBI_FILE_NOT_FOUND
Definition: mobi.h:64
@ MOBI_INIT_FAILED
Definition: mobi.h:68
@ T_GIF
Definition: mobi.h:186
@ T_JPG
Definition: mobi.h:185
@ T_VIDEO
Definition: mobi.h:199
@ T_BREAK
Definition: mobi.h:200
@ T_TTF
Definition: mobi.h:191
@ T_BMP
Definition: mobi.h:188
@ T_AUDIO
Definition: mobi.h:198
@ T_MP3
Definition: mobi.h:193
@ T_MPG
Definition: mobi.h:194
@ T_NCX
Definition: mobi.h:183
@ T_UNKNOWN
Definition: mobi.h:177
@ T_FONT
Definition: mobi.h:197
@ T_PNG
Definition: mobi.h:187
@ T_OPF
Definition: mobi.h:182
@ T_PDF
Definition: mobi.h:195
@ T_HTML
Definition: mobi.h:179
@ T_CSS
Definition: mobi.h:180
@ T_SVG
Definition: mobi.h:181
@ T_OTF
Definition: mobi.h:190
@ EXTH_REVIEW
Definition: mobi.h:104
@ EXTH_ORIENTATIONLOCK
Definition: mobi.h:120
@ EXTH_ZEROGUTTER
Definition: mobi.h:123
@ EXTH_CONTRIBUTOR
Definition: mobi.h:105
@ EXTH_ISBN
Definition: mobi.h:101
@ EXTH_SUBJECTCODE
Definition: mobi.h:107
@ EXTH_PUBLISHER
Definition: mobi.h:98
@ EXTH_DESCRIPTION
Definition: mobi.h:100
@ EXTH_ORIGRESOLUTION
Definition: mobi.h:122
@ EXTH_CURRENCY
Definition: mobi.h:116
@ EXTH_SOURCE
Definition: mobi.h:109
@ EXTH_REGIONMAGNI
Definition: mobi.h:127
@ EXTH_ADULT
Definition: mobi.h:114
@ EXTH_OVERRIDEFONTS
Definition: mobi.h:165
@ EXTH_DICTNAME
Definition: mobi.h:129
@ EXTH_IMPRINT
Definition: mobi.h:99
@ EXTH_TYPE
Definition: mobi.h:108
@ EXTH_SUBJECT
Definition: mobi.h:102
@ EXTH_AUTHOR
Definition: mobi.h:97
@ EXTH_PUBLISHINGDATE
Definition: mobi.h:103
@ EXTH_ALIGNMENT
Definition: mobi.h:162
@ EXTH_TITLE
Definition: mobi.h:96
@ EXTH_LANGUAGE
Definition: mobi.h:161
@ EXTH_STARTREADING
Definition: mobi.h:113
@ EXTH_COVEROFFSET
Definition: mobi.h:130
@ EXTH_RIGHTS
Definition: mobi.h:106
@ EXTH_BOOKTYPE
Definition: mobi.h:119
@ EXTH_FIXEDLAYOUT
Definition: mobi.h:118
@ EXTH_ZEROMARGIN
Definition: mobi.h:124
@ EXTH_DOCTYPE
Definition: mobi.h:154
@ EXTH_PRICE
Definition: mobi.h:115
@ MOBI_CP1252
Definition: mobi.h:216
@ MOBI_UTF8
Definition: mobi.h:217
@ MOBI_UTF16
Definition: mobi.h:218
MOBI_EXPORT bool mobi_exists_infl(const MOBIData *m)
Check if infl INDX is present in the loaded file.
Definition: util.c:2177
MOBI_EXPORT MOBI_RET mobi_meta_add_description(MOBIData *m, const char *description)
Add document description metadata.
Definition: meta.c:399
MOBI_EXPORT void mobi_free(MOBIData *m)
Free MOBIData structure and all its children.
Definition: memory.c:177
MOBI_EXPORT char * mobi_meta_get_contributor(const MOBIData *m)
Get document contributor metadata.
Definition: meta.c:502
MOBI_EXPORT MOBI_RET mobi_meta_add_language(MOBIData *m, const char *language)
Add document language code metadata.
Definition: meta.c:814
MOBI_EXPORT MOBI_RET mobi_remove_hybrid_part(MOBIData *m, const bool remove_kf8)
Remove one version from hybrid file.
Definition: util.c:3390
MOBI_EXPORT char * mobi_meta_get_author(const MOBIData *m)
Get document author metadata.
Definition: meta.c:160
MOBI_EXPORT char * mobi_meta_get_publishdate(const MOBIData *m)
Get document publishing date metadata.
Definition: meta.c:331
MOBI_EXPORT bool mobi_is_replica(const MOBIData *m)
Check if loaded document is Print Replica type.
Definition: util.c:2787
MOBI_EXPORT const char * mobi_version(void)
Get libmobi version.
Definition: util.c:76
MOBI_EXPORT MOBI_RET mobi_meta_set_subject(MOBIData *m, const char *subject)
Set document subject metadata.
Definition: meta.c:255
MOBI_EXPORT MOBI_RET mobi_drm_addvoucher(MOBIData *m, const char *serial, const time_t valid_from, const time_t valid_to, const MOBIExthTag *tamperkeys, const size_t tamperkeys_count)
Add DRM voucher.
Definition: util.c:3471
MOBI_EXPORT size_t mobi_get_text_maxsize(const MOBIData *m)
Get maximal size of all uncompressed text records.
Definition: util.c:2887
MOBI_EXPORT bool mobi_exists_mobiheader(const MOBIData *m)
Check if MOBI header is loaded / present in the loaded file.
Definition: util.c:2030
MOBI_EXPORT MOBI_RET mobi_meta_add_contributor(MOBIData *m, const char *contributor)
Add document contributor metadata.
Definition: meta.c:513
MOBI_EXPORT MOBI_RET mobi_decode_font_resource(unsigned char **decoded_font, size_t *decoded_size, MOBIPart *part)
Deobfuscator and decompressor for font resources.
Definition: util.c:2500
MOBI_EXPORT bool mobi_exists_ncx(const MOBIData *m)
Check if ncx INDX is present in the loaded file.
Definition: util.c:2143
MOBI_EXPORT MOBI_RET mobi_meta_set_publishdate(MOBIData *m, const char *publishdate)
Set document publishdate metadata.
Definition: meta.c:369
MOBI_EXPORT MOBI_RET mobi_parse_rawml_opt(MOBIRawml *rawml, const MOBIData *m, bool parse_toc, bool parse_dict, bool reconstruct)
Parse raw records into html flow parts, markup parts, resources and indices. Individual stages of the...
Definition: parse_rawml.c:2048
MOBI_EXPORT MOBI_RET mobi_meta_add_publishdate(MOBIData *m, const char *publishdate)
Add document publishdate metadata.
Definition: meta.c:342
MOBI_EXPORT MOBI_RET mobi_meta_delete_author(MOBIData *m)
Delete all author metadata.
Definition: meta.c:185
MOBI_EXPORT MOBI_RET mobi_meta_set_review(MOBIData *m, const char *review)
Set document review metadata.
Definition: meta.c:597
MOBI_EXPORT MOBI_RET mobi_meta_delete_isbn(MOBIData *m)
Delete all isbn metadata.
Definition: meta.c:698
MOBI_EXPORT MOBI_RET mobi_meta_set_copyright(MOBIData *m, const char *copyright)
Set document copyright metadata.
Definition: meta.c:654
MOBI_EXPORT MOBI_RET mobi_drm_decrypt(MOBIData *m)
Decrypt document.
Definition: encryption.c:1274
MOBI_EXPORT char * mobi_meta_get_description(const MOBIData *m)
Get document description metadata.
Definition: meta.c:388
MOBI_EXPORT MOBI_RET mobi_get_fullname(const MOBIData *m, char *fullname, const size_t len)
Get ebook full name stored in Record 0 at offset given in MOBI header.
Definition: util.c:749
MOBI_EXPORT MOBI_RET mobi_load_file(MOBIData *m, FILE *file)
Read MOBI document from file into MOBIData structure.
Definition: read.c:846
MOBI_EXPORT MOBI_RET mobi_parse_rawml(MOBIRawml *rawml, const MOBIData *m)
Parse raw records into html flow parts, markup parts, resources and indices.
Definition: parse_rawml.c:2033
MOBI_EXPORT MOBI_RET mobi_get_rawml(const MOBIData *m, char *text, size_t *len)
Decompress text to a text buffer.
Definition: util.c:1993
MOBI_EXPORT void mobi_free_rawml(MOBIRawml *rawml)
Free MOBIRawml structure allocated by mobi_init_rawml()
Definition: memory.c:422
MOBI_EXPORT char * mobi_decode_exthstring(const MOBIData *m, const unsigned char *data, const size_t size)
Decode string stored in EXTH record.
Definition: util.c:1689
MOBI_EXPORT MOBI_RET mobi_meta_set_author(MOBIData *m, const char *author)
Set document author metadata.
Definition: meta.c:198
MOBI_EXPORT MOBIFileMeta mobi_get_filemeta_by_type(const MOBIFiletype type)
Get MOBIFileMeta tag structure by MOBIFiletype type.
Definition: util.c:730
MOBI_EXPORT MOBI_RET mobi_drm_delkey(MOBIData *m)
Remove PID stored for encryption from MOBIData structure.
Definition: util.c:3512
MOBI_EXPORT MOBI_RET mobi_meta_set_language(MOBIData *m, const char *language)
Set document language code metadata.
Definition: meta.c:849
MOBI_EXPORT MOBI_RET mobi_meta_set_contributor(MOBIData *m, const char *contributor)
Set document contributor metadata.
Definition: meta.c:540
MOBI_EXPORT MOBI_RET mobi_meta_set_publisher(MOBIData *m, const char *publisher)
Set document publisher metadata.
Definition: meta.c:312
MOBI_EXPORT MOBIPart * mobi_get_flow_by_fid(const MOBIRawml *rawml, const char *fid)
Find flow part by flow id (fid) from kindle:flow:fid link. Flow fid is base32 encoded part uid.
Definition: util.c:927
MOBI_EXPORT MOBI_RET mobi_meta_add_imprint(MOBIData *m, const char *imprint)
Add document imprint metadata.
Definition: meta.c:456
MOBI_EXPORT bool mobi_is_dictionary(const MOBIData *m)
Check if loaded document is dictionary.
Definition: util.c:2709
MOBI_EXPORT size_t mobi_get_kf8offset(const MOBIData *m)
Get offset of KF8 Boundary for KF7/KF8 hybrid file cached in MOBIData structure.
Definition: util.c:3005
MOBI_EXPORT uint32_t mobi_decode_exthvalue(const unsigned char *data, const size_t size)
Decode big-endian value stored in EXTH record.
Definition: util.c:1558
MOBI_EXPORT char * mobi_meta_get_asin(const MOBIData *m)
Get document ASIN metadata.
Definition: meta.c:730
MOBI_EXPORT MOBI_RET mobi_meta_add_isbn(MOBIData *m, const char *isbn)
Add document isbn metadata.
Definition: meta.c:684
MOBI_EXPORT bool mobi_is_encrypted(const MOBIData *m)
Check if loaded document is encrypted.
Definition: util.c:2728
MOBI_EXPORT const char * mobi_get_locale_string(const uint32_t locale)
Get pointer to locale tag for a given Mobipocket locale number.
Definition: util.c:646
MOBI_EXPORT MOBIPdbRecord * mobi_get_record_by_uid(const MOBIData *m, const size_t uid)
Get palm database record with given unique id.
Definition: util.c:851
MOBI_EXPORT char * mobi_meta_get_copyright(const MOBIData *m)
Get document copyright metadata.
Definition: meta.c:616
MOBI_EXPORT MOBI_RET mobi_meta_delete_title(MOBIData *m)
Delete all title metadata.
Definition: meta.c:111
MOBI_EXPORT size_t mobi_get_locale_number(const char *locale_string)
Get Mobipocket locale number for a given string tag.
Definition: util.c:668
MOBI_EXPORT MOBI_RET mobi_meta_add_author(MOBIData *m, const char *author)
Add document author metadata.
Definition: meta.c:171
MOBI_EXPORT bool mobi_exists_guide_indx(const MOBIData *m)
Check if guide INDX is present in the loaded file.
Definition: util.c:2126
MOBI_EXPORT MOBI_RET mobi_meta_add_publisher(MOBIData *m, const char *publisher)
Add document publisher metadata.
Definition: meta.c:285
MOBI_EXPORT MOBI_RET mobi_meta_set_description(MOBIData *m, const char *description)
Set document description metadata.
Definition: meta.c:426
MOBI_EXPORT MOBIPart * mobi_get_part_by_uid(const MOBIRawml *rawml, const size_t uid)
Get rawml->markup MOBIPart part by uid.
Definition: util.c:876
MOBI_EXPORT MOBI_RET mobi_meta_delete_publishdate(MOBIData *m)
Delete all publishdate metadata.
Definition: meta.c:356
MOBI_EXPORT char * mobi_meta_get_imprint(const MOBIData *m)
Get document imprint metadata.
Definition: meta.c:445
MOBI_EXPORT MOBI_RET mobi_meta_set_isbn(MOBIData *m, const char *isbn)
Set document isbn metadata.
Definition: meta.c:711
MOBI_EXPORT bool mobi_exists_frag_indx(const MOBIData *m)
Check if fragments INDX is present in the loaded file.
Definition: util.c:2109
MOBI_EXPORT MOBI_RET mobi_get_embedded_source(unsigned char **data, size_t *size, const MOBIData *m)
Get embedded source archive.
Definition: util.c:2367
MOBI_EXPORT MOBI_RET mobi_meta_add_title(MOBIData *m, const char *title)
Add document title metadata.
Definition: meta.c:97
MOBI_EXPORT size_t mobi_get_first_resource_record(const MOBIData *m)
Get sequential number of first resource record (image/font etc)
Definition: util.c:2915
MOBI_EXPORT MOBI_RET mobi_dump_rawml(const MOBIData *m, FILE *file)
Decompress text record to an open file descriptor.
Definition: util.c:2016
MOBI_EXPORT 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.
Definition: read.c:519
MOBI_EXPORT MOBI_RET mobi_meta_delete_copyright(MOBIData *m)
Delete all copyright metadata.
Definition: meta.c:641
MOBI_EXPORT MOBI_RET mobi_write_file(FILE *file, MOBIData *m)
Write mobi document to file.
Definition: write.c:511
MOBI_EXPORT char * mobi_meta_get_title(const MOBIData *m)
Get document title metadata.
Definition: meta.c:72
MOBI_EXPORT char * mobi_meta_get_publisher(const MOBIData *m)
Get document publisher metadata.
Definition: meta.c:274
MOBI_EXPORT MOBIRawml * mobi_init_rawml(const MOBIData *m)
Initialize and return MOBIRawml structure.
Definition: memory.c:236
MOBI_EXPORT MOBI_RET mobi_meta_delete_language(MOBIData *m)
Delete all language code metadata.
Definition: meta.c:828
MOBI_EXPORT 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.
Definition: read.c:481
MOBI_EXPORT size_t mobi_get_fileversion(const MOBIData *m)
Get mobi file version.
Definition: util.c:2807
MOBI_EXPORT uint32_t mobi_get_orth_entry_length(const MOBIIndexEntry *entry)
Get text length for the orth entry.
Definition: index.c:836
MOBI_EXPORT MOBI_RET mobi_delete_exthrecord_by_tag(MOBIData *m, const MOBIExthTag tag)
Delete all EXTH records with given MOBIExthTag tag.
Definition: util.c:1426
MOBI_EXPORT MOBI_RET mobi_meta_add_subject(MOBIData *m, const char *subject)
Add document subject metadata.
Definition: meta.c:228
MOBI_EXPORT MOBIExthHeader * mobi_get_exthrecord_by_tag(const MOBIData *m, const MOBIExthTag tag)
Get EXTH record with given MOBIExthTag tag.
Definition: util.c:1219
MOBI_EXPORT MOBI_RET mobi_get_embedded_log(unsigned char **data, size_t *size, const MOBIData *m)
Get embedded conversion log.
Definition: util.c:2419
MOBI_EXPORT MOBI_RET mobi_drm_setkey_serial(MOBIData *m, const char *serial)
Store PID for encryption in MOBIData stucture. PID will be calculated from device serial number.
Definition: util.c:3442
MOBI_EXPORT MOBI_RET mobi_meta_set_asin(MOBIData *m, const char *asin)
Set document asin metadata.
Definition: meta.c:768
MOBI_EXPORT MOBI_RET mobi_decode_video_resource(unsigned char **decoded_resource, size_t *decoded_size, MOBIPart *part)
Decode video resource.
Definition: util.c:2329
MOBI_EXPORT MOBI_RET mobi_meta_delete_review(MOBIData *m)
Delete all review metadata.
Definition: meta.c:584
MOBI_EXPORT bool mobi_exists_fdst(const MOBIData *m)
Check if FDST record is present in the loaded file.
Definition: util.c:2060
MOBI_EXPORT MOBI_RET mobi_meta_delete_publisher(MOBIData *m)
Delete all publisher metadata.
Definition: meta.c:299
MOBI_EXPORT bool mobi_is_hybrid(const MOBIData *m)
Check if loaded MOBI data is KF7/KF8 hybrid file.
Definition: util.c:2656
MOBI_EXPORT MOBIExthHeader * mobi_next_exthrecord_by_tag(const MOBIData *m, const MOBIExthTag tag, MOBIExthHeader **start)
Get EXTH record with given MOBIExthTag tag. Start list search at given record.
Definition: util.c:1249
MOBI_EXPORT char * mobi_meta_get_review(const MOBIData *m)
Get document review metadata.
Definition: meta.c:559
MOBI_EXPORT bool mobi_is_kf8(const MOBIData *m)
Is file version 8 or above.
Definition: util.c:2837
MOBI_EXPORT MOBI_RET mobi_parse_kf7(MOBIData *m)
Loader will parse KF7 part of hybrid file.
Definition: util.c:3145
MOBI_EXPORT uint32_t mobi_get_orth_entry_offset(const MOBIIndexEntry *entry)
Get entry start offset for the orth entry.
Definition: index.c:820
MOBI_EXPORT MOBI_RET mobi_load_filename(MOBIData *m, const char *path)
Read MOBI document from a path into MOBIData structure.
Definition: read.c:915
MOBI_EXPORT MOBIPart * mobi_get_resource_by_uid(const MOBIRawml *rawml, const size_t uid)
Get MOBIPart resource record with given unique id.
Definition: util.c:944
MOBI_EXPORT char * mobi_meta_get_isbn(const MOBIData *m)
Get document ISBN metadata.
Definition: meta.c:673
MOBI_EXPORT size_t mobi_get_fdst_record_number(const MOBIData *m)
Get sequential number of FDST record.
Definition: util.c:2084
MOBI_EXPORT char * mobi_meta_get_language(const MOBIData *m)
Get document language code metadata.
Definition: meta.c:790
MOBI_EXPORT MOBIExthMeta mobi_get_exthtagmeta_by_tag(const MOBIExthTag tag)
Get MOBIExthMeta tag structure by MOBIExthTag tag id.
Definition: util.c:1538
MOBI_EXPORT MOBI_RET mobi_meta_add_asin(MOBIData *m, const char *asin)
Add document asin metadata.
Definition: meta.c:741
MOBI_EXPORT MOBI_RET mobi_parse_kf8(MOBIData *m)
Loader will parse KF8 part of hybrid file.
Definition: util.c:3161
MOBI_EXPORT bool mobi_exists_skel_indx(const MOBIData *m)
Check if skeleton INDX is present in the loaded file.
Definition: util.c:2043
MOBI_EXPORT MOBI_RET mobi_decode_audio_resource(unsigned char **decoded_resource, size_t *decoded_size, MOBIPart *part)
Decode audio resource.
Definition: util.c:2276
MOBI_EXPORT MOBI_RET mobi_meta_delete_imprint(MOBIData *m)
Delete all imprint metadata.
Definition: meta.c:470
MOBI_EXPORT MOBIPdbRecord * mobi_get_record_by_seqnumber(const MOBIData *m, const size_t uid)
Get palm database record with given sequential number (first record has number 0)
Definition: util.c:1015
MOBI_EXPORT MOBI_RET mobi_drm_setkey(MOBIData *m, const char *pid)
Store PID for encryption in MOBIData stucture.
Definition: util.c:3495
MOBI_EXPORT MOBI_RET mobi_meta_delete_subject(MOBIData *m)
Delete all subject metadata.
Definition: meta.c:242
MOBI_EXPORT uint16_t mobi_get_textrecord_maxsize(const MOBIData *m)
Get maximal size of uncompressed text record.
Definition: util.c:2864
MOBI_EXPORT MOBI_RET mobi_meta_add_review(MOBIData *m, const char *review)
Add document review metadata.
Definition: meta.c:570
MOBI_EXPORT MOBI_RET mobi_meta_delete_description(MOBIData *m)
Delete all description metadata.
Definition: meta.c:413
MOBI_EXPORT MOBI_RET mobi_drm_encrypt(MOBIData *m)
Encrypt document.
Definition: encryption.c:1485
MOBI_EXPORT MOBI_RET mobi_add_exthrecord(MOBIData *m, const MOBIExthTag tag, const uint32_t size, const void *value)
Add new EXTH record with given tag and value.
Definition: util.c:1283
MOBI_EXPORT MOBI_RET mobi_meta_set_imprint(MOBIData *m, const char *imprint)
Set document imprint metadata.
Definition: meta.c:483
MOBI_EXPORT bool mobi_exists_orth(const MOBIData *m)
Check if orth INDX is present in the loaded file.
Definition: util.c:2160
MOBI_EXPORT MOBI_RET mobi_meta_add_copyright(MOBIData *m, const char *copyright)
Add document copyright metadata.
Definition: meta.c:627
MOBI_EXPORT MOBI_RET mobi_meta_delete_asin(MOBIData *m)
Delete all asin metadata.
Definition: meta.c:755
MOBI_EXPORT size_t mobi_get_kf8boundary_seqnumber(const MOBIData *m)
Get sequential number of KF8 Boundary record for KF7/KF8 hybrid file.
Definition: util.c:3021
MOBI_EXPORT char * mobi_meta_get_subject(const MOBIData *m)
Get document subject metadata.
Definition: meta.c:217
MOBI_EXPORT MOBIPart * mobi_get_resource_by_fid(const MOBIRawml *rawml, const char *fid)
Find resource by flow id (fid) from kindle:embed:fid link. Flow fid is base32 encoded part uid.
Definition: util.c:971
MOBI_EXPORT struct tm * mobi_pdbtime_to_time(const long pdb_time)
Convert time values from palmdoc header to time tm struct.
Definition: util.c:1741
MOBI_EXPORT MOBI_RET mobi_meta_delete_contributor(MOBIData *m)
Delete all contributor metadata.
Definition: meta.c:527
MOBI_EXPORT MOBIPart * mobi_get_flow_by_uid(const MOBIRawml *rawml, const size_t uid)
Get rawml->flow MOBIPart part by uid.
Definition: util.c:901
MOBI_EXPORT bool mobi_is_rawml_kf8(const MOBIRawml *rawml)
Is file version 8 or above.
Definition: util.c:2851
MOBI_EXPORT bool mobi_is_mobipocket(const MOBIData *m)
Check if loaded document is MOBI/BOOK Mobipocket format.
Definition: util.c:2673
MOBI_EXPORT MOBI_RET mobi_meta_set_title(MOBIData *m, const char *title)
Set document title metadata.
Definition: meta.c:130
MOBI_EXPORT MOBIData * mobi_init(void)
Initializer for MOBIData structure.
Definition: memory.c:25
struct MOBIPart MOBIPart
Reconstructed source file.
struct MOBIPdbRecord MOBIPdbRecord
Metadata and data of a record. All records form a linked list.
struct MOBIData MOBIData
Main structure holding all metadata and unparsed records data.
struct MOBIExthHeader MOBIExthHeader
Metadata and data of a EXTH record. All records form a linked list.
#define MOBI_EXPORT
Visibility attributes for symbol export.
Definition: mobi.h:30
Main structure holding all metadata and unparsed records data.
Definition: mobi.h:381
MOBIRecord0Header * rh
Definition: mobi.h:386
unsigned char * drm_key
Definition: mobi.h:384
MOBIMobiHeader * mh
Definition: mobi.h:387
struct MOBIData * next
Definition: mobi.h:390
bool use_kf8
Definition: mobi.h:382
MOBIExthHeader * eh
Definition: mobi.h:388
uint32_t kf8_boundary_offset
Definition: mobi.h:383
MOBIPdbRecord * rec
Definition: mobi.h:389
MOBIPdbHeader * ph
Definition: mobi.h:385
void * internals
Definition: mobi.h:391
Parsed FDST record.
Definition: mobi.h:407
uint32_t * fdst_section_starts
Definition: mobi.h:409
uint32_t * fdst_section_ends
Definition: mobi.h:410
size_t fdst_section_count
Definition: mobi.h:408
Parsed INDX index entry.
Definition: mobi.h:425
size_t tags_count
Definition: mobi.h:427
MOBIIndexTag * tags
Definition: mobi.h:428
char * label
Definition: mobi.h:426
Parsed tag for an index entry.
Definition: mobi.h:416
size_t tagid
Definition: mobi.h:417
size_t tagvalues_count
Definition: mobi.h:418
uint32_t * tagvalues
Definition: mobi.h:419
Parsed INDX record.
Definition: mobi.h:434
MOBIPdbRecord * cncx_record
Definition: mobi.h:443
size_t total_entries_count
Definition: mobi.h:438
size_t ordt_offset
Definition: mobi.h:439
char * orth_index_name
Definition: mobi.h:445
size_t type
Definition: mobi.h:435
size_t entries_count
Definition: mobi.h:436
size_t ligt_entries_count
Definition: mobi.h:441
MOBIEncoding encoding
Definition: mobi.h:437
size_t ligt_offset
Definition: mobi.h:440
MOBIIndexEntry * entries
Definition: mobi.h:444
size_t cncx_records_count
Definition: mobi.h:442
Reconstructed source file.
Definition: mobi.h:453
struct MOBIPart * next
Definition: mobi.h:458
size_t uid
Definition: mobi.h:454
size_t size
Definition: mobi.h:456
MOBIFiletype type
Definition: mobi.h:455
unsigned char * data
Definition: mobi.h:457
Metadata and data of a record. All records form a linked list.
Definition: mobi.h:251
uint32_t offset
Definition: mobi.h:252
unsigned char * data
Definition: mobi.h:256
struct MOBIPdbRecord * next
Definition: mobi.h:257
size_t size
Definition: mobi.h:253
uint8_t attributes
Definition: mobi.h:254
uint32_t uid
Definition: mobi.h:255
Main structure containing reconstructed source parts and indices.
Definition: mobi.h:464
MOBIPart * resources
Definition: mobi.h:475
MOBIPart * flow
Definition: mobi.h:473
MOBIIndx * orth
Definition: mobi.h:471
MOBIPart * markup
Definition: mobi.h:474
size_t version
Definition: mobi.h:465
MOBIIndx * frag
Definition: mobi.h:468
MOBIIndx * infl
Definition: mobi.h:472
MOBIIndx * ncx
Definition: mobi.h:470
MOBIFdst * fdst
Definition: mobi.h:466
MOBIIndx * guide
Definition: mobi.h:469
MOBIIndx * skel
Definition: mobi.h:467