Mercurial > cpython-lru_cache-weakref
diff Include/bytesobject.h @ 37960:e0b7e34b5971
Added much functionality to the bytes type.
Change file.readinto() to require binary mode.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 24 Apr 2006 13:47:05 +0000 |
| parents | a7f3765ea464 |
| children | a6a1359aab84 |
line wrap: on
line diff
--- a/Include/bytesobject.h Sun Apr 23 07:43:54 2006 +0000 +++ b/Include/bytesobject.h Mon Apr 24 13:47:05 2006 +0000 @@ -21,7 +21,7 @@ /* Object layout */ typedef struct { PyObject_VAR_HEAD - char *ob_sval; + char *ob_bytes; } PyBytesObject; /* Type object */ @@ -32,13 +32,14 @@ #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
