python3_sys/
pyhash.rs

1use libc::{c_char, c_int, c_void};
2
3use crate::pyport::{Py_hash_t, Py_ssize_t};
4
5#[repr(C)]
6#[derive(Copy)]
7pub struct PyHash_FuncDef {
8    pub hash: Option<extern "C" fn(arg1: *const c_void, arg2: Py_ssize_t) -> Py_hash_t>,
9    pub name: *const c_char,
10    pub hash_bits: c_int,
11    pub seed_bits: c_int,
12}
13impl Clone for PyHash_FuncDef {
14    #[inline]
15    fn clone(&self) -> Self {
16        *self
17    }
18}
19impl Default for PyHash_FuncDef {
20    #[inline]
21    fn default() -> Self {
22        unsafe { ::core::mem::zeroed() }
23    }
24}
25
26#[cfg_attr(windows, link(name = "pythonXY"))]
27extern "C" {
28    pub fn PyHash_GetFuncDef() -> *mut PyHash_FuncDef;
29}