diff --git a/gaiji.c b/gaiji.c index fac6fbe..76f6704 100644 --- a/gaiji.c +++ b/gaiji.c @@ -105,7 +105,7 @@ static void encode_sequence(char output[], int size, const char utf8[]) { * Exported functions */ -const Gaiji_Context* gaiji_select_context(const char name[]) { +const Gaiji_Context* gaiji_context_select(const char name[]) { for (unsigned i = 0; i < ARRSIZE(gaiji_contexts); ++i) { const Gaiji_Context* context = gaiji_contexts + i; if (strcmp(context->name, name) == 0) { @@ -116,7 +116,7 @@ const Gaiji_Context* gaiji_select_context(const char name[]) { return NULL; } -void gaiji_build_stub(char output[], int size, int code, const Gaiji_Context* context, Gaiji_Width width) { +void gaiji_stub_encode(char output[], int size, int code, const Gaiji_Context* context, Gaiji_Width width) { do { if (context == NULL) { break; @@ -153,7 +153,7 @@ void gaiji_build_stub(char output[], int size, int code, const Gaiji_Context* co output[size - 1] = 0; } -void gaiji_fixup_stub(char output[], int size, const char input[]) { +void gaiji_stub_decode(char output[], int size, const char input[]) { const char* ptr_in = input; char* ptr_out = output; bool decode = false; diff --git a/gaiji.h b/gaiji.h index 3450589..78c725d 100644 --- a/gaiji.h +++ b/gaiji.h @@ -23,8 +23,8 @@ * Constants */ -#define MAX_UTF8_BYTES 9 -#define MAX_STUB_BYTES 32 +#define MAX_UTF8_BYTES 9 +#define MAX_STUB_BYTES 32 #define MAX_CONTEXT_NAME 256 /* @@ -53,8 +53,8 @@ typedef enum { * Functions */ -const Gaiji_Context* gaiji_select_context(const char name[]); -void gaiji_build_stub(char output[], int size, int code, const Gaiji_Context* context, Gaiji_Width width); -void gaiji_fixup_stub(char output[], int size, const char input[]); +const Gaiji_Context* gaiji_context_select(const char name[]); +void gaiji_stub_encode(char output[], int size, int code, const Gaiji_Context* context, Gaiji_Width width); +void gaiji_stub_decode(char output[], int size, const char input[]); #endif /* GAIJI_H */ diff --git a/hooks.c b/hooks.c index 05f6523..49c0015 100644 --- a/hooks.c +++ b/hooks.c @@ -107,7 +107,7 @@ static EB_Error_Code hook_narrow_font( /* EB_HOOK_NARROW_FONT */ assert(argc > 0); char stub[MAX_STUB_BYTES]; - gaiji_build_stub(stub, ARRSIZE(stub), argv[0], container, GAIJI_WIDTH_NARROW); + gaiji_stub_encode(stub, ARRSIZE(stub), argv[0], container, GAIJI_WIDTH_NARROW); eb_write_text_string(book, stub); return 0; @@ -126,7 +126,7 @@ static EB_Error_Code hook_wide_font( /* EB_HOOK_WIDE_FONT */ assert(argc > 0); char stub[MAX_STUB_BYTES]; - gaiji_build_stub(stub, ARRSIZE(stub), argv[0], container, GAIJI_WIDTH_WIDE); + gaiji_stub_encode(stub, ARRSIZE(stub), argv[0], container, GAIJI_WIDTH_WIDE); eb_write_text_string(book, stub); return 0; diff --git a/main.c b/main.c index d485fab..da0a9dc 100644 --- a/main.c +++ b/main.c @@ -79,7 +79,7 @@ static void export_subbook(Subbook* subbook, EB_Book* eb_book, EB_Hookset* eb_ho char title[EB_MAX_TITLE_LENGTH + 1]; if (eb_subbook_title(eb_book, title) == EB_SUCCESS) { subbook->title = eucjp_to_utf8(title); - context = *gaiji_select_context(subbook->title); + context = *gaiji_context_select(subbook->title); } if (eb_have_copyright(eb_book)) { diff --git a/util.c b/util.c index 1d787fc..522ef5c 100644 --- a/util.c +++ b/util.c @@ -124,7 +124,7 @@ char* read_book_data(EB_Book* book, EB_Hookset* hookset, Gaiji_Context* context, return NULL; } - gaiji_fixup_stub(result, strlen(result) + 1, result); + gaiji_stub_decode(result, strlen(result) + 1, result); return result; }