python27_sys/
marshal.rs

1use libc::{c_char, c_int, c_long, FILE};
2
3use crate::object::PyObject;
4use crate::pyport::Py_ssize_t;
5
6// 1 -> 2 in df88846ebca9186514e86bc2067242233ade4608 (Python 2.5)
7pub const Py_MARSHAL_VERSION: c_int = 2;
8
9#[cfg_attr(windows, link(name = "pythonXY"))]
10extern "C" {
11    pub fn PyMarshal_WriteLongToFile(arg1: c_long, arg2: *mut FILE, arg3: c_int);
12    pub fn PyMarshal_WriteObjectToFile(arg1: *mut PyObject, arg2: *mut FILE, arg3: c_int);
13    pub fn PyMarshal_WriteObjectToString(arg1: *mut PyObject, arg2: c_int) -> *mut PyObject;
14    pub fn PyMarshal_ReadObjectFromString(arg1: *const c_char, arg2: Py_ssize_t) -> *mut PyObject;
15}
16
17#[cfg(not(Py_LIMITED_API))]
18#[cfg_attr(windows, link(name = "pythonXY"))]
19extern "C" {
20    pub fn PyMarshal_ReadLongFromFile(arg1: *mut FILE) -> c_long;
21    pub fn PyMarshal_ReadShortFromFile(arg1: *mut FILE) -> c_int;
22    pub fn PyMarshal_ReadObjectFromFile(arg1: *mut FILE) -> *mut PyObject;
23    pub fn PyMarshal_ReadLastObjectFromFile(arg1: *mut FILE) -> *mut PyObject;
24}