24#define EPUB_FILE_LEN_MAX 255
29#define EPUB_STATE_STRING_SIZE 500
34#define EPUB_CONTAINER_XML_READ_SIZE 350
39#define EPUB_OPF_READ_SIZE 800
46#define EPUB_LSDIR_CHARS_MAX 4096
51#define EPUB_PARSE_BUFFER_SIZE 4096
59#define EPUB_MAX_PAGE_BUFFER_SIZE 1500
66#define STATE_FILE "/SD:/.statefile"
int epub_get_next_chapter(void)
Go to the next chapter.
int32_t epub_get_page(void)
Get the current book's page within a chapter.
current_book_t * epub_get_current_book_state()
Restore the book state from a state file on the inserted SD card.
int epub_get_prev_chapter(void)
Go to the previous chapter.
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.
book_entry_t * epub_get_book_entry_for_title(char *title)
Get the book_entry_t representation for a given book title.
int epub_restore_book()
Restore a book's reading state from a saved state file.
int epub_open_book(book_entry_t *book)
Load and open the EPUB represented by the given book_entry_t entry.
void epub_update_page(int32_t update)
Update the current book's chapter page counter.
#define EPUB_MAX_PAGE_BUFFER_SIZE
The maximum configured page read size.
Definition epub.h:59
struct llist book_list_t
A linked list to store all book representations.
int epub_free_current_book_resources()
Free all dynamically allocated resources within the current book.
chapter_list_t * epub_get_chapter_list()
Get the chapter list for the current book.
book_list_t * epub_get_book_list()
Get the book list.
int epub_switch_chapter(uint32_t chapter)
Switch to a given chapter in a book.
struct dllist chapter_list_t
A double-linked list to represent the chapters in a book.
const char * epub_get_current_chapter_content(void)
Get the full content of the current prettified chapter.
int epub_destroy_book_list()
Free all dynamically allocated resources within the book list.
int epub_write_current_book_state()
Save the current book's state in a state file on the inserted SD card.
int epub_initialize()
Initialize the SD card and fetch EPUBs, authors and titles.
chapter_status_t * epub_get_chapter_status(void)
Get the chapter status.
Represents one EPUB E-Book.
Definition epub.h:73
char * entry_point
Definition epub.h:93
char * author
Definition epub.h:87
char * title
Definition epub.h:82
size_t number
Definition epub.h:77
char * content_dir
Definition epub.h:98
Represents one chapter in a book.
Definition epub.h:121
char * path
Definition epub.h:135
size_t number
Definition epub.h:125
char * title
Definition epub.h:130
Holds the chapter status.
Definition epub.h:245
char * title
Definition epub.h:259
uint32_t count
Definition epub.h:249
uint32_t current
Definition epub.h:254
Represents the current book read.
Definition epub.h:163
chapter_list_t * chapter_list
Definition epub.h:172
char * chapter_filename
Definition epub.h:187
uint16_t num_chapters
Definition epub.h:167
char * chapter_raw_content
Definition epub.h:192
char * title
Definition epub.h:225
chapter_list_t * current_chapter
Definition epub.h:177
size_t chapter_prettified_content_size
Definition epub.h:207
int32_t chapter
Definition epub.h:230
char * chapter_prettified_content
Definition epub.h:202
char * content_dir
Definition epub.h:212
size_t chapter_raw_content_size
Definition epub.h:197
char page[1500]
Definition epub.h:182
A double-linked list to represent the chapters in a book.
Definition epub.h:142
struct dllist * next
Definition epub.h:151
struct dllist * prev
Definition epub.h:156
chapter_entry_t * chapter
Definition epub.h:146
A linked list to store all book representations.
Definition epub.h:105
struct llist * next
Definition epub.h:114
book_entry_t * book
Definition epub.h:109