cpython/Modules/cjkcodecs/multibytecodec.h

/*
 * multibytecodec.h: Common Multibyte Codec Implementation
 *
 * Written by Hye-Shik Chang <[email protected]>
 */

#ifndef _PYTHON_MULTIBYTECODEC_H_
#define _PYTHON_MULTIBYTECODEC_H_
#ifdef __cplusplus
extern "C" {
#endif

#include "pycore_unicodeobject.h" // _PyUnicodeWriter

#ifdef uint16_t
typedef uint16_t ucs2_t, DBCHAR;
#else
DBCHAR;
#endif

/*
 * 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.
 */
MultibyteCodec_State;

struct _cjk_mod_state;
struct _multibyte_codec;

mbcodec_init;
mbencode_func;
mbencodeinit_func;
mbencodereset_func;
mbdecode_func;
mbdecodeinit_func;
mbdecodereset_func;

MultibyteCodec;

MultibyteCodecObject;

#define MultibyteCodec_Check(state, op)

#define _MultibyteStatefulCodec_HEAD
MultibyteStatefulCodecContext;

#define MAXENCPENDING
#define _MultibyteStatefulEncoder_HEAD
MultibyteStatefulEncoderContext;

#define MAXDECPENDING
#define _MultibyteStatefulDecoder_HEAD
MultibyteStatefulDecoderContext;

MultibyteIncrementalEncoderObject;

MultibyteIncrementalDecoderObject;

MultibyteStreamReaderObject;

MultibyteStreamWriterObject;

/* positive values for illegal sequences */
#define MBERR_TOOSMALL
#define MBERR_TOOFEW
#define MBERR_INTERNAL
#define MBERR_EXCEPTION

#define ERROR_STRICT
#define ERROR_IGNORE
#define ERROR_REPLACE
#define ERROR_ISCUSTOM(p)
#define ERROR_DECREF(p)

#define MBENC_FLUSH
#define MBENC_MAX

codec_capsule;

#define MAP_CAPSULE
#define CODEC_CAPSULE


#ifdef __cplusplus
}
#endif
#endif