summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs/multibytecodec.h
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2006-03-04 16:08:19 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2006-03-04 16:08:19 (GMT)
commit4b96c1384e008218bdfeb9e271a094b1ab8484d3 (patch)
tree8ca29d17d54e6c671408e427279a7acc3082a4bf /Modules/cjkcodecs/multibytecodec.h
parentad9afcf213f5a69d1a43616cbd445126e8a7d6cb (diff)
downloadcpython-4b96c1384e008218bdfeb9e271a094b1ab8484d3.zip
cpython-4b96c1384e008218bdfeb9e271a094b1ab8484d3.tar.gz
cpython-4b96c1384e008218bdfeb9e271a094b1ab8484d3.tar.bz2
- Modernize code to use Py_ssize_t more intensively.
- Do some minor code clean-ups.
Diffstat (limited to 'Modules/cjkcodecs/multibytecodec.h')
-rw-r--r--Modules/cjkcodecs/multibytecodec.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.h b/Modules/cjkcodecs/multibytecodec.h
index 9435e0c..ec49c78 100644
--- a/Modules/cjkcodecs/multibytecodec.h
+++ b/Modules/cjkcodecs/multibytecodec.h
@@ -2,7 +2,6 @@
* multibytecodec.h: Common Multibyte Codec Implementation
*
* Written by Hye-Shik Chang <perky@FreeBSD.org>
- * $CJKCodecs: multibytecodec.h,v 1.7 2004/06/27 10:39:28 perky Exp $
*/
#ifndef _PYTHON_MULTIBYTECODEC_H_
@@ -32,23 +31,24 @@ typedef union {
} MultibyteCodec_State;
typedef int (*mbcodec_init)(const void *config);
-typedef int (*mbencode_func)(MultibyteCodec_State *state, const void *config,
- const Py_UNICODE **inbuf, size_t inleft,
- unsigned char **outbuf, size_t outleft,
- int flags);
+typedef Py_ssize_t (*mbencode_func)(MultibyteCodec_State *state,
+ const void *config,
+ const Py_UNICODE **inbuf, Py_ssize_t inleft,
+ unsigned char **outbuf, Py_ssize_t outleft,
+ int flags);
typedef int (*mbencodeinit_func)(MultibyteCodec_State *state,
const void *config);
-typedef int (*mbencodereset_func)(MultibyteCodec_State *state,
- const void *config,
- unsigned char **outbuf, size_t outleft);
-typedef int (*mbdecode_func)(MultibyteCodec_State *state,
- const void *config,
- const unsigned char **inbuf, size_t inleft,
- Py_UNICODE **outbuf, size_t outleft);
+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,
+ Py_UNICODE **outbuf, Py_ssize_t outleft);
typedef int (*mbdecodeinit_func)(MultibyteCodec_State *state,
const void *config);
-typedef int (*mbdecodereset_func)(MultibyteCodec_State *state,
- const void *config);
+typedef Py_ssize_t (*mbdecodereset_func)(MultibyteCodec_State *state,
+ const void *config);
typedef struct {
const char *encoding;
@@ -73,7 +73,7 @@ typedef struct {
MultibyteCodec *codec;
MultibyteCodec_State state;
unsigned char pending[MAXDECPENDING];
- int pendingsize;
+ Py_ssize_t pendingsize;
PyObject *stream, *errors;
} MultibyteStreamReaderObject;
@@ -83,7 +83,7 @@ typedef struct {
MultibyteCodec *codec;
MultibyteCodec_State state;
Py_UNICODE pending[MAXENCPENDING];
- int pendingsize;
+ Py_ssize_t pendingsize;
PyObject *stream, *errors;
} MultibyteStreamWriterObject;