summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-04-24 13:47:05 (GMT)
committerGuido van Rossum <guido@python.org>2006-04-24 13:47:05 (GMT)
commitd624f18a2167daeabc85c1fef7e71dbc93daf5b5 (patch)
tree32be0f71bf46f0b459adc6f21f464dbf43a96ded /Include
parente06b6b8ff5a380f5e107f2d28f23853bfe20021e (diff)
downloadcpython-d624f18a2167daeabc85c1fef7e71dbc93daf5b5.zip
cpython-d624f18a2167daeabc85c1fef7e71dbc93daf5b5.tar.gz
cpython-d624f18a2167daeabc85c1fef7e71dbc93daf5b5.tar.bz2
Added much functionality to the bytes type.
Change file.readinto() to require binary mode.
Diffstat (limited to 'Include')
-rw-r--r--Include/bytesobject.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/bytesobject.h b/Include/bytesobject.h
index 9c11624..72ca076 100644
--- a/Include/bytesobject.h
+++ b/Include/bytesobject.h
@@ -21,7 +21,7 @@ extern "C" {
/* Object layout */
typedef struct {
PyObject_VAR_HEAD
- char *ob_sval;
+ char *ob_bytes;
} PyBytesObject;
/* Type object */
@@ -32,13 +32,14 @@ PyAPI_DATA(PyTypeObject) PyBytes_Type;
#define PyBytes_CheckExact(self) ((self)->ob_type == &PyBytes_Type)
/* Direct API functions */
+PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *);
PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t);
PyAPI_FUNC(Py_ssize_t) PyBytes_Size(PyObject *);
PyAPI_FUNC(char *) PyBytes_AsString(PyObject *);
PyAPI_FUNC(int) PyBytes_Resize(PyObject *, Py_ssize_t);
/* Macros, trading safety for speed */
-#define PyBytes_AS_STRING(self) (((PyBytesObject *)(self))->ob_sval)
+#define PyBytes_AS_STRING(self) (((PyBytesObject *)(self))->ob_bytes)
#define PyBytes_GET_SIZE(self) (((PyBytesObject *)(self))->ob_size)
#ifdef __cplusplus