(o: *mut PyObject)
| 504 | |
| 505 | #[cfg(not(Py_LIMITED_API))] |
| 506 | pub unsafe fn PyUnicode_DATA(o: *mut PyObject) -> *mut c_void { |
| 507 | debug_assert!(PyUnicode_Check(o) > 0); |
| 508 | #[cfg(not(Py_3_12))] |
| 509 | debug_assert!(PyUnicode_IS_READY(o)); |
| 510 | if PyUnicode_IS_COMPACT(o) { |
| 511 | // fn _PyUnicode_COMPACT_DATA |
| 512 | if PyUnicode_IS_ASCII(o) { |
| 513 | (o as *mut PyASCIIObject).offset(1) as *mut c_void |
| 514 | } else { |
| 515 | (o as *mut PyCompactUnicodeObject).offset(1) as *mut c_void |
| 516 | } |
| 517 | } else { |
| 518 | // fn _PyUnicode_NONCOMPACT_DATA |
| 519 | let data = (*(o as *mut PyUnicodeObject)).data; |
| 520 | debug_assert!(!data.is_null()); |
| 521 | data |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | #[cfg(not(Py_LIMITED_API))] |
| 526 | #[inline] |
no test coverage detected