1use crate::object::*;
2use crate::Py_ssize_t;
3#[cfg(not(any(PyPy, Py_LIMITED_API)))]
4use std::os::raw::c_char;
5use std::os::raw::c_int;
6
7#[cfg(not(any(PyPy, Py_LIMITED_API)))]
8#[repr(C)]
9#[derive(Copy, Clone)]
10pub 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))]
17opaque_struct!(PyBytesObject);
18
19extern "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