Move intbuf
This commit is contained in:
parent
04e65f3f5e
commit
e1a5f58d90
2 changed files with 5 additions and 4 deletions
|
|
@ -23,6 +23,8 @@ typedef union sj4kouhobuffer {
|
|||
|
||||
typedef struct sj4kouho {
|
||||
Sj4KouhoBuffer buffer;
|
||||
|
||||
unsigned char intbuf[SJ4BUFSZ];
|
||||
} Sj4Kouho;
|
||||
|
||||
typedef struct sj4lib Sj4Lib;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ struct sj4lib {
|
|||
int charset;
|
||||
|
||||
u_char inbuf[SJ4BUFSZ];
|
||||
u_char outbuf[SJ4BUFSZ];
|
||||
u_char wrkbuf[SJ4BUFSZ];
|
||||
u_char wrk2buf[SJ4BUFSZ];
|
||||
|
||||
|
|
@ -42,7 +41,7 @@ Sj4Lib* sj4_open(int charset, const char* dic) {
|
|||
#define RUNME(PROC) \
|
||||
PROC \
|
||||
\
|
||||
len2 = sj4_charset_to(ctx->charset, ctx->kouho->buffer.raw, ctx->outbuf + sizeof(STDYOUT), strlen(ctx->outbuf + sizeof(STDYOUT))); \
|
||||
len2 = sj4_charset_to(ctx->charset, ctx->kouho->buffer.raw, ctx->kouho->intbuf + sizeof(STDYOUT), strlen(ctx->kouho->intbuf + sizeof(STDYOUT))); \
|
||||
\
|
||||
memcpy(ctx->wrkbuf, ctx->inbuf, len); \
|
||||
len = sj4_charset_to(ctx->charset, ctx->wrk2buf, ctx->wrkbuf, len); \
|
||||
|
|
@ -70,7 +69,7 @@ int sj4_getkan(Sj4Lib* ctx, const void* input, int len, Sj4Kouho* kouho) {
|
|||
len = sj4_charset_from(ctx->charset, ctx->inbuf, input, len);
|
||||
|
||||
RUNME({
|
||||
len = cl2knj(ctx->ctx, ctx->inbuf, len, ctx->outbuf);
|
||||
len = cl2knj(ctx->ctx, ctx->inbuf, len, ctx->kouho->intbuf);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +77,7 @@ int sj4_nextkan(Sj4Lib* ctx) {
|
|||
int len, len2;
|
||||
|
||||
RUNME({
|
||||
len = nextcl(ctx->ctx, ctx->outbuf, 0);
|
||||
len = nextcl(ctx->ctx, ctx->kouho->intbuf, 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue