File: bytearray.pxd

package info (click to toggle)
cython 3.1.6%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,932 kB
  • sloc: python: 92,172; ansic: 19,275; cpp: 1,407; xml: 1,031; javascript: 511; makefile: 373; sh: 223; sed: 11
file content (33 lines) | stat: -rw-r--r-- 1,453 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from .object cimport PyObject

cdef extern from "Python.h":
    bint PyByteArray_Check(object o)
    # Return true if the object o is a bytearray object or an instance of a subtype of the bytearray type.

    bint PyByteArray_CheckExact(object o)
    # Return true if the object o is a bytearray object, but not an instance of a subtype of the bytearray type.

    bytearray PyByteArray_FromObject(object o)
    # Return a new bytearray object from any object, o, that implements the buffer protocol.

    bytearray PyByteArray_FromStringAndSize(char *string, Py_ssize_t len)
    # Create a new bytearray object from string and its length, len. On failure, NULL is returned.

    bytearray PyByteArray_Concat(object a, object b)
    # Concat bytearrays a and b and return a new bytearray with the result.

    Py_ssize_t PyByteArray_Size(object bytearray)
    # Return the size of bytearray after checking for a NULL pointer.

    char* PyByteArray_AsString(object bytearray)
    # Return the contents of bytearray as a char array after checking for a NULL pointer.
    # The returned array always has an extra null byte appended.

    int PyByteArray_Resize(object bytearray, Py_ssize_t len) except -1
    # Resize the internal buffer of bytearray to len.

    char* PyByteArray_AS_STRING(object bytearray)
    # Macro version of PyByteArray_AsString().

    Py_ssize_t PyByteArray_GET_SIZE(object bytearray)
    # Macro version of PyByteArray_Size().