|
ZEReader 0.1.0
A Zephyr-based E-Book-Reader
|
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_t * | epub_get_book_list () |
| Get the book list. | |
| 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_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_t * | epub_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. | |
| #define EPUB_LSDIR_CHARS_MAX 4096 |
The maximum buffer size for listing directories.
Needs a fixed size.
| #define EPUB_MAX_PAGE_BUFFER_SIZE 1500 |
The maximum configured page read size.
This defines the maximum internal buffer size for a page. The UI will request a specific size, but it cannot exceed this internal buffer size.
| #define STATE_FILE "/SD:/.statefile" |
The path and name for the reading state file.
Currently a single global state is used.
| int epub_destroy_book_list | ( | ) |
Free all dynamically allocated resources within the book list.
| 0 | on success. |
| int epub_free_current_book_resources | ( | ) |
Free all dynamically allocated resources within the current book.
| 0 | on success. |
| 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.
| [in] | number | The number of the book within the book_list. |
| book_entry_t | the book_entry representation on success. |
| NULL | if there is not book_entry for the given number. |
| book_entry_t * epub_get_book_entry_for_title | ( | char * | title | ) |
Get the book_entry_t representation for a given book title.
| [in] | title | The title of the book. |
| book_entry_t | the book_entry representation on success. |
| NULL | if there is no book_entry for the given title. |
| book_list_t * epub_get_book_list | ( | ) |
Get the book list.
| book_list_t | a linked list to store the books. |
| current_book_t * epub_get_current_book_state | ( | ) |
Restore the book state from a state file on the inserted SD card.
| 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.
| 0 | on success. |
| int32_t epub_get_page | ( | void | ) |
Get the current book's page within a chapter.
| A | positive page number or 0 on success. |
| int epub_get_prev_chapter | ( | ) |
Go to the previous chapter.
| 0 | on success. |
| int epub_initialize | ( | ) |
Initialize the SD card and fetch EPUBs, authors and titles.
| 0 | on success. |
| int epub_open_book | ( | book_entry_t * | book | ) |
Load and open the EPUB represented by the given book_entry_t entry.
| [in] | book | The book's book_entry_t representation. |
| 0 | on success. |
| int epub_restore_book | ( | ) |
Restore a book's reading state from a saved state file.
| 0 | on success. |
| void epub_update_page | ( | int32_t | update | ) |
Update the current book's chapter page counter.
| [in] | update | The page difference, e.g. +1 or -1. |
| int epub_write_current_book_state | ( | ) |
Save the current book's state in a state file on the inserted SD card.
| >=0 | written bytes, on success. |