EBOOK-TOOLS
Classes | Macros | Enumerations | Functions | Variables
epublib.h File Reference
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <zip.h>
#include <zlib.h>
#include <libxml/xmlreader.h>
#include "linklist.h"
#include "epub_shared.h"
Include dependency graph for epublib.h:

Go to the source code of this file.

Classes

struct  creator
 
struct  date
 
struct  eiterator
 private iterator struct More...
 
struct  epub
 private struct containting information about the epub file More...
 
struct  epuberr
 
struct  guide
 
struct  id
 
struct  manifest
 
struct  meta
 
struct  metadata
 
struct  ocf
 
struct  opf
 
struct  root
 
struct  site
 
struct  spine
 
struct  tit_info
 
struct  titerator
 
struct  toc
 
struct  tocCategory
 
struct  tocItem
 
struct  tocLabel
 
struct  tour
 

Macros

#define _epub_err_set_const_str(_err, _err_string)
 
#define _epub_err_set_oom(_epub_err)   _epub_err_set_const_str(_epub_err, _epub_error_oom)
 
#define _epub_err_set_str(_err, _err_string, _err_string_len)
 
#define CONTAINER_FILENAME   "container.xml"
 
#define ENCRYPTION_FILENAME   "encryption.xml"
 
#define MANIFEST_FILENAME   "manifest.xml"
 
#define METADATA_FILENAME   "metadata.xml"
 
#define METAINFO_DIR   "META-INF"
 
#define MIMETYPE_FILENAME   "mimetype"
 
#define PATH_SEPARATOR   '/'
 
#define PRINTF_FORMAT(si, ftc)
 
#define RIGHTS_FILENAME   "rights.xml"
 
#define SIGNATURES_FILENAME   "signatures.xml"
 

Enumerations

enum  {
  DEBUG_NONE , DEBUG_ERROR , DEBUG_WARNING , DEBUG_INFO ,
  DEBUG_VERBOSE
}
 

Functions

void _epub_print_debug (struct epub *epub, int debug, const char *format,...) PRINTF_FORMAT(3
 
int _list_cmp_label_by_lang (struct tocLabel *t1, struct tocLabel *t2)
 
int _list_cmp_manifest_by_id (struct manifest *m1, struct manifest *m2)
 
int _list_cmp_root_by_mediatype (struct root *root1, struct root *root2)
 
int _list_cmp_toc_by_playorder (struct tocItem *t1, struct tocItem *t2)
 
void _list_dump_creator (struct creator *data)
 
void _list_dump_date (struct date *date)
 
void _list_dump_guide (struct guide *guide)
 
void _list_dump_id (struct id *id)
 
void _list_dump_meta (struct meta *meta)
 
void _list_dump_root (struct root *root)
 
void _list_dump_spine (struct spine *spine)
 
void _list_dump_string (char *string)
 
void _list_dump_tour (struct tour *tour)
 
void _list_free_creator (struct creator *data)
 
void _list_free_date (struct date *date)
 
void _list_free_guide (struct guide *guide)
 
void _list_free_id (struct id *id)
 
void _list_free_manifest (struct manifest *manifest)
 
void _list_free_meta (struct meta *meta)
 
void _list_free_root (struct root *data)
 
void _list_free_spine (struct spine *spine)
 
void _list_free_toc_item (struct tocItem *ti)
 
void _list_free_toc_label (struct tocLabel *tl)
 
void _list_free_tours (struct tour *tour)
 
int _ocf_check_file (struct ocf *ocf, const char *filename)
 
void _ocf_close (struct ocf *ocf)
 
void _ocf_dump (struct ocf *ocf)
 
int _ocf_get_data_file (struct ocf *ocf, const char *filename, char **fileStr)
 
int _ocf_get_file (struct ocf *ocf, const char *filename, char **fileStr)
 
struct zip * _ocf_open (struct ocf *ocf, const char *fileName)
 
struct ocf_ocf_parse (struct epub *epub, const char *filename)
 
int _ocf_parse_container (struct ocf *ocf)
 
int _ocf_parse_mimetype (struct ocf *ocf)
 
char * _ocf_root_by_type (struct ocf *ocf, const char *type)
 
char * _ocf_root_fullpath_by_type (struct ocf *ocf, const char *type)
 
void _opf_close (struct opf *opf)
 
void _opf_dump (struct opf *opf)
 
void _opf_free_toc (struct toc *toc)
 
void _opf_free_toc_category (struct tocCategory *tc)
 
struct toc_opf_init_toc ()
 
struct tocCategory_opf_init_toc_category ()
 
xmlChar * _opf_label_get_by_doc_lang (struct opf *opf, listPtr label)
 
xmlChar * _opf_label_get_by_lang (struct opf *opf, listPtr label, char *lang)
 
struct manifest_opf_manifest_get_by_id (struct opf *opf, xmlChar *id)
 
struct opf_opf_parse (struct epub *epub, char *opfStr)
 
void _opf_parse_guide (struct opf *opf, xmlTextReaderPtr reader)
 
void _opf_parse_manifest (struct opf *opf, xmlTextReaderPtr reader)
 
void _opf_parse_metadata (struct opf *opf, xmlTextReaderPtr reader)
 
struct tocLabel_opf_parse_navlabel (struct opf *opf, xmlTextReaderPtr reader)
 
void _opf_parse_navlist (struct opf *opf, xmlTextReaderPtr reader)
 
void _opf_parse_navmap (struct opf *opf, xmlTextReaderPtr reader)
 
void _opf_parse_pagelist (struct opf *opf, xmlTextReaderPtr reader)
 
void _opf_parse_spine (struct opf *opf, xmlTextReaderPtr reader)
 
void _opf_parse_toc (struct opf *opf, char *tocStr, int size)
 
void _opf_parse_tours (struct opf *opf, xmlTextReaderPtr reader)
 
void char * epub_last_errStr (struct epub *epub)
 
struct epubepub_open (const char *filename, int debug)
 

Variables

const char _epub_error_oom []
 

Macro Definition Documentation

◆ _epub_err_set_const_str

#define _epub_err_set_const_str (   _err,
  _err_string 
)
Value:
do { \
(_err)->str = _err_string; \
(_err)->type = 1; \
} while (0)

