Move more things sj4charset

This commit is contained in:
Nishi 2026-06-28 07:59:25 +09:00
commit a228b83a15
8 changed files with 315 additions and 39 deletions

View file

@ -5,6 +5,13 @@
#include <wchar.h>
enum SJ4CHARSET {
SJ4EUCJP = 0,
SJ4SJIS,
SJ4UTF8,
SJ4UTF16
};
int sj4_from_sjis(u_char* out, const u_char* in, int len);
int sj4_from_utf8(u_char* out, const u_char* in, int len);
int sj4_from_utf16(u_char* out, const u_char* in, int len);
@ -12,4 +19,7 @@ int sj4_to_sjis(u_char* out, const u_char* in, int len);
int sj4_to_utf8(u_char* out, const u_char* in, int len);
int sj4_to_utf16(u_char* out, const u_char* in, int len);
int sj4_charset_to(int type, void* output, const void* input, int len);
int sj4_charset_from(int type, void* output, const void* input, int len);
#endif

View file

@ -1,8 +1,6 @@
#ifndef __SJ4IME_H__
#define __SJ4IME_H__
#include <sj4lib.h>
#ifdef __cplusplus
extern "C" {
#endif

View file

@ -1,6 +1,7 @@
#ifndef __SJ4LIB_H__
#define __SJ4LIB_H__
#include <sj_charset.h>
#include <wchar.h>
/* increase this as needed... */
@ -26,13 +27,6 @@ typedef struct sj4kouho {
typedef struct sj4lib Sj4Lib;
enum SJ4CHARSET {
SJ4EUCJP = 0,
SJ4SJIS,
SJ4UTF8,
SJ4UTF16
};
Sj4Lib* sj4_open(int, const char*);
int sj4_getkan(Sj4Lib*, const void*, int len, Sj4Kouho*);
int sj4_nextkan(Sj4Lib*);