| 1 | use crate::object::*; |
| 2 | use crate::pyport::Py_ssize_t; |
| 3 | use std::os::raw::{c_char, c_int}; |
| 4 | |
| 5 | unsafeextern "C" { |
| 6 | #[cfg_attr (PyPy, link_name = "PyPyErr_SetNone" )] |
| 7 | pub unsafefn PyErr_SetNone(arg1: *mut PyObject); |
| 8 | #[cfg_attr (PyPy, link_name = "PyPyErr_SetObject" )] |
| 9 | pub unsafefn PyErr_SetObject(arg1: *mut PyObject, arg2: *mut PyObject); |
| 10 | #[cfg_attr (PyPy, link_name = "PyPyErr_SetString" )] |
| 11 | pub unsafefn PyErr_SetString(exception: *mut PyObject, string: *const c_char); |
| 12 | #[cfg_attr (PyPy, link_name = "PyPyErr_Occurred" )] |
| 13 | pub unsafefn PyErr_Occurred() -> *mut PyObject; |
| 14 | #[cfg_attr (PyPy, link_name = "PyPyErr_Clear" )] |
| 15 | pub unsafefn PyErr_Clear(); |
| 16 | #[cfg_attr (Py_3_12, deprecated(note = "Use PyErr_GetRaisedException() instead." ))] |
| 17 | #[cfg_attr (PyPy, link_name = "PyPyErr_Fetch" )] |
| 18 | pub unsafefn PyErr_Fetch( |
| 19 | arg1: *mut *mut PyObject, |
| 20 | arg2: *mut *mut PyObject, |
| 21 | arg3: *mut *mut PyObject, |
| 22 | ); |
| 23 | #[cfg_attr (Py_3_12, deprecated(note = "Use PyErr_SetRaisedException() instead." ))] |
| 24 | #[cfg_attr (PyPy, link_name = "PyPyErr_Restore" )] |
| 25 | pub unsafefn PyErr_Restore(arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject); |
| 26 | #[cfg_attr (PyPy, link_name = "PyPyErr_GetExcInfo" )] |
| 27 | pub unsafefn PyErr_GetExcInfo( |
| 28 | arg1: *mut *mut PyObject, |
| 29 | arg2: *mut *mut PyObject, |
| 30 | arg3: *mut *mut PyObject, |
| 31 | ); |
| 32 | #[cfg_attr (PyPy, link_name = "PyPyErr_SetExcInfo" )] |
| 33 | pub unsafefn PyErr_SetExcInfo(arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject); |
| 34 | #[cfg_attr (PyPy, link_name = "PyPy_FatalError" )] |
| 35 | pub unsafefn Py_FatalError(message: *const c_char) -> !; |
| 36 | #[cfg_attr (PyPy, link_name = "PyPyErr_GivenExceptionMatches" )] |
| 37 | pub unsafefn PyErr_GivenExceptionMatches(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int; |
| 38 | #[cfg_attr (PyPy, link_name = "PyPyErr_ExceptionMatches" )] |
| 39 | pub unsafefn PyErr_ExceptionMatches(arg1: *mut PyObject) -> c_int; |
| 40 | #[cfg_attr ( |
| 41 | Py_3_12, |
| 42 | deprecated( |
| 43 | note = "Use PyErr_GetRaisedException() instead, to avoid any possible de-normalization." |
| 44 | ) |
| 45 | )] |
| 46 | #[cfg_attr (PyPy, link_name = "PyPyErr_NormalizeException" )] |
| 47 | pub unsafefn PyErr_NormalizeException( |
| 48 | arg1: *mut *mut PyObject, |
| 49 | arg2: *mut *mut PyObject, |
| 50 | arg3: *mut *mut PyObject, |
| 51 | ); |
| 52 | #[cfg (Py_3_12)] |
| 53 | pub fn PyErr_GetRaisedException() -> *mut PyObject; |
| 54 | #[cfg (Py_3_12)] |
| 55 | pub fn PyErr_SetRaisedException(exc: *mut PyObject); |
| 56 | #[cfg_attr (PyPy, link_name = "PyPyException_SetTraceback" )] |
| 57 | pub unsafefn PyException_SetTraceback(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int; |
| 58 | #[cfg_attr (PyPy, link_name = "PyPyException_GetTraceback" )] |
| 59 | pub unsafefn PyException_GetTraceback(arg1: *mut PyObject) -> *mut PyObject; |
| 60 | #[cfg_attr (PyPy, link_name = "PyPyException_GetCause" )] |
| 61 | pub unsafefn PyException_GetCause(arg1: *mut PyObject) -> *mut PyObject; |
| 62 | #[cfg_attr (PyPy, link_name = "PyPyException_SetCause" )] |
| 63 | pub unsafefn PyException_SetCause(arg1: *mut PyObject, arg2: *mut PyObject); |
| 64 | #[cfg_attr (PyPy, link_name = "PyPyException_GetContext" )] |
| 65 | pub unsafefn PyException_GetContext(arg1: *mut PyObject) -> *mut PyObject; |
| 66 | #[cfg_attr (PyPy, link_name = "PyPyException_SetContext" )] |
| 67 | pub unsafefn PyException_SetContext(arg1: *mut PyObject, arg2: *mut PyObject); |
| 68 | |
| 69 | #[cfg (PyPy)] |
| 70 | #[link_name = "PyPyExceptionInstance_Class" ] |
| 71 | pub fn PyExceptionInstance_Class(x: *mut PyObject) -> *mut PyObject; |
| 72 | } |
| 73 | |
| 74 | #[inline ] |
| 75 | pub unsafe fn PyExceptionClass_Check(x: *mut PyObject) -> c_int { |
| 76 | (PyType_Check(op:x) != 0 |
| 77 | && PyType_FastSubclass(t:x as *mut PyTypeObject, Py_TPFLAGS_BASE_EXC_SUBCLASS) != 0) |
| 78 | as c_int |
| 79 | } |
| 80 | |
| 81 | #[inline ] |
| 82 | pub unsafe fn PyExceptionInstance_Check(x: *mut PyObject) -> c_int { |
| 83 | PyType_FastSubclass(t:Py_TYPE(x), Py_TPFLAGS_BASE_EXC_SUBCLASS) |
| 84 | } |
| 85 | |
| 86 | #[inline ] |
| 87 | #[cfg (not(PyPy))] |
| 88 | pub unsafe fn PyExceptionInstance_Class(x: *mut PyObject) -> *mut PyObject { |
| 89 | Py_TYPE(ob:x) as *mut PyObject |
| 90 | } |
| 91 | |
| 92 | // ported from cpython exception.c (line 2096) |
| 93 | #[cfg (PyPy)] |
| 94 | pub unsafe fn PyUnicodeDecodeError_Create( |
| 95 | encoding: *const c_char, |
| 96 | object: *const c_char, |
| 97 | length: Py_ssize_t, |
| 98 | start: Py_ssize_t, |
| 99 | end: Py_ssize_t, |
| 100 | reason: *const c_char, |
| 101 | ) -> *mut PyObject { |
| 102 | crate::_PyObject_CallFunction_SizeT( |
| 103 | PyExc_UnicodeDecodeError, |
| 104 | c_str!("sy#nns" ).as_ptr(), |
| 105 | encoding, |
| 106 | object, |
| 107 | length, |
| 108 | start, |
| 109 | end, |
| 110 | reason, |
| 111 | ) |
| 112 | } |
| 113 | |
| 114 | #[cfg_attr (windows, link(name = "pythonXY" ))] |
| 115 | unsafeextern "C" { |
| 116 | #[cfg_attr (PyPy, link_name = "PyPyExc_BaseException" )] |
| 117 | pub unsafestatic mut PyExc_BaseException: *mut PyObject; |
| 118 | #[cfg (Py_3_11)] |
| 119 | #[cfg_attr (PyPy, link_name = "PyPyExc_BaseExceptionGroup" )] |
| 120 | pub static mut PyExc_BaseExceptionGroup: *mut PyObject; |
| 121 | #[cfg_attr (PyPy, link_name = "PyPyExc_Exception" )] |
| 122 | pub unsafestatic mut PyExc_Exception: *mut PyObject; |
| 123 | #[cfg_attr (PyPy, link_name = "PyPyExc_StopAsyncIteration" )] |
| 124 | pub unsafestatic mut PyExc_StopAsyncIteration: *mut PyObject; |
| 125 | |
| 126 | #[cfg_attr (PyPy, link_name = "PyPyExc_StopIteration" )] |
| 127 | pub unsafestatic mut PyExc_StopIteration: *mut PyObject; |
| 128 | #[cfg_attr (PyPy, link_name = "PyPyExc_GeneratorExit" )] |
| 129 | pub unsafestatic mut PyExc_GeneratorExit: *mut PyObject; |
| 130 | #[cfg_attr (PyPy, link_name = "PyPyExc_ArithmeticError" )] |
| 131 | pub unsafestatic mut PyExc_ArithmeticError: *mut PyObject; |
| 132 | #[cfg_attr (PyPy, link_name = "PyPyExc_LookupError" )] |
| 133 | pub unsafestatic mut PyExc_LookupError: *mut PyObject; |
| 134 | |
| 135 | #[cfg_attr (PyPy, link_name = "PyPyExc_AssertionError" )] |
| 136 | pub unsafestatic mut PyExc_AssertionError: *mut PyObject; |
| 137 | #[cfg_attr (PyPy, link_name = "PyPyExc_AttributeError" )] |
| 138 | pub unsafestatic mut PyExc_AttributeError: *mut PyObject; |
| 139 | #[cfg_attr (PyPy, link_name = "PyPyExc_BufferError" )] |
| 140 | pub unsafestatic mut PyExc_BufferError: *mut PyObject; |
| 141 | #[cfg_attr (PyPy, link_name = "PyPyExc_EOFError" )] |
| 142 | pub unsafestatic mut PyExc_EOFError: *mut PyObject; |
| 143 | #[cfg_attr (PyPy, link_name = "PyPyExc_FloatingPointError" )] |
| 144 | pub unsafestatic mut PyExc_FloatingPointError: *mut PyObject; |
| 145 | #[cfg_attr (PyPy, link_name = "PyPyExc_OSError" )] |
| 146 | pub unsafestatic mut PyExc_OSError: *mut PyObject; |
| 147 | #[cfg_attr (PyPy, link_name = "PyPyExc_ImportError" )] |
| 148 | pub unsafestatic mut PyExc_ImportError: *mut PyObject; |
| 149 | #[cfg_attr (PyPy, link_name = "PyPyExc_ModuleNotFoundError" )] |
| 150 | pub unsafestatic mut PyExc_ModuleNotFoundError: *mut PyObject; |
| 151 | #[cfg_attr (PyPy, link_name = "PyPyExc_IndexError" )] |
| 152 | pub unsafestatic mut PyExc_IndexError: *mut PyObject; |
| 153 | #[cfg_attr (PyPy, link_name = "PyPyExc_KeyError" )] |
| 154 | pub unsafestatic mut PyExc_KeyError: *mut PyObject; |
| 155 | #[cfg_attr (PyPy, link_name = "PyPyExc_KeyboardInterrupt" )] |
| 156 | pub unsafestatic mut PyExc_KeyboardInterrupt: *mut PyObject; |
| 157 | #[cfg_attr (PyPy, link_name = "PyPyExc_MemoryError" )] |
| 158 | pub unsafestatic mut PyExc_MemoryError: *mut PyObject; |
| 159 | #[cfg_attr (PyPy, link_name = "PyPyExc_NameError" )] |
| 160 | pub unsafestatic mut PyExc_NameError: *mut PyObject; |
| 161 | #[cfg_attr (PyPy, link_name = "PyPyExc_OverflowError" )] |
| 162 | pub unsafestatic mut PyExc_OverflowError: *mut PyObject; |
| 163 | #[cfg_attr (PyPy, link_name = "PyPyExc_RuntimeError" )] |
| 164 | pub unsafestatic mut PyExc_RuntimeError: *mut PyObject; |
| 165 | #[cfg_attr (PyPy, link_name = "PyPyExc_RecursionError" )] |
| 166 | pub unsafestatic mut PyExc_RecursionError: *mut PyObject; |
| 167 | #[cfg_attr (PyPy, link_name = "PyPyExc_NotImplementedError" )] |
| 168 | pub unsafestatic mut PyExc_NotImplementedError: *mut PyObject; |
| 169 | #[cfg_attr (PyPy, link_name = "PyPyExc_SyntaxError" )] |
| 170 | pub unsafestatic mut PyExc_SyntaxError: *mut PyObject; |
| 171 | #[cfg_attr (PyPy, link_name = "PyPyExc_IndentationError" )] |
| 172 | pub unsafestatic mut PyExc_IndentationError: *mut PyObject; |
| 173 | #[cfg_attr (PyPy, link_name = "PyPyExc_TabError" )] |
| 174 | pub unsafestatic mut PyExc_TabError: *mut PyObject; |
| 175 | #[cfg_attr (PyPy, link_name = "PyPyExc_ReferenceError" )] |
| 176 | pub unsafestatic mut PyExc_ReferenceError: *mut PyObject; |
| 177 | #[cfg_attr (PyPy, link_name = "PyPyExc_SystemError" )] |
| 178 | pub unsafestatic mut PyExc_SystemError: *mut PyObject; |
| 179 | #[cfg_attr (PyPy, link_name = "PyPyExc_SystemExit" )] |
| 180 | pub unsafestatic mut PyExc_SystemExit: *mut PyObject; |
| 181 | #[cfg_attr (PyPy, link_name = "PyPyExc_TypeError" )] |
| 182 | pub unsafestatic mut PyExc_TypeError: *mut PyObject; |
| 183 | #[cfg_attr (PyPy, link_name = "PyPyExc_UnboundLocalError" )] |
| 184 | pub unsafestatic mut PyExc_UnboundLocalError: *mut PyObject; |
| 185 | #[cfg_attr (PyPy, link_name = "PyPyExc_UnicodeError" )] |
| 186 | pub unsafestatic mut PyExc_UnicodeError: *mut PyObject; |
| 187 | #[cfg_attr (PyPy, link_name = "PyPyExc_UnicodeEncodeError" )] |
| 188 | pub unsafestatic mut PyExc_UnicodeEncodeError: *mut PyObject; |
| 189 | #[cfg_attr (PyPy, link_name = "PyPyExc_UnicodeDecodeError" )] |
| 190 | pub unsafestatic mut PyExc_UnicodeDecodeError: *mut PyObject; |
| 191 | #[cfg_attr (PyPy, link_name = "PyPyExc_UnicodeTranslateError" )] |
| 192 | pub unsafestatic mut PyExc_UnicodeTranslateError: *mut PyObject; |
| 193 | #[cfg_attr (PyPy, link_name = "PyPyExc_ValueError" )] |
| 194 | pub unsafestatic mut PyExc_ValueError: *mut PyObject; |
| 195 | #[cfg_attr (PyPy, link_name = "PyPyExc_ZeroDivisionError" )] |
| 196 | pub unsafestatic mut PyExc_ZeroDivisionError: *mut PyObject; |
| 197 | |
| 198 | #[cfg_attr (PyPy, link_name = "PyPyExc_BlockingIOError" )] |
| 199 | pub unsafestatic mut PyExc_BlockingIOError: *mut PyObject; |
| 200 | #[cfg_attr (PyPy, link_name = "PyPyExc_BrokenPipeError" )] |
| 201 | pub unsafestatic mut PyExc_BrokenPipeError: *mut PyObject; |
| 202 | #[cfg_attr (PyPy, link_name = "PyPyExc_ChildProcessError" )] |
| 203 | pub unsafestatic mut PyExc_ChildProcessError: *mut PyObject; |
| 204 | #[cfg_attr (PyPy, link_name = "PyPyExc_ConnectionError" )] |
| 205 | pub unsafestatic mut PyExc_ConnectionError: *mut PyObject; |
| 206 | #[cfg_attr (PyPy, link_name = "PyPyExc_ConnectionAbortedError" )] |
| 207 | pub unsafestatic mut PyExc_ConnectionAbortedError: *mut PyObject; |
| 208 | #[cfg_attr (PyPy, link_name = "PyPyExc_ConnectionRefusedError" )] |
| 209 | pub unsafestatic mut PyExc_ConnectionRefusedError: *mut PyObject; |
| 210 | #[cfg_attr (PyPy, link_name = "PyPyExc_ConnectionResetError" )] |
| 211 | pub unsafestatic mut PyExc_ConnectionResetError: *mut PyObject; |
| 212 | #[cfg_attr (PyPy, link_name = "PyPyExc_FileExistsError" )] |
| 213 | pub unsafestatic mut PyExc_FileExistsError: *mut PyObject; |
| 214 | #[cfg_attr (PyPy, link_name = "PyPyExc_FileNotFoundError" )] |
| 215 | pub unsafestatic mut PyExc_FileNotFoundError: *mut PyObject; |
| 216 | #[cfg_attr (PyPy, link_name = "PyPyExc_InterruptedError" )] |
| 217 | pub unsafestatic mut PyExc_InterruptedError: *mut PyObject; |
| 218 | #[cfg_attr (PyPy, link_name = "PyPyExc_IsADirectoryError" )] |
| 219 | pub unsafestatic mut PyExc_IsADirectoryError: *mut PyObject; |
| 220 | #[cfg_attr (PyPy, link_name = "PyPyExc_NotADirectoryError" )] |
| 221 | pub unsafestatic mut PyExc_NotADirectoryError: *mut PyObject; |
| 222 | #[cfg_attr (PyPy, link_name = "PyPyExc_PermissionError" )] |
| 223 | pub unsafestatic mut PyExc_PermissionError: *mut PyObject; |
| 224 | #[cfg_attr (PyPy, link_name = "PyPyExc_ProcessLookupError" )] |
| 225 | pub unsafestatic mut PyExc_ProcessLookupError: *mut PyObject; |
| 226 | #[cfg_attr (PyPy, link_name = "PyPyExc_TimeoutError" )] |
| 227 | pub unsafestatic mut PyExc_TimeoutError: *mut PyObject; |
| 228 | |
| 229 | #[cfg_attr (PyPy, link_name = "PyPyExc_OSError" )] |
| 230 | pub unsafestatic mut PyExc_EnvironmentError: *mut PyObject; |
| 231 | #[cfg_attr (PyPy, link_name = "PyPyExc_OSError" )] |
| 232 | pub unsafestatic mut PyExc_IOError: *mut PyObject; |
| 233 | #[cfg (windows)] |
| 234 | #[cfg_attr (PyPy, link_name = "PyPyExc_OSError" )] |
| 235 | pub static mut PyExc_WindowsError: *mut PyObject; |
| 236 | |
| 237 | pub unsafestatic mut PyExc_RecursionErrorInst: *mut PyObject; |
| 238 | |
| 239 | /* Predefined warning categories */ |
| 240 | #[cfg_attr (PyPy, link_name = "PyPyExc_Warning" )] |
| 241 | pub unsafestatic mut PyExc_Warning: *mut PyObject; |
| 242 | #[cfg_attr (PyPy, link_name = "PyPyExc_UserWarning" )] |
| 243 | pub unsafestatic mut PyExc_UserWarning: *mut PyObject; |
| 244 | #[cfg_attr (PyPy, link_name = "PyPyExc_DeprecationWarning" )] |
| 245 | pub unsafestatic mut PyExc_DeprecationWarning: *mut PyObject; |
| 246 | #[cfg_attr (PyPy, link_name = "PyPyExc_PendingDeprecationWarning" )] |
| 247 | pub unsafestatic mut PyExc_PendingDeprecationWarning: *mut PyObject; |
| 248 | #[cfg_attr (PyPy, link_name = "PyPyExc_SyntaxWarning" )] |
| 249 | pub unsafestatic mut PyExc_SyntaxWarning: *mut PyObject; |
| 250 | #[cfg_attr (PyPy, link_name = "PyPyExc_RuntimeWarning" )] |
| 251 | pub unsafestatic mut PyExc_RuntimeWarning: *mut PyObject; |
| 252 | #[cfg_attr (PyPy, link_name = "PyPyExc_FutureWarning" )] |
| 253 | pub unsafestatic mut PyExc_FutureWarning: *mut PyObject; |
| 254 | #[cfg_attr (PyPy, link_name = "PyPyExc_ImportWarning" )] |
| 255 | pub unsafestatic mut PyExc_ImportWarning: *mut PyObject; |
| 256 | #[cfg_attr (PyPy, link_name = "PyPyExc_UnicodeWarning" )] |
| 257 | pub unsafestatic mut PyExc_UnicodeWarning: *mut PyObject; |
| 258 | #[cfg_attr (PyPy, link_name = "PyPyExc_BytesWarning" )] |
| 259 | pub unsafestatic mut PyExc_BytesWarning: *mut PyObject; |
| 260 | #[cfg_attr (PyPy, link_name = "PyPyExc_ResourceWarning" )] |
| 261 | pub unsafestatic mut PyExc_ResourceWarning: *mut PyObject; |
| 262 | #[cfg (Py_3_10)] |
| 263 | #[cfg_attr (PyPy, link_name = "PyPyExc_EncodingWarning" )] |
| 264 | pub unsafestatic mut PyExc_EncodingWarning: *mut PyObject; |
| 265 | } |
| 266 | |
| 267 | unsafeextern "C" { |
| 268 | #[cfg_attr (PyPy, link_name = "PyPyErr_BadArgument" )] |
| 269 | pub unsafefn PyErr_BadArgument() -> c_int; |
| 270 | #[cfg_attr (PyPy, link_name = "PyPyErr_NoMemory" )] |
| 271 | pub unsafefn PyErr_NoMemory() -> *mut PyObject; |
| 272 | #[cfg_attr (PyPy, link_name = "PyPyErr_SetFromErrno" )] |
| 273 | pub unsafefn PyErr_SetFromErrno(arg1: *mut PyObject) -> *mut PyObject; |
| 274 | #[cfg_attr (PyPy, link_name = "PyPyErr_SetFromErrnoWithFilenameObject" )] |
| 275 | pub unsafefn PyErr_SetFromErrnoWithFilenameObject( |
| 276 | arg1: *mut PyObject, |
| 277 | arg2: *mut PyObject, |
| 278 | ) -> *mut PyObject; |
| 279 | pub unsafefn PyErr_SetFromErrnoWithFilenameObjects( |
| 280 | arg1: *mut PyObject, |
| 281 | arg2: *mut PyObject, |
| 282 | arg3: *mut PyObject, |
| 283 | ) -> *mut PyObject; |
| 284 | pub unsafefn PyErr_SetFromErrnoWithFilename( |
| 285 | exc: *mut PyObject, |
| 286 | filename: *const c_char, |
| 287 | ) -> *mut PyObject; |
| 288 | #[cfg_attr (PyPy, link_name = "PyPyErr_Format" )] |
| 289 | pub unsafefn PyErr_Format(exception: *mut PyObject, format: *const c_char, ...) -> *mut PyObject; |
| 290 | pub unsafefn PyErr_SetImportErrorSubclass( |
| 291 | arg1: *mut PyObject, |
| 292 | arg2: *mut PyObject, |
| 293 | arg3: *mut PyObject, |
| 294 | arg4: *mut PyObject, |
| 295 | ) -> *mut PyObject; |
| 296 | pub unsafefn PyErr_SetImportError( |
| 297 | arg1: *mut PyObject, |
| 298 | arg2: *mut PyObject, |
| 299 | arg3: *mut PyObject, |
| 300 | ) -> *mut PyObject; |
| 301 | #[cfg_attr (PyPy, link_name = "PyPyErr_BadInternalCall" )] |
| 302 | pub unsafefn PyErr_BadInternalCall(); |
| 303 | pub unsafefn _PyErr_BadInternalCall(filename: *const c_char, lineno: c_int); |
| 304 | #[cfg_attr (PyPy, link_name = "PyPyErr_NewException" )] |
| 305 | pub unsafefn PyErr_NewException( |
| 306 | name: *const c_char, |
| 307 | base: *mut PyObject, |
| 308 | dict: *mut PyObject, |
| 309 | ) -> *mut PyObject; |
| 310 | #[cfg_attr (PyPy, link_name = "PyPyErr_NewExceptionWithDoc" )] |
| 311 | pub unsafefn PyErr_NewExceptionWithDoc( |
| 312 | name: *const c_char, |
| 313 | doc: *const c_char, |
| 314 | base: *mut PyObject, |
| 315 | dict: *mut PyObject, |
| 316 | ) -> *mut PyObject; |
| 317 | #[cfg_attr (PyPy, link_name = "PyPyErr_WriteUnraisable" )] |
| 318 | pub unsafefn PyErr_WriteUnraisable(arg1: *mut PyObject); |
| 319 | #[cfg_attr (PyPy, link_name = "PyPyErr_CheckSignals" )] |
| 320 | pub unsafefn PyErr_CheckSignals() -> c_int; |
| 321 | #[cfg_attr (PyPy, link_name = "PyPyErr_SetInterrupt" )] |
| 322 | pub unsafefn PyErr_SetInterrupt(); |
| 323 | #[cfg (Py_3_10)] |
| 324 | #[cfg_attr (PyPy, link_name = "PyPyErr_SetInterruptEx" )] |
| 325 | pub unsafefn PyErr_SetInterruptEx(signum: c_int); |
| 326 | #[cfg_attr (PyPy, link_name = "PyPyErr_SyntaxLocation" )] |
| 327 | pub unsafefn PyErr_SyntaxLocation(filename: *const c_char, lineno: c_int); |
| 328 | #[cfg_attr (PyPy, link_name = "PyPyErr_SyntaxLocationEx" )] |
| 329 | pub unsafefn PyErr_SyntaxLocationEx(filename: *const c_char, lineno: c_int, col_offset: c_int); |
| 330 | #[cfg_attr (PyPy, link_name = "PyPyErr_ProgramText" )] |
| 331 | pub unsafefn PyErr_ProgramText(filename: *const c_char, lineno: c_int) -> *mut PyObject; |
| 332 | #[cfg (not(PyPy))] |
| 333 | pub unsafefn PyUnicodeDecodeError_Create( |
| 334 | encoding: *const c_char, |
| 335 | object: *const c_char, |
| 336 | length: Py_ssize_t, |
| 337 | start: Py_ssize_t, |
| 338 | end: Py_ssize_t, |
| 339 | reason: *const c_char, |
| 340 | ) -> *mut PyObject; |
| 341 | pub unsafefn PyUnicodeEncodeError_GetEncoding(arg1: *mut PyObject) -> *mut PyObject; |
| 342 | pub unsafefn PyUnicodeDecodeError_GetEncoding(arg1: *mut PyObject) -> *mut PyObject; |
| 343 | pub unsafefn PyUnicodeEncodeError_GetObject(arg1: *mut PyObject) -> *mut PyObject; |
| 344 | pub unsafefn PyUnicodeDecodeError_GetObject(arg1: *mut PyObject) -> *mut PyObject; |
| 345 | pub unsafefn PyUnicodeTranslateError_GetObject(arg1: *mut PyObject) -> *mut PyObject; |
| 346 | pub unsafefn PyUnicodeEncodeError_GetStart(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int; |
| 347 | pub unsafefn PyUnicodeDecodeError_GetStart(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int; |
| 348 | pub unsafefn PyUnicodeTranslateError_GetStart(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int; |
| 349 | pub unsafefn PyUnicodeEncodeError_SetStart(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int; |
| 350 | pub unsafefn PyUnicodeDecodeError_SetStart(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int; |
| 351 | pub unsafefn PyUnicodeTranslateError_SetStart(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int; |
| 352 | pub unsafefn PyUnicodeEncodeError_GetEnd(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int; |
| 353 | pub unsafefn PyUnicodeDecodeError_GetEnd(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int; |
| 354 | pub unsafefn PyUnicodeTranslateError_GetEnd(arg1: *mut PyObject, arg2: *mut Py_ssize_t) -> c_int; |
| 355 | pub unsafefn PyUnicodeEncodeError_SetEnd(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int; |
| 356 | pub unsafefn PyUnicodeDecodeError_SetEnd(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int; |
| 357 | pub unsafefn PyUnicodeTranslateError_SetEnd(arg1: *mut PyObject, arg2: Py_ssize_t) -> c_int; |
| 358 | pub unsafefn PyUnicodeEncodeError_GetReason(arg1: *mut PyObject) -> *mut PyObject; |
| 359 | pub unsafefn PyUnicodeDecodeError_GetReason(arg1: *mut PyObject) -> *mut PyObject; |
| 360 | pub unsafefn PyUnicodeTranslateError_GetReason(arg1: *mut PyObject) -> *mut PyObject; |
| 361 | pub unsafefn PyUnicodeEncodeError_SetReason(exc: *mut PyObject, reason: *const c_char) -> c_int; |
| 362 | pub unsafefn PyUnicodeDecodeError_SetReason(exc: *mut PyObject, reason: *const c_char) -> c_int; |
| 363 | pub unsafefn PyUnicodeTranslateError_SetReason(exc: *mut PyObject, reason: *const c_char) -> c_int; |
| 364 | } |
| 365 | |