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"
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.
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.
int epub_get_next_chapter()
Go to the next chapter.
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_get_prev_chapter()
Go to the previous chapter.
int epub_free_current_book_resources()
Free all dynamically allocated resources within the current book.
book_list_t * epub_get_book_list()
Get the book list.
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.
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:130
size_t number
Definition epub.h:125
Represents the current book read.
Definition epub.h:158
chapter_list_t * chapter_list
Definition epub.h:167
char * chapter_filename
Definition epub.h:182
uint16_t num_chapters
Definition epub.h:162
char * chapter_raw_content
Definition epub.h:187
char * title
Definition epub.h:220
chapter_list_t * current_chapter
Definition epub.h:172
size_t chapter_prettified_content_size
Definition epub.h:202
int32_t chapter
Definition epub.h:225
char * chapter_prettified_content
Definition epub.h:197
char * content_dir
Definition epub.h:207
size_t chapter_raw_content_size
Definition epub.h:192
char page[1500]
Definition epub.h:177
A double-linked list to represent the chapters in a book.
Definition epub.h:137
struct dllist * next
Definition epub.h:146
struct dllist * prev
Definition epub.h:151
chapter_entry_t * chapter
Definition epub.h:141
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