1 | use crate::object::*; |
2 | use crate::pyport::Py_ssize_t; |
3 | use std::os::raw::c_int; |
4 | |
5 | opaque_struct!(PyDictKeysObject); |
6 | |
7 | #[cfg (Py_3_11)] |
8 | opaque_struct!(PyDictValues); |
9 | |
10 | #[repr (C)] |
11 | #[derive (Debug)] |
12 | pub struct PyDictObject { |
13 | pub ob_base: PyObject, |
14 | pub ma_used: Py_ssize_t, |
15 | pub ma_version_tag: u64, |
16 | pub ma_keys: *mut PyDictKeysObject, |
17 | #[cfg (not(Py_3_11))] |
18 | pub ma_values: *mut *mut PyObject, |
19 | #[cfg (Py_3_11)] |
20 | pub ma_values: *mut PyDictValues, |
21 | } |
22 | |
23 | extern "C" { |
24 | // skipped _PyDict_GetItem_KnownHash |
25 | // skipped _PyDict_GetItemIdWithError |
26 | // skipped _PyDict_GetItemStringWithError |
27 | // skipped PyDict_SetDefault |
28 | pub fn _PyDict_SetItem_KnownHash( |
29 | mp: *mut PyObject, |
30 | key: *mut PyObject, |
31 | item: *mut PyObject, |
32 | hash: crate::Py_hash_t, |
33 | ) -> c_int; |
34 | // skipped _PyDict_DelItem_KnownHash |
35 | // skipped _PyDict_DelItemIf |
36 | // skipped _PyDict_NewKeysForClass |
37 | pub fn _PyDict_Next( |
38 | mp: *mut PyObject, |
39 | pos: *mut Py_ssize_t, |
40 | key: *mut *mut PyObject, |
41 | value: *mut *mut PyObject, |
42 | hash: *mut crate::Py_hash_t, |
43 | ) -> c_int; |
44 | // skipped PyDict_GET_SIZE |
45 | // skipped _PyDict_ContainsId |
46 | pub fn _PyDict_NewPresized(minused: Py_ssize_t) -> *mut PyObject; |
47 | // skipped _PyDict_MaybeUntrack |
48 | // skipped _PyDict_HasOnlyStringKeys |
49 | // skipped _PyDict_KeysSize |
50 | // skipped _PyDict_SizeOf |
51 | // skipped _PyDict_Pop |
52 | // skipped _PyDict_Pop_KnownHash |
53 | // skipped _PyDict_FromKeys |
54 | // skipped _PyDict_HasSplitTable |
55 | // skipped _PyDict_MergeEx |
56 | // skipped _PyDict_SetItemId |
57 | // skipped _PyDict_DelItemId |
58 | // skipped _PyDict_DebugMallocStats |
59 | // skipped _PyObjectDict_SetItem |
60 | // skipped _PyDict_LoadGlobal |
61 | // skipped _PyDict_GetItemHint |
62 | // skipped _PyDictViewObject |
63 | // skipped _PyDictView_New |
64 | // skipped _PyDictView_Intersect |
65 | |
66 | #[cfg (Py_3_10)] |
67 | pub fn _PyDict_Contains_KnownHash( |
68 | op: *mut PyObject, |
69 | key: *mut PyObject, |
70 | hash: crate::Py_hash_t, |
71 | ) -> c_int; |
72 | |
73 | #[cfg (not(Py_3_10))] |
74 | pub fn _PyDict_Contains(mp: *mut PyObject, key: *mut PyObject, hash: Py_ssize_t) -> c_int; |
75 | } |
76 | |