Definition at line 197 of file epublib.h.

◆ _epub_err_set_oom

#define _epub_err_set_oom (   _epub_err)    _epub_err_set_const_str(_epub_err, _epub_error_oom)

Definition at line 209 of file epublib.h.

◆ _epub_err_set_str

#define _epub_err_set_str (   _err,
  _err_string,
  _err_string_len 
)
Value:
do { \
strncpy((_err)->lastStr, _err_string, _err_string_len); \
(_err)->len = _err_string_len; \
(_err)->str = (_err)->lastStr; \
(_err)->type = 0; \
} while (0)

Definition at line 202 of file epublib.h.

◆ CONTAINER_FILENAME

#define CONTAINER_FILENAME   "container.xml"

Definition at line 42 of file epublib.h.

◆ ENCRYPTION_FILENAME

#define ENCRYPTION_FILENAME   "encryption.xml"

Definition at line 46 of file epublib.h.

◆ MANIFEST_FILENAME

#define MANIFEST_FILENAME   "manifest.xml"

Definition at line 43 of file epublib.h.

◆ METADATA_FILENAME

#define METADATA_FILENAME   "metadata.xml"

Definition at line 44 of file epublib.h.

◆ METAINFO_DIR

#define METAINFO_DIR   "META-INF"

Definition at line 40 of file epublib.h.

◆ MIMETYPE_FILENAME

#define MIMETYPE_FILENAME   "mimetype"

Definition at line 41 of file epublib.h.

◆ PATH_SEPARATOR

#define PATH_SEPARATOR   '/'

Definition at line 23 of file epublib.h.

◆ PRINTF_FORMAT

#define PRINTF_FORMAT (   si,
  ftc 
)

Definition at line 29 of file epublib.h.

◆ RIGHTS_FILENAME

#define RIGHTS_FILENAME   "rights.xml"

Definition at line 47 of file epublib.h.

◆ SIGNATURES_FILENAME

#define SIGNATURES_FILENAME   "signatures.xml"

Definition at line 45 of file epublib.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEBUG_NONE 
DEBUG_ERROR 
DEBUG_WARNING 
DEBUG_INFO 
DEBUG_VERBOSE 

Definition at line 220 of file epublib.h.

Function Documentation

◆ _epub_print_debug()

void _epub_print_debug ( struct epub epub,
int  debug,
const char *  format,
  ... 
)

◆ _list_cmp_label_by_lang()

int _list_cmp_label_by_lang ( struct tocLabel t1,
struct tocLabel t2 
)

◆ _list_cmp_manifest_by_id()

int _list_cmp_manifest_by_id ( struct manifest m1,
struct manifest m2 
)

◆ _list_cmp_root_by_mediatype()

int _list_cmp_root_by_mediatype ( struct root root1,
struct root root2 
)

◆ _list_cmp_toc_by_playorder()

int _list_cmp_toc_by_playorder ( struct tocItem t1,
struct tocItem t2 
)

◆ _list_dump_creator()

void _list_dump_creator ( struct creator data)

◆ _list_dump_date()

void _list_dump_date ( struct date date)

◆ _list_dump_guide()

