1 | use crate::object::*; |
2 | use crate::Py_ssize_t; |
3 | #[cfg (not(any(PyPy, Py_LIMITED_API)))] |
4 | use std::os::raw::c_char; |
5 | use std::os::raw::c_int; |
6 | |
7 | #[cfg (not(any(PyPy, Py_LIMITED_API)))] |
8 | #[repr (C)] |
9 | #[derive (Copy, Clone)] |
10 | pub struct PyBytesObject { |
11 | pub ob_base: PyVarObject, |
12 | pub ob_shash: crate::Py_hash_t, |
13 | pub ob_sval: [c_char; 1], |
14 | } |
15 | |
16 | #[cfg (any(PyPy, Py_LIMITED_API))] |
17 | opaque_struct!(PyBytesObject); |
18 | |
19 | extern "C" { |
20 | #[cfg_attr (PyPy, link_name = "_PyPyBytes_Resize" )] |
21 | pub fn _PyBytes_Resize(bytes: *mut *mut PyObject, newsize: Py_ssize_t) -> c_int; |
22 | } |
23 | |