| 1 | #[cfg(not(any(Py_LIMITED_API, PyPy)))] |
| 2 | use crate::pyport::{Py_hash_t, Py_ssize_t}; |
| 3 | #[cfg(not(any(Py_LIMITED_API, PyPy)))] |
| 4 | use std::ffi::c_void; |
| 5 | |
| 6 | use std::ffi::{c_int, c_ulong}; |
| 7 | |
| 8 | extern "C" { |
| 9 | // skipped non-limited _Py_HashDouble |
| 10 | // skipped non-limited _Py_HashPointer |
| 11 | // skipped non-limited _Py_HashPointerRaw |
| 12 | |
| 13 | #[cfg(not(any(Py_LIMITED_API, PyPy)))] |
| 14 | pub fn _Py_HashBytes(src: *const c_void, len: Py_ssize_t) -> Py_hash_t; |
| 15 | } |
| 16 | |
| 17 | pub const _PyHASH_MULTIPLIER: c_ulong = 1000003; |
| 18 | |
| 19 | // skipped _PyHASH_BITS |
| 20 | |
| 21 | // skipped non-limited _Py_HashSecret_t |
| 22 | |
| 23 | // skipped Py_HASH_CUTOFF |
| 24 | |
| 25 | pub const Py_HASH_EXTERNAL: c_int = 0; |
| 26 | pub const Py_HASH_SIPHASH24: c_int = 1; |
| 27 | pub const Py_HASH_FNV: c_int = 2; |
| 28 | |
| 29 | // skipped Py_HASH_ALGORITHM |