ZEReader 0.1.0
A Zephyr-based E-Book-Reader
Loading...
Searching...
No Matches
EPUB management and parsing

Data Structures

struct  book_entry_t
 Represents one EPUB E-Book. More...
struct  llist
 A linked list to store all book representations. More...
struct  chapter_entry_t
 Represents one chapter in a book. More...
struct  dllist
 A double-linked list to represent the chapters in a book. More...
struct  current_book_t
 Represents the current book read. More...

Macros

#define EPUB_FILE_LEN_MAX   255
 The at maximum handled file name length.
#define EPUB_LSDIR_CHARS_MAX   4096
 The maximum buffer size for listing directories.
#define EPUB_PAGE_SIZE   1400
 The configured page read size.
#define STATE_FILE   "/SD:/.statefile"
 The path and name for the reading state file.

Typedefs

typedef struct llist book_list_t
 A linked list to store all book representations.
typedef struct dllist chapter_list_t
 A double-linked list to represent the chapters in a book.

Functions

int epub_initialize ()
 Initialize the SD card and fetch EPUBs, authors and titles.
book_list_tepub_get_book_list ()
 Get the book list.
book_entry_tepub_get_book_entry_for_num (uint16_t number)
 Get the book_entry_t representation for a given number in the book list.
book_entry_tepub_get_book_entry_for_title (char *title)
 Get the book_entry_t representation for a given book title.
int epub_open_book (book_entry_t *book)
 Load and open the EPUB represented by the given book_entry_t entry.
int epub_restore_book ()
 Restore a book's reading state from a saved state file.
char * epub_get_prev_page ()
 Get the parsed and prettified previous page.
char * epub_get_next_page ()
 Get the parsed and prettified next page.
int epub_write_current_book_state ()
 Save the current book's state in a state file on the inserted SD card.
void epub_get_current_book_state ()
 Restore the book state from a state file on the inserted SD card.

Detailed Description

Macro Definition Documentation

◆ EPUB_FILE_LEN_MAX

#define EPUB_FILE_LEN_MAX   255

The at maximum handled file name length.

The maximum file name length supported by the FatFS filesystem is 255.

◆ EPUB_LSDIR_CHARS_MAX

#define EPUB_LSDIR_CHARS_MAX   4096

The maximum buffer size for listing directories.

Needs a fixed size.

◆ EPUB_PAGE_SIZE

#define EPUB_PAGE_SIZE   1400

The configured page read size.

The configured read chuck to be handled and parsed.

◆ STATE_FILE

#define STATE_FILE   "/SD:/.statefile"

The path and name for the reading state file.

Currently a single global state is used.

Function Documentation

◆ epub_get_book_entry_for_num()

book_entry_t * epub_get_book_entry_for_num ( uint16_t number)

Get the book_entry_t representation for a given number in the book list.

Parameters
[in]numberThe number of the book within the book_list.
Return values
book_entry_tthe book_entry representation on success.
NULLif there is not book_entry for the given number.

◆ epub_get_book_entry_for_title()

book_entry_t * epub_get_book_entry_for_title ( char * title)

Get the book_entry_t representation for a given book title.

Parameters
[in]titleThe title of the book.
Return values
book_entry_tthe book_entry representation on success.
NULLif there is no book_entry for the given title.

◆ epub_get_book_list()

book_list_t * epub_get_book_list ( )

Get the book list.

Return values
book_list_ta linked list to store the books.

◆ epub_get_next_page()

char * epub_get_next_page ( )

Get the parsed and prettified next page.

Returns
the parsed and prettified page.

◆ epub_get_prev_page()

char * epub_get_prev_page ( )

Get the parsed and prettified previous page.

Returns
the parsed and prettified page.

◆ epub_initialize()

int epub_initialize ( )

Initialize the SD card and fetch EPUBs, authors and titles.

Return values
0on success.

◆ epub_open_book()

int epub_open_book ( book_entry_t * book)

Load and open the EPUB represented by the given book_entry_t entry.

Parameters
[in]bookThe book's book_entry_t representation.
Return values
0on success.

◆ epub_restore_book()

int epub_restore_book ( )

Restore a book's reading state from a saved state file.

Return values
0on success.

◆ epub_write_current_book_state()

int epub_write_current_book_state ( )

Save the current book's state in a state file on the inserted SD card.

Return values
>=0written bytes, on success.