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 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_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. | |
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. |
#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.
#define EPUB_LSDIR_CHARS_MAX 4096 |
The maximum buffer size for listing directories.
Needs a fixed size.
#define EPUB_PAGE_SIZE 1400 |
The configured page read size.
The configured read chuck to be handled and parsed.
#define STATE_FILE "/SD:/.statefile" |
The path and name for the reading state file.
Currently a single global state is used.
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. |
char * epub_get_next_page | ( | ) |
Get the parsed and prettified next page.
char * epub_get_prev_page | ( | ) |
Get the parsed and prettified previous page.
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. |
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. |