libmobi
C library for handling MOBI format ebook documents
Data Structures | Enumerations
Exported enums

Data Structures

struct  MOBIFileMeta
 Metadata of file types. More...
 

Enumerations

enum  MOBI_RET {
  MOBI_SUCCESS = 0 , MOBI_ERROR = 1 , MOBI_PARAM_ERR = 2 , MOBI_DATA_CORRUPT = 3 ,
  MOBI_FILE_NOT_FOUND = 4 , MOBI_FILE_ENCRYPTED = 5 , MOBI_FILE_UNSUPPORTED = 6 , MOBI_MALLOC_FAILED = 7 ,
  MOBI_INIT_FAILED = 8 , MOBI_BUFFER_END = 9 , MOBI_XML_ERR = 10 , MOBI_DRM_PIDINV = 11 ,
  MOBI_DRM_KEYNOTFOUND = 12 , MOBI_DRM_UNSUPPORTED = 13 , MOBI_WRITE_FAILED = 14 , MOBI_DRM_EXPIRED = 15 ,
  MOBI_DRM_RANDOM_ERR = 16
}
 Error codes returned by functions. More...
 
enum  MOBIExthType { EXTH_NUMERIC = 0 , EXTH_STRING = 1 , EXTH_BINARY = 2 }
 EXTH record types.
 
enum  MOBIExthTag {
  EXTH_DRMSERVER = 1 , EXTH_DRMCOMMERCE = 2 , EXTH_DRMEBOOKBASE = 3 , EXTH_TITLE = 99 ,
  EXTH_AUTHOR = 100 , EXTH_PUBLISHER = 101 , EXTH_IMPRINT = 102 , EXTH_DESCRIPTION = 103 ,
  EXTH_ISBN = 104 , EXTH_SUBJECT = 105 , EXTH_PUBLISHINGDATE = 106 , EXTH_REVIEW = 107 ,
  EXTH_CONTRIBUTOR = 108 , EXTH_RIGHTS = 109 , EXTH_SUBJECTCODE = 110 , EXTH_TYPE = 111 ,
  EXTH_SOURCE = 112 , EXTH_ASIN = 113 , EXTH_VERSION = 114 , EXTH_SAMPLE = 115 ,
  EXTH_STARTREADING = 116 , EXTH_ADULT = 117 , EXTH_PRICE = 118 , EXTH_CURRENCY = 119 ,
  EXTH_KF8BOUNDARY = 121 , EXTH_FIXEDLAYOUT = 122 , EXTH_BOOKTYPE = 123 , EXTH_ORIENTATIONLOCK = 124 ,
  EXTH_COUNTRESOURCES = 125 , EXTH_ORIGRESOLUTION = 126 , EXTH_ZEROGUTTER = 127 , EXTH_ZEROMARGIN = 128 ,
  EXTH_KF8COVERURI = 129 , EXTH_RESCOFFSET = 131 , EXTH_REGIONMAGNI = 132 , EXTH_DICTNAME = 200 ,
  EXTH_COVEROFFSET = 201 , EXTH_THUMBOFFSET = 202 , EXTH_HASFAKECOVER = 203 , EXTH_CREATORSOFT = 204 ,
  EXTH_CREATORMAJOR = 205 , EXTH_CREATORMINOR = 206 , EXTH_CREATORBUILD = 207 , EXTH_WATERMARK = 208 ,
  EXTH_TAMPERKEYS = 209 , EXTH_FONTSIGNATURE = 300 , EXTH_CLIPPINGLIMIT = 401 , EXTH_PUBLISHERLIMIT = 402 ,
  EXTH_UNK403 = 403 , EXTH_TTSDISABLE = 404 , EXTH_READFORFREE = 405 , EXTH_RENTAL = 406 ,
  EXTH_UNK407 = 407 , EXTH_UNK450 = 450 , EXTH_UNK451 = 451 , EXTH_UNK452 = 452 ,
  EXTH_UNK453 = 453 , EXTH_DOCTYPE = 501 , EXTH_LASTUPDATE = 502 , EXTH_UPDATEDTITLE = 503 ,
  EXTH_ASIN504 = 504 , EXTH_TITLEFILEAS = 508 , EXTH_CREATORFILEAS = 517 , EXTH_PUBLISHERFILEAS = 522 ,
  EXTH_LANGUAGE = 524 , EXTH_ALIGNMENT = 525 , EXTH_CREATORSTRING = 526 , EXTH_PAGEDIR = 527 ,
  EXTH_OVERRIDEFONTS = 528 , EXTH_SORCEDESC = 529 , EXTH_DICTLANGIN = 531 , EXTH_DICTLANGOUT = 532 ,
  EXTH_INPUTSOURCE = 534 , EXTH_CREATORBUILDREV = 535
}
 EXTH record tags. More...
 
