Download cpython_2/environment/repo/Modules/cjkcodecs/multibytecodec.h from lolbench26/LoLBench: direct link, hf CLI and curl.
- Browser
- Download file 4.56 kB
-
https://huggingface.co/datasets/lolbench26/LoLBench/resolve/main/cpython_2/environment/repo/Modules/cjkcodecs/multibytecodec.h
- Command line
-
hf download hf://datasets/lolbench26/LoLBench/cpython_2/environment/repo/Modules/cjkcodecs/multibytecodec.h
-
curl -L -o multibytecodec.h https://huggingface.co/datasets/lolbench26/LoLBench/resolve/main/cpython_2/environment/repo/Modules/cjkcodecs/multibytecodec.h
4.56 kB
| /* | |
| * multibytecodec.h: Common Multibyte Codec Implementation | |
| * | |
| * Written by Hye-Shik Chang <perky@FreeBSD.org> | |
| */ | |
| extern "C" { | |
| typedef uint16_t ucs2_t, DBCHAR; | |
| typedef unsigned short ucs2_t, DBCHAR; | |
| /* | |
| * A struct that provides 8 bytes of state for multibyte | |
| * codecs. Codecs are free to use this how they want. Note: if you | |
| * need to add a new field to this struct, ensure that its byte order | |
| * is independent of CPU endianness so that the return value of | |
| * getstate doesn't differ between little and big endian CPUs. | |
| */ | |
| typedef struct { | |
| unsigned char c[8]; | |
| } MultibyteCodec_State; | |
| typedef int (*mbcodec_init)(const void *config); | |
| typedef Py_ssize_t (*mbencode_func)(MultibyteCodec_State *state, | |
| const void *config, | |
| 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); | |
| typedef Py_ssize_t (*mbencodereset_func)(MultibyteCodec_State *state, | |
| const void *config, | |
| unsigned char **outbuf, Py_ssize_t outleft); | |
| typedef Py_ssize_t (*mbdecode_func)(MultibyteCodec_State *state, | |
| const void *config, | |
| const unsigned char **inbuf, Py_ssize_t inleft, | |
| _PyUnicodeWriter *writer); | |
| typedef int (*mbdecodeinit_func)(MultibyteCodec_State *state, | |
| const void *config); | |
| typedef Py_ssize_t (*mbdecodereset_func)(MultibyteCodec_State *state, | |
| const void *config); | |
| typedef struct { | |
| const char *encoding; | |
| const void *config; | |
| mbcodec_init codecinit; | |
| mbencode_func encode; | |
| mbencodeinit_func encinit; | |
| mbencodereset_func encreset; | |
| mbdecode_func decode; | |
| mbdecodeinit_func decinit; | |
| mbdecodereset_func decreset; | |
| } MultibyteCodec; | |
| typedef struct { | |
| PyObject_HEAD | |
| MultibyteCodec *codec; | |
| } MultibyteCodecObject; | |
| typedef struct { | |
| _MultibyteStatefulCodec_HEAD | |
| } MultibyteStatefulCodecContext; | |
| typedef struct { | |
| _MultibyteStatefulEncoder_HEAD | |
| } MultibyteStatefulEncoderContext; | |
| typedef struct { | |
| _MultibyteStatefulDecoder_HEAD | |
| } MultibyteStatefulDecoderContext; | |
| typedef struct { | |
| _MultibyteStatefulEncoder_HEAD | |
| } MultibyteIncrementalEncoderObject; | |
| typedef struct { | |
| _MultibyteStatefulDecoder_HEAD | |
| } MultibyteIncrementalDecoderObject; | |
| typedef struct { | |
| _MultibyteStatefulDecoder_HEAD | |
| PyObject *stream; | |
| } MultibyteStreamReaderObject; | |
| typedef struct { | |
| _MultibyteStatefulEncoder_HEAD | |
| PyObject *stream; | |
| } MultibyteStreamWriterObject; | |
| /* positive values for illegal sequences */ | |
| } | |