File: bytearrayobject.h

package info (click to toggle)
pypy3 7.0.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 111,848 kB
  • sloc: python: 1,291,746; ansic: 74,281; asm: 5,187; cpp: 3,017; sh: 2,533; makefile: 544; xml: 243; lisp: 45; csh: 21; awk: 4
file content (36 lines) | stat: -rw-r--r-- 949 bytes parent folder | download | duplicates (8)
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
34
35
36
/* ByteArray object interface */

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

#include <stdarg.h>

/* Type PyByteArrayObject represents a mutable array of bytes.
 * The Python API is that of a sequence;
 * the bytes are mapped to ints in [0, 256).
 * Bytes are not characters; they may be used to encode characters.
 * The only way to go between bytes and str/unicode is via encoding
 * and decoding.
 * While CPython exposes interfaces to this object, pypy does not
 */

#define PyByteArray_GET_SIZE(op) PyByteArray_Size((PyObject*)(op))
#define PyByteArray_AS_STRING(op) PyByteArray_AsString((PyObject*)(op))

/* Object layout */
typedef struct {
    PyObject_VAR_HEAD
#if 0
    int ob_exports; /* how many buffer exports */
    Py_ssize_t ob_alloc; /* How many bytes allocated */
    char *ob_bytes;
#endif
} PyByteArrayObject;

#ifdef __cplusplus
}
#endif
#endif /* !Py_BYTEARRAYOBJECT_H */