ZEReader 0.1.0
A Zephyr-based E-Book-Reader
Loading...
Searching...
No Matches
epub.h File Reference

The ZEReader EPUB library. More...

#include <stdint.h>
#include <stddef.h>

Go to the source code of this file.

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 maximum file name length supported by the FatFS filesystem is 255.
#define EPUB_STATE_STRING_SIZE   500
 The maximum buffer size for the state string.
#define EPUB_CONTAINER_XML_READ_SIZE   350
 The read size for the container.xml file.
#define EPUB_OPF_READ_SIZE   800
 The read size for the content.opf file.
#define EPUB_LSDIR_CHARS_MAX   4096
 The maximum buffer size for listing directories.
#define EPUB_PARSE_BUFFER_SIZE   4096
 The maximum buffer size for parsing chapter files.
#define EPUB_MAX_PAGE_BUFFER_SIZE   1500
 The maximum 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_destroy_book_list ()
 Free all dynamically allocated resources within the book list.
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.
const char * epub_get_current_chapter_content (void)
 Get the full content of the current prettified chapter.
int epub_get_next_chapter ()
 Go to the next chapter.
int epub_get_prev_chapter ()
 Go to the previous chapter.
void epub_update_page (int32_t update)
 Update the current book's chapter page counter.
int32_t epub_get_page (void)
 Get the current book's page within a chapter.
int epub_write_current_book_state ()
 Save the current book's state in a state file on the inserted SD card.
current_book_tepub_get_current_book_state ()
 Restore the book state from a state file on the inserted SD card.
int epub_free_current_book_resources ()
 Free all dynamically allocated resources within the current book.

Detailed Description

The ZEReader EPUB library.