#ifndef Py_BUILD_CORE_BUILTIN
#define Py_BUILD_CORE_MODULE …
#endif
#include "Python.h"
#include "multibytecodec.h"
#include "clinic/multibytecodec.c.h"
#include <stddef.h>
#define MODULE_NAME …
module_state;
static module_state *
get_module_state(PyObject *module)
{ … }
static struct PyModuleDef _multibytecodecmodule;
static module_state *
find_state_by_def(PyTypeObject *type)
{ … }
#define clinic_get_state …
#undef clinic_get_state
MultibyteEncodeBuffer;
MultibyteDecodeBuffer;
static char *incnewkwarglist[] = …;
static char *streamkwarglist[] = …;
static PyObject *multibytecodec_encode(const MultibyteCodec *,
MultibyteCodec_State *, PyObject *, Py_ssize_t *,
PyObject *, int);
#define MBENC_RESET …
static PyObject *
make_tuple(PyObject *object, Py_ssize_t len)
{ … }
static PyObject *
internal_error_callback(const char *errors)
{ … }
static PyObject *
call_error_callback(PyObject *errors, PyObject *exc)
{ … }
static PyObject *
codecctx_errors_get(MultibyteStatefulCodecContext *self, void *Py_UNUSED(ignored))
{ … }
static int
codecctx_errors_set(MultibyteStatefulCodecContext *self, PyObject *value,
void *closure)
{ … }
static PyGetSetDef codecctx_getsets[] = …;
static int
expand_encodebuffer(MultibyteEncodeBuffer *buf, Py_ssize_t esize)
{ … }
#define REQUIRE_ENCODEBUFFER(buf, s) …
static int
multibytecodec_encerror(const MultibyteCodec *codec,
MultibyteCodec_State *state,
MultibyteEncodeBuffer *buf,
PyObject *errors, Py_ssize_t e)
{ … }
static int
multibytecodec_decerror(const MultibyteCodec *codec,
MultibyteCodec_State *state,
MultibyteDecodeBuffer *buf,
PyObject *errors, Py_ssize_t e)
{ … }
static PyObject *
multibytecodec_encode(const MultibyteCodec *codec,
MultibyteCodec_State *state,
PyObject *text, Py_ssize_t *inpos_t,
PyObject *errors, int flags)
{ … }
static PyObject *
_multibytecodec_MultibyteCodec_encode_impl(MultibyteCodecObject *self,
PyObject *input,
const char *errors)
{ … }
static PyObject *
_multibytecodec_MultibyteCodec_decode_impl(MultibyteCodecObject *self,
Py_buffer *input,
const char *errors)
{ … }
static struct PyMethodDef multibytecodec_methods[] = …;
static int
multibytecodec_clear(MultibyteCodecObject *self)
{ … }
static int
multibytecodec_traverse(MultibyteCodecObject *self, visitproc visit, void *arg)
{ … }
static void
multibytecodec_dealloc(MultibyteCodecObject *self)
{ … }
static PyType_Slot multibytecodec_slots[] = …;
static PyType_Spec multibytecodec_spec = …;
#define STATEFUL_DCTX(o) …
#define STATEFUL_ECTX(o) …
static PyObject *
encoder_encode_stateful(MultibyteStatefulEncoderContext *ctx,
PyObject *unistr, int final)
{ … }
static int
decoder_append_pending(MultibyteStatefulDecoderContext *ctx,
MultibyteDecodeBuffer *buf)
{ … }
static int
decoder_prepare_buffer(MultibyteDecodeBuffer *buf, const char *data,
Py_ssize_t size)
{ … }
static int
decoder_feed_buffer(MultibyteStatefulDecoderContext *ctx,
MultibyteDecodeBuffer *buf)
{ … }
static PyObject *
_multibytecodec_MultibyteIncrementalEncoder_encode_impl(MultibyteIncrementalEncoderObject *self,
PyObject *input,
int final)
{ … }
static PyObject *
_multibytecodec_MultibyteIncrementalEncoder_getstate_impl(MultibyteIncrementalEncoderObject *self)
{ … }
static PyObject *
_multibytecodec_MultibyteIncrementalEncoder_setstate_impl(MultibyteIncrementalEncoderObject *self,
PyLongObject *statelong)
{ … }
static PyObject *
_multibytecodec_MultibyteIncrementalEncoder_reset_impl(MultibyteIncrementalEncoderObject *self)
{ … }
static struct PyMethodDef mbiencoder_methods[] = …;
static PyObject *
mbiencoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
mbiencoder_init(PyObject *self, PyObject *args, PyObject *kwds)
{ … }
static int
mbiencoder_traverse(MultibyteIncrementalEncoderObject *self,
visitproc visit, void *arg)
{ … }
static void
mbiencoder_dealloc(MultibyteIncrementalEncoderObject *self)
{ … }
static PyType_Slot encoder_slots[] = …;
static PyType_Spec encoder_spec = …;
static PyObject *
_multibytecodec_MultibyteIncrementalDecoder_decode_impl(MultibyteIncrementalDecoderObject *self,
Py_buffer *input,
int final)
{ … }
static PyObject *
_multibytecodec_MultibyteIncrementalDecoder_getstate_impl(MultibyteIncrementalDecoderObject *self)
{ … }
static PyObject *
_multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDecoderObject *self,
PyObject *state)
{ … }
static PyObject *
_multibytecodec_MultibyteIncrementalDecoder_reset_impl(MultibyteIncrementalDecoderObject *self)
{ … }
static struct PyMethodDef mbidecoder_methods[] = …;
static PyObject *
mbidecoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
mbidecoder_init(PyObject *self, PyObject *args, PyObject *kwds)
{ … }
static int
mbidecoder_traverse(MultibyteIncrementalDecoderObject *self,
visitproc visit, void *arg)
{ … }
static void
mbidecoder_dealloc(MultibyteIncrementalDecoderObject *self)
{ … }
static PyType_Slot decoder_slots[] = …;
static PyType_Spec decoder_spec = …;
static PyObject *
mbstreamreader_iread(MultibyteStreamReaderObject *self,
const char *method, Py_ssize_t sizehint)
{ … }
static PyObject *
_multibytecodec_MultibyteStreamReader_read_impl(MultibyteStreamReaderObject *self,
PyObject *sizeobj)
{ … }
static PyObject *
_multibytecodec_MultibyteStreamReader_readline_impl(MultibyteStreamReaderObject *self,
PyObject *sizeobj)
{ … }
static PyObject *
_multibytecodec_MultibyteStreamReader_readlines_impl(MultibyteStreamReaderObject *self,
PyObject *sizehintobj)
{ … }
static PyObject *
_multibytecodec_MultibyteStreamReader_reset_impl(MultibyteStreamReaderObject *self)
{ … }
static struct PyMethodDef mbstreamreader_methods[] = …;
static PyMemberDef mbstreamreader_members[] = …;
static PyObject *
mbstreamreader_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
mbstreamreader_init(PyObject *self, PyObject *args, PyObject *kwds)
{ … }
static int
mbstreamreader_traverse(MultibyteStreamReaderObject *self,
visitproc visit, void *arg)
{ … }
static void
mbstreamreader_dealloc(MultibyteStreamReaderObject *self)
{ … }
static PyType_Slot reader_slots[] = …;
static PyType_Spec reader_spec = …;
static int
mbstreamwriter_iwrite(MultibyteStreamWriterObject *self,
PyObject *unistr, PyObject *str_write)
{ … }
static PyObject *
_multibytecodec_MultibyteStreamWriter_write_impl(MultibyteStreamWriterObject *self,
PyTypeObject *cls,
PyObject *strobj)
{ … }
static PyObject *
_multibytecodec_MultibyteStreamWriter_writelines_impl(MultibyteStreamWriterObject *self,
PyTypeObject *cls,
PyObject *lines)
{ … }
static PyObject *
_multibytecodec_MultibyteStreamWriter_reset_impl(MultibyteStreamWriterObject *self,
PyTypeObject *cls)
{ … }
static PyObject *
mbstreamwriter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
mbstreamwriter_init(PyObject *self, PyObject *args, PyObject *kwds)
{ … }
static int
mbstreamwriter_traverse(MultibyteStreamWriterObject *self,
visitproc visit, void *arg)
{ … }
static void
mbstreamwriter_dealloc(MultibyteStreamWriterObject *self)
{ … }
static struct PyMethodDef mbstreamwriter_methods[] = …;
static PyMemberDef mbstreamwriter_members[] = …;
static PyType_Slot writer_slots[] = …;
static PyType_Spec writer_spec = …;
static PyObject *
_multibytecodec___create_codec(PyObject *module, PyObject *arg)
{ … }
static int
_multibytecodec_traverse(PyObject *mod, visitproc visit, void *arg)
{ … }
static int
_multibytecodec_clear(PyObject *mod)
{ … }
static void
_multibytecodec_free(void *mod)
{ … }
#define CREATE_TYPE …
#define ADD_TYPE …
static int
_multibytecodec_exec(PyObject *mod)
{ … }
#undef CREATE_TYPE
#undef ADD_TYPE
static struct PyMethodDef _multibytecodec_methods[] = …;
static PyModuleDef_Slot _multibytecodec_slots[] = …;
static struct PyModuleDef _multibytecodecmodule = …;
PyMODINIT_FUNC
PyInit__multibytecodec(void)
{ … }