enum  MOBIFiletype {
  T_UNKNOWN , T_HTML , T_CSS , T_SVG ,
  T_OPF , T_NCX , T_JPG , T_GIF ,
  T_PNG , T_BMP , T_OTF , T_TTF ,
  T_MP3 , T_MPG , T_PDF , T_FONT ,
  T_AUDIO , T_VIDEO , T_BREAK
}
 Types of files stored in database records. More...
 
enum  MOBIEncoding { MOBI_CP1252 = 1252 , MOBI_UTF8 = 65001 , MOBI_UTF16 = 65002 }
 Encoding types in MOBI header (offset 28) More...
 

Detailed Description

Enumeration Type Documentation

◆ MOBI_RET

enum MOBI_RET

Error codes returned by functions.

Enumerator
MOBI_SUCCESS 

Generic success return value

MOBI_ERROR 

Generic error return value

MOBI_PARAM_ERR 

Wrong function parameter

MOBI_DATA_CORRUPT 

Corrupted data

MOBI_FILE_NOT_FOUND 

File not found

MOBI_FILE_ENCRYPTED 

Unsupported encrypted data

MOBI_FILE_UNSUPPORTED 

Unsupported document type

MOBI_MALLOC_FAILED 

Memory allocation error

MOBI_INIT_FAILED 

Initialization error

MOBI_BUFFER_END 

Out of buffer error

MOBI_XML_ERR 

XMLwriter error

MOBI_DRM_PIDINV 

Invalid DRM PID

MOBI_DRM_KEYNOTFOUND 

Key not found

MOBI_DRM_UNSUPPORTED 

DRM support not included

MOBI_WRITE_FAILED 

Writing to file failed

MOBI_DRM_EXPIRED 

DRM expired

MOBI_DRM_RANDOM_ERR 

DRM random bytes generation failed

Examples
mobimeta.c.

◆ MOBIEncoding

Encoding types in MOBI header (offset 28)

Enumerator
MOBI_CP1252 

cp-1252 encoding

MOBI_UTF8 

utf-8 encoding

MOBI_UTF16 

utf-16 encoding

◆ MOBIExthTag

EXTH record tags.

Enumerator
EXTH_TITLE 

<dc:title>

EXTH_AUTHOR 

<dc:creator>

EXTH_PUBLISHER 

<dc:publisher>

EXTH_IMPRINT 

<imprint>

EXTH_DESCRIPTION 

<dc:description>

EXTH_ISBN 

<dc:identifier opf:scheme="ISBN">

EXTH_SUBJECT 

<dc:subject>

EXTH_PUBLISHINGDATE 

<dc:date>

EXTH_REVIEW 

<review>

EXTH_CONTRIBUTOR 

<dc:contributor>

EXTH_RIGHTS 

<dc:rights>

EXTH_SUBJECTCODE 

<dc:subject BASICCode="subjectcode">

EXTH_TYPE 

<dc:type>

EXTH_SOURCE 

<dc:source>

EXTH_STARTREADING 

Start reading

EXTH_ADULT 

<adult>

EXTH_PRICE 

<srp>

EXTH_CURRENCY 

<srp currency="currency">

EXTH_FIXEDLAYOUT 

<fixed-layout>

EXTH_BOOKTYPE 

<book-type>

EXTH_ORIENTATIONLOCK 

<orientation-lock>

EXTH_ORIGRESOLUTION 

<original-resolution>

EXTH_ZEROGUTTER 

<zero-gutter>

EXTH_ZEROMARGIN 

<zero-margin>

EXTH_REGIONMAGNI 

<region-mag>

EXTH_DICTNAME 

<DictionaryVeryShortName>

EXTH_COVEROFFSET 

<EmbeddedCover>

EXTH_DOCTYPE 

PDOC - Personal Doc; EBOK - ebook; EBSP - ebook sample;

EXTH_LANGUAGE 

<dc:language>

EXTH_ALIGNMENT 

<primary-writing-mode>

EXTH_OVERRIDEFONTS 

<override-kindle-fonts>

◆ MOBIFiletype

Types of files stored in database records.

Enumerator
T_UNKNOWN 

unknown

T_HTML 

html

T_CSS 

css

T_SVG 

svg

T_OPF 

opf

T_NCX 

ncx

T_JPG 

jpg

T_GIF 

gif

T_PNG 

png

T_BMP 

bmp

T_OTF 

otf

T_TTF 

ttf

T_MP3 

mp3

T_MPG 

mp3

T_PDF 

pdf

T_FONT 

encoded font

T_AUDIO 

audio resource

T_VIDEO 

video resource

T_BREAK 

end of file