libmobi
C library for handling MOBI format ebook documents
mobi.h
Go to the documentation of this file.
1 
16 #ifndef libmobi_mobi_h
17 #define libmobi_mobi_h
18 
19 #include <stdio.h>
20 #include <stdint.h>
21 #include <stdbool.h>
22 #include <time.h>
23 
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)
29 #else
30 #define MOBI_EXPORT __attribute__((__visibility__("default")))
31 #endif
32 
37 #define MOBI_NOTSET UINT32_MAX
38 
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
47 #ifdef __cplusplus
48 extern "C"
49 {
50 #endif
59  typedef enum {
61  MOBI_ERROR = 1,
70  MOBI_XML_ERR = 10,
78 
82  typedef enum {
83  EXTH_NUMERIC = 0,
84  EXTH_STRING = 1,
85  EXTH_BINARY = 2
86  } MOBIExthType;
87 
91  typedef enum {
92  EXTH_DRMSERVER = 1,
93  EXTH_DRMCOMMERCE = 2,
94  EXTH_DRMEBOOKBASE = 3,
95 
96  EXTH_TITLE = 99,
97  EXTH_AUTHOR = 100,
99  EXTH_IMPRINT = 102,
101  EXTH_ISBN = 104,
102  EXTH_SUBJECT = 105,
104  EXTH_REVIEW = 107,
106  EXTH_RIGHTS = 109,
108  EXTH_TYPE = 111,
109  EXTH_SOURCE = 112,
110  EXTH_ASIN = 113,
111  EXTH_VERSION = 114,
112  EXTH_SAMPLE = 115,
114  EXTH_ADULT = 117,
115  EXTH_PRICE = 118,
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,
139 
140  EXTH_FONTSIGNATURE = 300,
141 
142  EXTH_CLIPPINGLIMIT = 401,
143  EXTH_PUBLISHERLIMIT = 402,
144  EXTH_UNK403 = 403,
145  EXTH_TTSDISABLE = 404,
146  EXTH_READFORFREE = 405, // uint32_t, rental related, ReadForFree
147  EXTH_RENTAL = 406, // uint64_t
148  EXTH_UNK407 = 407,
149  EXTH_UNK450 = 450,
150  EXTH_UNK451 = 451,
151  EXTH_UNK452 = 452,
152  EXTH_UNK453 = 453,
153 
154  EXTH_DOCTYPE = 501,
155  EXTH_LASTUPDATE = 502,
156  EXTH_UPDATEDTITLE = 503,
157  EXTH_ASIN504 = 504,
158  EXTH_TITLEFILEAS = 508,
159  EXTH_CREATORFILEAS = 517,
160  EXTH_PUBLISHERFILEAS = 522,
163  EXTH_CREATORSTRING = 526,
164  EXTH_PAGEDIR = 527,
166  EXTH_SORCEDESC = 529,
167  EXTH_DICTLANGIN = 531,
168  EXTH_DICTLANGOUT = 532,
169  EXTH_INPUTSOURCE = 534,
170  EXTH_CREATORBUILDREV = 535,
171  } MOBIExthTag;
172 
176  typedef enum {
178  /* markup */
184  /* images */
189  /* fonts */
192  /* media */
196  /* generic types */
200  T_BREAK
202 
206  typedef struct {
208  char extension[5];
209  char mime_type[30];
210  } MOBIFileMeta;
211 
215  typedef enum {
216  MOBI_CP1252 = 1252,
217  MOBI_UTF8 = 65001,
218  MOBI_UTF16 = 65002,
219  } MOBIEncoding;
220 
231  typedef struct {
232  char name[33];
233  uint16_t attributes;
234  uint16_t version;
235  uint32_t ctime;
236  uint32_t mtime;
237  uint32_t btime;
238  uint32_t mod_num;
239  uint32_t appinfo_offset;
240  uint32_t sortinfo_offset;
241  char type[5];
242  char creator[5];
243  uint32_t uid;
244  uint32_t next_rec;
245  uint16_t rec_count;
246  } MOBIPdbHeader;
247 
251  typedef struct MOBIPdbRecord {
252  uint32_t offset;
253  size_t size;
254  uint8_t attributes;
255  uint32_t uid;
256  unsigned char *data;
257  struct MOBIPdbRecord *next;
259 
263  typedef struct MOBIExthHeader {
264  uint32_t tag;
265  uint32_t size;
266  void *data;
269 
273  typedef struct {
276  char *name;
277  } MOBIExthMeta;
278 
282  typedef struct {
283  /* PalmDOC header (extended), offset 0, length 16 */
284  uint16_t compression_type;
285  /* uint16_t unused; // 2; 0 */
286  uint32_t text_length;
287  uint16_t text_record_count;
288  uint16_t text_record_size;
289  uint16_t encryption_type;
290  uint16_t unknown1;
292 
298  typedef struct {
299  /* MOBI header, offset 16 */
300  char mobi_magic[5];
301  uint32_t *header_length;
302  uint32_t *mobi_type;
304  uint32_t *uid;
305  uint32_t *version;
306  uint32_t *orth_index;
307  uint32_t *infl_index;
308  uint32_t *names_index;
309  uint32_t *keys_index;
310  uint32_t *extra0_index;
311  uint32_t *extra1_index;
312  uint32_t *extra2_index;
313  uint32_t *extra3_index;
314  uint32_t *extra4_index;
315  uint32_t *extra5_index;
316  uint32_t *non_text_index;
317  uint32_t *full_name_offset;
318  uint32_t *full_name_length;
319  uint32_t *locale;
320  uint32_t *dict_input_lang;
321  uint32_t *dict_output_lang;
322  uint32_t *min_version;
323  uint32_t *image_index;
324  uint32_t *huff_rec_index;
325  uint32_t *huff_rec_count;
326  uint32_t *datp_rec_index;
327  uint32_t *datp_rec_count;
328  uint32_t *exth_flags;
329  /* 32 unknown bytes, usually 0, related to encryption and unknown6 */
330  /* unknown2 */
331  /* unknown3 */
332  /* unknown4 */
333  /* unknown5 */
334  uint32_t *unknown6;
335  uint32_t *drm_offset;
336  uint32_t *drm_count;
337  uint32_t *drm_size;
338  uint32_t *drm_flags;
339  /* 8 unknown bytes 0? */
340  /* unknown7 */
341  /* unknown8 */
342  uint16_t *first_text_index;
343  uint16_t *last_text_index;
344  uint32_t *fdst_index;
345  //uint32_t *unknown9; /**< 196: */
346  uint32_t *fdst_section_count;
347  uint32_t *fcis_index;
348  uint32_t *fcis_count;
349  uint32_t *flis_index;
350  uint32_t *flis_count;
351  uint32_t *unknown10;
352  uint32_t *unknown11;
353  uint32_t *srcs_index;
354  uint32_t *srcs_count;
355  uint32_t *unknown12;
356  uint32_t *unknown13;
357  /* uint16_t fill 0 */
358  uint16_t *extra_flags;
359  uint32_t *ncx_index;
360  uint32_t *unknown14;
361  uint32_t *fragment_index;
362  uint32_t *unknown15;
363  uint32_t *skeleton_index;
364  uint32_t *datp_index;
365  uint32_t *unknown16;
366  uint32_t *guide_index;
367  uint32_t *unknown17;
368  uint32_t *unknown18;
369  uint32_t *unknown19;
370  uint32_t *unknown20;
371  char *full_name;
372  } MOBIMobiHeader;
373 
381  typedef struct MOBIData {
382  bool use_kf8;
384  unsigned char *drm_key;
390  struct MOBIData *next;
391  void *internals;
393  // end of raw_structs group
395 
407  typedef struct {
410  uint32_t *fdst_section_ends;
411  } MOBIFdst;
412 
416  typedef struct {
417  size_t tagid;
419  uint32_t *tagvalues;
420  } MOBIIndexTag;
421 
425  typedef struct {
426  char *label;
427  size_t tags_count;
429  } MOBIIndexEntry;
430 
434  typedef struct {
435  size_t type;
436  size_t entries_count;
439  size_t ordt_offset;
440  size_t ligt_offset;
446  } MOBIIndx;
447 
453  typedef struct MOBIPart {
454  size_t uid;
456  size_t size;
457  unsigned char *data;
458  struct MOBIPart *next;
460 
464  typedef struct {
465  size_t version;
476  } MOBIRawml;
477  // end of parsed_structs group
479 
484  MOBI_EXPORT const char * mobi_version(void);
486  MOBI_EXPORT MOBI_RET mobi_load_filename(MOBIData *m, const char *path);
487 
489  MOBI_EXPORT void mobi_free(MOBIData *m);
490 
493 
495  MOBI_EXPORT MOBI_RET mobi_parse_rawml_opt(MOBIRawml *rawml, const MOBIData *m, bool parse_toc, bool parse_dict, bool reconstruct);
496 
497  MOBI_EXPORT MOBI_RET mobi_get_rawml(const MOBIData *m, char *text, size_t *len);
498  MOBI_EXPORT MOBI_RET mobi_dump_rawml(const MOBIData *m, FILE *file);
499  MOBI_EXPORT MOBI_RET mobi_decode_font_resource(unsigned char **decoded_font, size_t *decoded_size, MOBIPart *part);
500  MOBI_EXPORT MOBI_RET mobi_decode_audio_resource(unsigned char **decoded_resource, size_t *decoded_size, MOBIPart *part);
501  MOBI_EXPORT MOBI_RET mobi_decode_video_resource(unsigned char **decoded_resource, size_t *decoded_size, MOBIPart *part);
502  MOBI_EXPORT MOBI_RET mobi_get_embedded_source(unsigned char **data, size_t *size, const MOBIData *m);
503  MOBI_EXPORT MOBI_RET mobi_get_embedded_log(unsigned char **data, size_t *size, const MOBIData *m);
504 
505  MOBI_EXPORT MOBIPdbRecord * mobi_get_record_by_uid(const MOBIData *m, const size_t uid);
506  MOBI_EXPORT MOBIPdbRecord * mobi_get_record_by_seqnumber(const MOBIData *m, const size_t uid);
507  MOBI_EXPORT MOBIPart * mobi_get_flow_by_uid(const MOBIRawml *rawml, const size_t uid);
508  MOBI_EXPORT MOBIPart * mobi_get_flow_by_fid(const MOBIRawml *rawml, const char *fid);
509  MOBI_EXPORT MOBIPart * mobi_get_resource_by_uid(const MOBIRawml *rawml, const size_t uid);
510  MOBI_EXPORT MOBIPart * mobi_get_resource_by_fid(const MOBIRawml *rawml, const char *fid);
511  MOBI_EXPORT MOBIPart * mobi_get_part_by_uid(const MOBIRawml *rawml, const size_t uid);
512  MOBI_EXPORT MOBI_RET mobi_get_fullname(const MOBIData *m, char *fullname, const size_t len);
514  MOBI_EXPORT size_t mobi_get_text_maxsize(const MOBIData *m);
516  MOBI_EXPORT size_t mobi_get_kf8offset(const MOBIData *m);
518  MOBI_EXPORT size_t mobi_get_record_extrasize(const MOBIPdbRecord *record, const uint16_t flags);
519  MOBI_EXPORT size_t mobi_get_record_mb_extrasize(const MOBIPdbRecord *record, const uint16_t flags);
520  MOBI_EXPORT size_t mobi_get_fileversion(const MOBIData *m);
525  MOBI_EXPORT MOBI_RET mobi_add_exthrecord(MOBIData *m, const MOBIExthTag tag, const uint32_t size, const void *value);
528  MOBI_EXPORT uint32_t mobi_decode_exthvalue(const unsigned char *data, const size_t size);
529  MOBI_EXPORT char * mobi_decode_exthstring(const MOBIData *m, const unsigned char *data, const size_t size);
530  MOBI_EXPORT struct tm * mobi_pdbtime_to_time(const long pdb_time);
531  MOBI_EXPORT const char * mobi_get_locale_string(const uint32_t locale);
532  MOBI_EXPORT size_t mobi_get_locale_number(const char *locale_string);
535  MOBI_EXPORT MOBI_RET mobi_remove_hybrid_part(MOBIData *m, const bool remove_kf8);
536 
538  MOBI_EXPORT bool mobi_exists_fdst(const MOBIData *m);
542  MOBI_EXPORT bool mobi_exists_ncx(const MOBIData *m);
543  MOBI_EXPORT bool mobi_exists_orth(const MOBIData *m);
544  MOBI_EXPORT bool mobi_exists_infl(const MOBIData *m);
545  MOBI_EXPORT bool mobi_is_hybrid(const MOBIData *m);
546  MOBI_EXPORT bool mobi_is_encrypted(const MOBIData *m);
547  MOBI_EXPORT bool mobi_is_mobipocket(const MOBIData *m);
548  MOBI_EXPORT bool mobi_is_dictionary(const MOBIData *m);
549  MOBI_EXPORT bool mobi_is_kf8(const MOBIData *m);
550  MOBI_EXPORT bool mobi_is_replica(const MOBIData *m);
551  MOBI_EXPORT bool mobi_is_rawml_kf8(const MOBIRawml *rawml);
554 
555  MOBI_EXPORT char * mobi_meta_get_title(const MOBIData *m);
556  MOBI_EXPORT char * mobi_meta_get_author(const MOBIData *m);
558  MOBI_EXPORT char * mobi_meta_get_imprint(const MOBIData *m);
560  MOBI_EXPORT char * mobi_meta_get_isbn(const MOBIData *m);
561  MOBI_EXPORT char * mobi_meta_get_subject(const MOBIData *m);
563  MOBI_EXPORT char * mobi_meta_get_review(const MOBIData *m);
566  MOBI_EXPORT char * mobi_meta_get_asin(const MOBIData *m);
568  MOBI_EXPORT MOBI_RET mobi_meta_set_title(MOBIData *m, const char *title);
569  MOBI_EXPORT MOBI_RET mobi_meta_add_title(MOBIData *m, const char *title);
571  MOBI_EXPORT MOBI_RET mobi_meta_set_author(MOBIData *m, const char *author);
572  MOBI_EXPORT MOBI_RET mobi_meta_add_author(MOBIData *m, const char *author);
574  MOBI_EXPORT MOBI_RET mobi_meta_set_publisher(MOBIData *m, const char *publisher);
575  MOBI_EXPORT MOBI_RET mobi_meta_add_publisher(MOBIData *m, const char *publisher);
577  MOBI_EXPORT MOBI_RET mobi_meta_set_imprint(MOBIData *m, const char *imprint);
578  MOBI_EXPORT MOBI_RET mobi_meta_add_imprint(MOBIData *m, const char *imprint);
580  MOBI_EXPORT MOBI_RET mobi_meta_set_description(MOBIData *m, const char *description);
581  MOBI_EXPORT MOBI_RET mobi_meta_add_description(MOBIData *m, const char *description);
583  MOBI_EXPORT MOBI_RET mobi_meta_set_isbn(MOBIData *m, const char *isbn);
584  MOBI_EXPORT MOBI_RET mobi_meta_add_isbn(MOBIData *m, const char *isbn);
586  MOBI_EXPORT MOBI_RET mobi_meta_set_subject(MOBIData *m, const char *subject);
587  MOBI_EXPORT MOBI_RET mobi_meta_add_subject(MOBIData *m, const char *subject);
589  MOBI_EXPORT MOBI_RET mobi_meta_set_publishdate(MOBIData *m, const char *publishdate);
590  MOBI_EXPORT MOBI_RET mobi_meta_add_publishdate(MOBIData *m, const char *publishdate);
592  MOBI_EXPORT MOBI_RET mobi_meta_set_review(MOBIData *m, const char *review);
593  MOBI_EXPORT MOBI_RET mobi_meta_add_review(MOBIData *m, const char *review);
595  MOBI_EXPORT MOBI_RET mobi_meta_set_contributor(MOBIData *m, const char *contributor);
596  MOBI_EXPORT MOBI_RET mobi_meta_add_contributor(MOBIData *m, const char *contributor);
598  MOBI_EXPORT MOBI_RET mobi_meta_set_copyright(MOBIData *m, const char *copyright);
599  MOBI_EXPORT MOBI_RET mobi_meta_add_copyright(MOBIData *m, const char *copyright);
601  MOBI_EXPORT MOBI_RET mobi_meta_set_asin(MOBIData *m, const char *asin);
602  MOBI_EXPORT MOBI_RET mobi_meta_add_asin(MOBIData *m, const char *asin);
604  MOBI_EXPORT MOBI_RET mobi_meta_set_language(MOBIData *m, const char *language);
605  MOBI_EXPORT MOBI_RET mobi_meta_add_language(MOBIData *m, const char *language);
607 
608  MOBI_EXPORT MOBI_RET mobi_drm_setkey(MOBIData *m, const char *pid);
609  MOBI_EXPORT MOBI_RET mobi_drm_setkey_serial(MOBIData *m, const char *serial);
610  MOBI_EXPORT MOBI_RET mobi_drm_addvoucher(MOBIData *m, const char *serial, const time_t valid_from, const time_t valid_to,
611  const MOBIExthTag *tamperkeys, const size_t tamperkeys_count);
615 
616  MOBI_EXPORT MOBI_RET mobi_write_file(FILE *file, MOBIData *m); // end of mobi_export group
618 
619 #ifdef __cplusplus
620 }
621 #endif
622 
623 #endif
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
Metadata and data of a EXTH record. All records form a linked list.
Definition: mobi.h:263
void * data
Definition: mobi.h:266
uint32_t tag
Definition: mobi.h:264
uint32_t size
Definition: mobi.h:265
struct MOBIExthHeader * next
Definition: mobi.h:267
EXTH tag metadata.
Definition: mobi.h:273
MOBIExthTag tag
Definition: mobi.h:274
MOBIExthType type
Definition: mobi.h:275
char * name
Definition: mobi.h:276
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
Metadata of file types.
Definition: mobi.h:206
MOBIFiletype type
Definition: mobi.h:207
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
MOBI header which follows Record 0 header.
Definition: mobi.h:298
uint32_t * flis_count
Definition: mobi.h:350
uint32_t * keys_index
Definition: mobi.h:309
uint32_t * fdst_index
Definition: mobi.h:344
uint32_t * full_name_offset
Definition: mobi.h:317
uint32_t * mobi_type
Definition: mobi.h:302
uint16_t * extra_flags
Definition: mobi.h:358
uint32_t * drm_flags
Definition: mobi.h:338
uint32_t * dict_input_lang
Definition: mobi.h:320
uint32_t * datp_rec_index
Definition: mobi.h:326
uint32_t * flis_index
Definition: mobi.h:349
uint32_t * fdst_section_count
Definition: mobi.h:346
uint32_t * extra1_index
Definition: mobi.h:311
uint32_t * drm_offset
Definition: mobi.h:335
uint32_t * unknown15
Definition: mobi.h:362
uint32_t * skeleton_index
Definition: mobi.h:363
char * full_name
Definition: mobi.h:371
uint32_t * infl_index
Definition: mobi.h:307
uint32_t * orth_index
Definition: mobi.h:306
uint32_t * unknown12
Definition: mobi.h:355
uint32_t * exth_flags
Definition: mobi.h:328
uint32_t * fcis_index
Definition: mobi.h:347
uint32_t * unknown20
Definition: mobi.h:370
uint32_t * fragment_index
Definition: mobi.h:361
uint32_t * extra0_index
Definition: mobi.h:310
uint32_t * extra2_index
Definition: mobi.h:312
uint32_t * unknown13
Definition: mobi.h:356
uint32_t * datp_index
Definition: mobi.h:364
uint32_t * drm_count
Definition: mobi.h:336
uint32_t * unknown18
Definition: mobi.h:368
uint32_t * min_version
Definition: mobi.h:322
uint32_t * image_index
Definition: mobi.h:323
uint32_t * ncx_index
Definition: mobi.h:359
uint32_t * version
Definition: mobi.h:305
uint32_t * huff_rec_index
Definition: mobi.h:324
uint32_t * locale
Definition: mobi.h:319
uint32_t * full_name_length
Definition: mobi.h:318
uint16_t * last_text_index
Definition: mobi.h:343
uint32_t * names_index
Definition: mobi.h:308
uint32_t * unknown16
Definition: mobi.h:365
uint32_t * header_length
Definition: mobi.h:301
uint32_t * datp_rec_count
Definition: mobi.h:327
uint32_t * unknown14
Definition: mobi.h:360
uint32_t * non_text_index
Definition: mobi.h:316
uint32_t * srcs_index
Definition: mobi.h:353
uint32_t * huff_rec_count
Definition: mobi.h:325
uint32_t * drm_size
Definition: mobi.h:337
uint32_t * dict_output_lang
Definition: mobi.h:321
uint32_t * uid
Definition: mobi.h:304
uint32_t * srcs_count
Definition: mobi.h:354
uint32_t * unknown19
Definition: mobi.h:369
uint32_t * unknown17
Definition: mobi.h:367
uint32_t * guide_index
Definition: mobi.h:366
uint32_t * extra4_index
Definition: mobi.h:314
uint16_t * first_text_index
Definition: mobi.h:342
uint32_t * unknown11
Definition: mobi.h:352
MOBIEncoding * text_encoding
Definition: mobi.h:303
uint32_t * extra3_index
Definition: mobi.h:313
uint32_t * fcis_count
Definition: mobi.h:348
uint32_t * unknown6
Definition: mobi.h:334
uint32_t * unknown10
Definition: mobi.h:351
uint32_t * extra5_index
Definition: mobi.h:315
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
Header of palmdoc database file.
Definition: mobi.h:231
uint32_t uid
Definition: mobi.h:243
uint32_t ctime
Definition: mobi.h:235
uint16_t attributes
Definition: mobi.h:233
uint32_t appinfo_offset
Definition: mobi.h:239
uint16_t rec_count
Definition: mobi.h:245
uint32_t btime
Definition: mobi.h:237
uint32_t mtime
Definition: mobi.h:236
uint32_t next_rec
Definition: mobi.h:244
uint16_t version
Definition: mobi.h:234
uint32_t mod_num
Definition: mobi.h:238
uint32_t sortinfo_offset
Definition: mobi.h:240
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
Header of the Record 0 meta-record.
Definition: mobi.h:282
uint32_t text_length
Definition: mobi.h:286
uint16_t unknown1
Definition: mobi.h:290
uint16_t text_record_count
Definition: mobi.h:287
uint16_t encryption_type
Definition: mobi.h:289
uint16_t compression_type
Definition: mobi.h:284
uint16_t text_record_size
Definition: mobi.h:288