1
This commit is contained in:
Alex Yatskov 2016-11-01 22:11:29 -07:00
parent 61ccf7d091
commit 621681b738
2 changed files with 10 additions and 11 deletions

7
main.c
View File

@ -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;
}
}

10
util.h
View File

@ -20,6 +20,7 @@
#define UTIL_H
#include <stdlib.h>
#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,10 +47,11 @@ typedef struct {
typedef struct {
char* title;
char* copyright;
char* error;
Entry* entries;
int entry_count;
char error[256];
} Subbook;
typedef struct {