From 621681b738ab2cc72508dc44865c24cd6e123249 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Tue, 1 Nov 2016 22:11:29 -0700 Subject: [PATCH] WIP --- main.c | 7 ------- util.h | 14 ++++++++++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/main.c b/main.c index 3222714..027f175 100644 --- a/main.c +++ b/main.c @@ -141,7 +141,6 @@ static void export_book(const char path[], Book* book_data) { EB_Book book; eb_initialize_book(&book); - if ((error = eb_bind(&book, path)) != EB_SUCCESS) { strcpy(book_data->error, eb_error_message(error)); eb_finalize_book(&book); @@ -161,9 +160,6 @@ static void export_book(const char path[], Book* book_data) { case EB_CHARCODE_JISX0208_GB2312: strcpy(book_data->character_code, "jisx0208/gb2312"); break; - default: - strcpy(book_data->character_code, "invalid"); - break; } } @@ -176,9 +172,6 @@ static void export_book(const char path[], Book* book_data) { case EB_DISC_EPWING: strcpy(book_data->disc_code, "epwing"); break; - default: - strcpy(book_data->disc_code, "invalid"); - break; } } diff --git a/util.h b/util.h index 162e90f..7c889bc 100644 --- a/util.h +++ b/util.h @@ -20,6 +20,7 @@ #define UTIL_H #include +#include "eb/eb/eb.h" /* Dictionary structures @@ -32,8 +33,12 @@ typedef struct { typedef struct { char* heading; + int heading_page; + int heading_offset; + char* text; - char* error; + int text_page; + int text_offset; int page; int offset; @@ -42,15 +47,16 @@ typedef struct { typedef struct { char* title; char* copyright; - char* error; Entry* entries; int entry_count; + + char error[256]; } Subbook; typedef struct { - char character_code[256]; - char disc_code[256]; + char character_code[256]; + char disc_code[256]; Subbook* subbooks; int subbook_count;