1
zero-epwing/book.h

61 lines
1.5 KiB
C
Raw Normal View History

2016-11-21 02:23:50 +00:00
/*
* Copyright (C) 2016 Alex Yatskov <alex@foosoft.net>
* Author: Alex Yatskov <alex@foosoft.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BOOK_H
#define BOOK_H
#include <stdbool.h>
#include <stdio.h>
2016-11-29 05:16:43 +00:00
#include "font.h"
2016-11-21 02:23:50 +00:00
/*
* Types
*/
typedef struct {
char* heading;
char* text;
} Book_Entry;
typedef struct {
2016-11-22 06:44:33 +00:00
char* title;
char* copyright;
2016-11-21 02:23:50 +00:00
Book_Entry* entries;
int entry_count;
int entry_capacity;
} Book_Subbook;
typedef struct {
2016-11-22 06:44:33 +00:00
char character_code[32];
char disc_code[32];
2016-11-21 02:23:50 +00:00
Book_Subbook* subbooks;
int subbook_count;
} Book;
/*
* Functions
*/
2016-11-22 06:31:01 +00:00
void book_init(Book* book);
2016-11-21 02:23:50 +00:00
void book_free(Book* book);
2016-11-29 05:16:43 +00:00
bool book_export(Book* book, const Font_Context* context, const char path[], bool markup);
2016-11-29 05:04:55 +00:00
bool book_dump(Book* book, bool pretty_print, FILE* fp);
2016-11-21 02:23:50 +00:00
#endif /* BOOK_H */