summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs/multibytecodec.h
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-04-27 13:02:43 (GMT)
committerGitHub <noreply@github.com>2023-04-27 13:02:43 (GMT)
commit8a0c7f1e402768c7e806e2472e0a493c1800851f (patch)
tree5a5662fd4567987b59ce628707c97cd6955d74ba /Modules/cjkcodecs/multibytecodec.h
parente9c777208f83b9a78fcef1eb3c56e209e739ffc1 (diff)
downloadcpython-8a0c7f1e402768c7e806e2472e0a493c1800851f.zip
cpython-8a0c7f1e402768c7e806e2472e0a493c1800851f.tar.gz
cpython-8a0c7f1e402768c7e806e2472e0a493c1800851f.tar.bz2
gh-103583: Isolate CJK codec modules (#103869)
Diffstat (limited to 'Modules/cjkcodecs/multibytecodec.h')
-rw-r--r--Modules/cjkcodecs/multibytecodec.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.h b/Modules/cjkcodecs/multibytecodec.h
index 327cb51..f593622 100644
--- a/Modules/cjkcodecs/multibytecodec.h
+++ b/Modules/cjkcodecs/multibytecodec.h
@@ -27,28 +27,31 @@ typedef struct {
unsigned char c[8];
} MultibyteCodec_State;
-typedef int (*mbcodec_init)(const void *config);
+struct _cjk_mod_state;
+struct _multibyte_codec;
+
+typedef int (*mbcodec_init)(const struct _multibyte_codec *codec);
typedef Py_ssize_t (*mbencode_func)(MultibyteCodec_State *state,
- const void *config,
+ const struct _multibyte_codec *codec,
int kind, const void *data,
Py_ssize_t *inpos, Py_ssize_t inlen,
unsigned char **outbuf, Py_ssize_t outleft,
int flags);
typedef int (*mbencodeinit_func)(MultibyteCodec_State *state,
- const void *config);
+ const struct _multibyte_codec *codec);
typedef Py_ssize_t (*mbencodereset_func)(MultibyteCodec_State *state,
- const void *config,
+ const struct _multibyte_codec *codec,
unsigned char **outbuf, Py_ssize_t outleft);
typedef Py_ssize_t (*mbdecode_func)(MultibyteCodec_State *state,
- const void *config,
+ const struct _multibyte_codec *codec,
const unsigned char **inbuf, Py_ssize_t inleft,
_PyUnicodeWriter *writer);
typedef int (*mbdecodeinit_func)(MultibyteCodec_State *state,
- const void *config);
+ const struct _multibyte_codec *codec);
typedef Py_ssize_t (*mbdecodereset_func)(MultibyteCodec_State *state,
- const void *config);
+ const struct _multibyte_codec *codec);
-typedef struct {
+typedef struct _multibyte_codec {
const char *encoding;
const void *config;
mbcodec_init codecinit;
@@ -58,6 +61,7 @@ typedef struct {
mbdecode_func decode;
mbdecodeinit_func decinit;
mbdecodereset_func decreset;
+ struct _cjk_mod_state *modstate;
} MultibyteCodec;
typedef struct {