ok
This commit is contained in:
parent
e4f1486d16
commit
da26434f0e
4 changed files with 13 additions and 5 deletions
|
|
@ -49,6 +49,9 @@ endif()
|
|||
if(NOT SJ4_GLOBAL)
|
||||
sj4_library(sj4ime)
|
||||
target_link_libraries(sj4ime PUBLIC sj4lib)
|
||||
if(NOT SJ4_NO_UNICODE)
|
||||
target_compile_definitions(sj4ime PRIVATE UCS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SJ4_BUILD_TOOLS OR (NOT CMAKE_BINARY_DIR MATCHES CMAKE_CURRENT_SOURCE_DIR AND NOT SJ4_BUILD_ONLY_LIB))
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ int sj4_ime_length(Sj4Ime* ime);
|
|||
void* sj4_ime_kouho(Sj4Ime* ime);
|
||||
void* sj4_ime_kanabuf(Sj4Ime* ime);
|
||||
void* sj4_ime_convbuf(Sj4Ime* ime);
|
||||
void sj4_ime_close(Sj4Ime*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,13 +81,12 @@ static void concat(int charset, u_char* out, u_char* in) {
|
|||
|
||||
w_out[i + sj4_charset_to(charset, (u_char*)(w_out + i), in, strlen(in))] = 0;
|
||||
} else
|
||||
#else
|
||||
#endif
|
||||
{
|
||||
i = strlen(out);
|
||||
|
||||
out[i + sj4_charset_to(charset, out + i, in, strlen(in))] = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void concat_nc(int charset, u_char* out, u_char* in) {
|
||||
|
|
@ -103,7 +102,7 @@ static void concat_nc(int charset, u_char* out, u_char* in) {
|
|||
memcpy(w_out + i, in, j * sizeof(wchar_t));
|
||||
w_out[i + j] = 0;
|
||||
} else
|
||||
#else
|
||||
#endif
|
||||
{
|
||||
i = strlen(out);
|
||||
j = strlen(in);
|
||||
|
|
@ -111,7 +110,6 @@ static void concat_nc(int charset, u_char* out, u_char* in) {
|
|||
memcpy(out + i, in, j);
|
||||
out[i + j] = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define ZEROBUF memset(&ime->kouho.buffer, 0, sizeof(ime->kouho.buffer))
|
||||
|
|
@ -235,3 +233,8 @@ void* sj4_ime_kanabuf(Sj4Ime* ime) {
|
|||
void* sj4_ime_convbuf(Sj4Ime* ime) {
|
||||
return ime->convbuf;
|
||||
}
|
||||
|
||||
void sj4_ime_close(Sj4Ime* ime) {
|
||||
sj4_close(ime->lib);
|
||||
free(ime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ readchar() {
|
|||
}
|
||||
|
||||
if((cod = unicode_to_eucjp(n)) == -1) {
|
||||
code = n;
|
||||
return '[';
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +260,7 @@ int* readline() {
|
|||
c = skip_blank();
|
||||
|
||||
if(c == '#') {
|
||||
while(c != '\n')
|
||||
while(c != '\n' && c != EOF)
|
||||
c = skip_blank();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue