clean up ffi from pyframe to pyhash
This commit is contained in:
parent
e9cccd74bf
commit
19eb3138f2
|
@ -8,5 +8,4 @@ opaque_struct!(PyFrameObject);
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn PyFrame_GetLineNumber(f: *mut PyFrameObject) -> c_int;
|
pub fn PyFrame_GetLineNumber(f: *mut PyFrameObject) -> c_int;
|
||||||
}
|
}
|
||||||
// skipped PyFrame_GetLineNumber
|
|
||||||
// skipped PyFrame_GetCode
|
// skipped PyFrame_GetCode
|
||||||
|
|
|
@ -1,6 +1,26 @@
|
||||||
|
#[cfg(not(Py_LIMITED_API))]
|
||||||
use crate::ffi::pyport::{Py_hash_t, Py_ssize_t};
|
use crate::ffi::pyport::{Py_hash_t, Py_ssize_t};
|
||||||
use std::os::raw::{c_char, c_int, c_void};
|
#[cfg(not(Py_LIMITED_API))]
|
||||||
|
use std::os::raw::{c_char, c_void};
|
||||||
|
|
||||||
|
use std::os::raw::{c_int, c_ulong};
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
// skipped non-limited _Py_HashDouble
|
||||||
|
// skipped non-limited _Py_HashPointer
|
||||||
|
// skipped non-limited _Py_HashPointerRaw
|
||||||
|
|
||||||
|
#[cfg(not(any(Py_LIMITED_API, PyPy)))]
|
||||||
|
pub fn _Py_HashBytes(src: *const c_void, len: Py_ssize_t) -> Py_hash_t;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const _PyHASH_MULTIPLIER: c_ulong = 1000003;
|
||||||
|
|
||||||
|
// skipped _PyHASH_BITS
|
||||||
|
|
||||||
|
// skipped non-limited _Py_HashSecret_t
|
||||||
|
|
||||||
|
#[cfg(not(Py_LIMITED_API))]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct PyHash_FuncDef {
|
pub struct PyHash_FuncDef {
|
||||||
|
@ -10,6 +30,7 @@ pub struct PyHash_FuncDef {
|
||||||
pub seed_bits: c_int,
|
pub seed_bits: c_int,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(Py_LIMITED_API))]
|
||||||
impl Default for PyHash_FuncDef {
|
impl Default for PyHash_FuncDef {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
|
@ -18,7 +39,14 @@ impl Default for PyHash_FuncDef {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#[cfg(not(any(Py_LIMITED_API, PyPy)))]
|
||||||
pub fn PyHash_GetFuncDef() -> *mut PyHash_FuncDef;
|
pub fn PyHash_GetFuncDef() -> *mut PyHash_FuncDef;
|
||||||
#[cfg(not(PyPy))]
|
|
||||||
pub fn _Py_HashBytes(src: *const c_void, len: Py_ssize_t) -> Py_hash_t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// skipped Py_HASH_CUTOFF
|
||||||
|
|
||||||
|
pub const Py_HASH_EXTERNAL: c_int = 0;
|
||||||
|
pub const Py_HASH_SIPHASH24: c_int = 1;
|
||||||
|
pub const Py_HASH_FNV: c_int = 2;
|
||||||
|
|
||||||
|
// skipped Py_HASH_ALGORITHM
|
||||||
|
|
Loading…
Reference in New Issue