void _list_dump_guide ( struct guide guide)

◆ _list_dump_id()

void _list_dump_id ( struct id id)

◆ _list_dump_meta()

void _list_dump_meta ( struct meta meta)

◆ _list_dump_root()

void _list_dump_root ( struct root root)

◆ _list_dump_spine()

void _list_dump_spine ( struct spine spine)

◆ _list_dump_string()

void _list_dump_string ( char *  string)

◆ _list_dump_tour()

void _list_dump_tour ( struct tour tour)

◆ _list_free_creator()

void _list_free_creator ( struct creator data)

◆ _list_free_date()

void _list_free_date ( struct date date)

◆ _list_free_guide()

void _list_free_guide ( struct guide guide)

◆ _list_free_id()

void _list_free_id ( struct id id)

◆ _list_free_manifest()

void _list_free_manifest ( struct manifest manifest)

◆ _list_free_meta()

void _list_free_meta ( struct meta meta)

◆ _list_free_root()

void _list_free_root ( struct root data)

◆ _list_free_spine()

void _list_free_spine ( struct spine spine)

◆ _list_free_toc_item()

void _list_free_toc_item ( struct tocItem ti)

◆ _list_free_toc_label()

void _list_free_toc_label ( struct tocLabel tl)

◆ _list_free_tours()

void _list_free_tours ( struct tour tour)

◆ _ocf_check_file()

int _ocf_check_file ( struct ocf ocf,
const char *  filename 
)

◆ _ocf_close()

void _ocf_close ( struct ocf ocf)

◆ _ocf_dump()

void _ocf_dump ( struct ocf ocf)

◆ _ocf_get_data_file()

int _ocf_get_data_file ( struct ocf ocf,
const char *  filename,
char **  fileStr 
)

◆ _ocf_get_file()

int _ocf_get_file ( struct ocf ocf,
const char *  filename,
char **  fileStr 
)

◆ _ocf_open()

struct zip * _ocf_open ( struct ocf ocf,
const char *  fileName 
)

◆ _ocf_parse()

struct ocf * _ocf_parse ( struct epub epub,
const char *  filename 
)

◆ _ocf_parse_container()

int _ocf_parse_container ( struct ocf ocf)

◆ _ocf_parse_mimetype()

int _ocf_parse_mimetype ( struct ocf ocf)

◆ _ocf_root_by_type()

char * _ocf_root_by_type ( struct ocf ocf,
const char *  type 
)

◆ _ocf_root_fullpath_by_type()

char * _ocf_root_fullpath_by_type ( struct ocf ocf,
const char *  type 
)

◆ _opf_close()

void _opf_close ( struct opf opf)

◆ _opf_dump()

void _opf_dump ( struct opf opf)

◆ _opf_free_toc()

void _opf_free_toc ( struct toc toc)

◆ _opf_free_toc_category()

void _opf_free_toc_category ( struct tocCategory tc)

◆ _opf_init_toc()

struct toc * _opf_init_toc ( )

◆ _opf_init_toc_category()

struct tocCategory * _opf_init_toc_category ( )

◆ _opf_label_get_by_doc_lang()

xmlChar * _opf_label_get_by_doc_lang ( struct opf opf,
listPtr  label 
)

◆ _opf_label_get_by_lang()

xmlChar * _opf_label_get_by_lang ( struct opf opf,
listPtr  label,
char *  lang 
)

◆ _opf_manifest_get_by_id()

struct manifest * _opf_manifest_get_by_id ( struct opf opf,
xmlChar *  id 
)

◆ _opf_parse()

struct opf * _opf_parse ( struct epub epub,
char *  opfStr 
)

◆ _opf_parse_guide()

void _opf_parse_guide ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ _opf_parse_manifest()

void _opf_parse_manifest ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ _opf_parse_metadata()

void _opf_parse_metadata ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ _opf_parse_navlabel()

struct tocLabel * _opf_parse_navlabel ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ _opf_parse_navlist()

void _opf_parse_navlist ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ _opf_parse_navmap()

void _opf_parse_navmap ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ _opf_parse_pagelist()

void _opf_parse_pagelist ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ _opf_parse_spine()

void _opf_parse_spine ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ _opf_parse_toc()

void _opf_parse_toc ( struct opf opf,
char *  tocStr,
int  size 
)

◆ _opf_parse_tours()

void _opf_parse_tours ( struct opf opf,
xmlTextReaderPtr  reader 
)

◆ epub_last_errStr()

void char * epub_last_errStr ( struct epub epub)

◆ epub_open()

struct epub * epub_open ( const char *  filename,
int  debug 
)

Variable Documentation

◆ _epub_error_oom

const char _epub_error_oom[]
extern