This commit is contained in:
simon987 2021-09-06 21:24:32 -04:00
parent fe53e1a219
commit f061212d4b
2 changed files with 10 additions and 10 deletions

View File

@ -6,7 +6,7 @@
#include "../ebook/ebook.h" #include "../ebook/ebook.h"
void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, void* buf, size_t buf_len) { void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, void *buf, size_t buf_len) {
// Open word doc // Open word doc
options_type *opts = direct_vGetOptions(); options_type *opts = direct_vGetOptions();
@ -20,7 +20,7 @@ void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, voi
opts->iPageWidth = 595; opts->iPageWidth = 595;
opts->eImageLevel = level_ps_3; opts->eImageLevel = level_ps_3;
int doc_word_version = iGuessVersionNumber(file_in, buf_len); int doc_word_version = iGuessVersionNumber(file_in, (int) buf_len);
if (doc_word_version < 0 || doc_word_version == 3) { if (doc_word_version < 0 || doc_word_version == 3) {
free(buf); free(buf);
return; return;
@ -38,19 +38,19 @@ void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, voi
return; return;
} }
iInitDocument(file_in, buf_len); iInitDocument(file_in, (int) buf_len);
const char* author = szGetAuthor(); const char *author = szGetAuthor();
if (author != NULL) { if (author != NULL) {
APPEND_UTF8_META(doc, MetaAuthor, author) APPEND_UTF8_META(doc, MetaAuthor, author)
} }
const char* title = szGetTitle(); const char *title = szGetTitle();
if (title != NULL) { if (title != NULL) {
APPEND_UTF8_META(doc, MetaTitle, title) APPEND_UTF8_META(doc, MetaTitle, title)
} }
vFreeDocument(); vFreeDocument();
bWordDecryptor(file_in, buf_len, diag); bWordDecryptor(file_in, (int) buf_len, diag);
vDestroyDiagram(diag); vDestroyDiagram(diag);
fclose(file_out); fclose(file_out);
@ -71,7 +71,7 @@ void parse_msdoc_text(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file_in, voi
free(out_buf); free(out_buf);
} }
void parse_msdoc_pdf(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file, void* buf, size_t buf_len) { void parse_msdoc_pdf(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file, void *buf, size_t buf_len) {
scan_ebook_ctx_t ebook_ctx = { scan_ebook_ctx_t ebook_ctx = {
.content_size = ctx->content_size, .content_size = ctx->content_size,
@ -93,7 +93,7 @@ void parse_msdoc_pdf(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file, void* b
opts->iPageWidth = 595; opts->iPageWidth = 595;
opts->eImageLevel = level_ps_3; opts->eImageLevel = level_ps_3;
int doc_word_version = iGuessVersionNumber(file, buf_len); int doc_word_version = iGuessVersionNumber(file, (int) buf_len);
if (doc_word_version < 0 || doc_word_version == 3) { if (doc_word_version < 0 || doc_word_version == 3) {
free(buf); free(buf);
return; return;
@ -110,7 +110,7 @@ void parse_msdoc_pdf(scan_msdoc_ctx_t *ctx, document_t *doc, FILE *file, void* b
return; return;
} }
bWordDecryptor(file, buf_len, diag); bWordDecryptor(file, (int) buf_len, diag);
vDestroyDiagram(diag); vDestroyDiagram(diag);
fclose(file_out); fclose(file_out);

View File

@ -35,7 +35,7 @@ scan_code_t parse_text(scan_text_ctx_t *ctx, vfile_t *f, document_t *doc) {
return SCAN_OK; return SCAN_OK;
} }
#define MAX_MARKUP_SIZE 1024 * 1024 #define MAX_MARKUP_SIZE (1024 * 1024)
scan_code_t parse_markup(scan_text_ctx_t *ctx, vfile_t *f, document_t *doc) { scan_code_t parse_markup(scan_text_ctx_t *ctx, vfile_t *f, document_t *doc) {