Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-13 09:05:40

0001 #ifndef Py_INTERNAL_PYERRORS_H
0002 #define Py_INTERNAL_PYERRORS_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006 
0007 #ifndef Py_BUILD_CORE
0008 #  error "this header requires Py_BUILD_CORE define"
0009 #endif
0010 
0011 
0012 /* runtime lifecycle */
0013 
0014 extern PyStatus _PyErr_InitTypes(PyInterpreterState *);
0015 extern void _PyErr_FiniTypes(PyInterpreterState *);
0016 
0017 
0018 /* other API */
0019 
0020 static inline PyObject* _PyErr_Occurred(PyThreadState *tstate)
0021 {
0022     assert(tstate != NULL);
0023     if (tstate->current_exception == NULL) {
0024         return NULL;
0025     }
0026     return (PyObject *)Py_TYPE(tstate->current_exception);
0027 }
0028 
0029 static inline void _PyErr_ClearExcState(_PyErr_StackItem *exc_state)
0030 {
0031     Py_CLEAR(exc_state->exc_value);
0032 }
0033 
0034 PyAPI_FUNC(PyObject*) _PyErr_StackItemToExcInfoTuple(
0035     _PyErr_StackItem *err_info);
0036 
0037 PyAPI_FUNC(void) _PyErr_Fetch(
0038     PyThreadState *tstate,
0039     PyObject **type,
0040     PyObject **value,
0041     PyObject **traceback);
0042 
0043 extern PyObject *
0044 _PyErr_GetRaisedException(PyThreadState *tstate);
0045 
0046 PyAPI_FUNC(int) _PyErr_ExceptionMatches(
0047     PyThreadState *tstate,
0048     PyObject *exc);
0049 
0050 void
0051 _PyErr_SetRaisedException(PyThreadState *tstate, PyObject *exc);
0052 
0053 PyAPI_FUNC(void) _PyErr_Restore(
0054     PyThreadState *tstate,
0055     PyObject *type,
0056     PyObject *value,
0057     PyObject *traceback);
0058 
0059 PyAPI_FUNC(void) _PyErr_SetObject(
0060     PyThreadState *tstate,
0061     PyObject *type,
0062     PyObject *value);
0063 
0064 PyAPI_FUNC(void) _PyErr_ChainStackItem(
0065     _PyErr_StackItem *exc_info);
0066 
0067 PyAPI_FUNC(void) _PyErr_Clear(PyThreadState *tstate);
0068 
0069 PyAPI_FUNC(void) _PyErr_SetNone(PyThreadState *tstate, PyObject *exception);
0070 
0071 PyAPI_FUNC(PyObject *) _PyErr_NoMemory(PyThreadState *tstate);
0072 
0073 PyAPI_FUNC(void) _PyErr_SetString(
0074     PyThreadState *tstate,
0075     PyObject *exception,
0076     const char *string);
0077 
0078 /*
0079  * Set an exception with the error message decoded from the current locale
0080  * encoding (LC_CTYPE).
0081  *
0082  * Exceptions occurring in decoding take priority over the desired exception.
0083  *
0084  * Exported for '_ctypes' shared extensions.
0085  */
0086 PyAPI_FUNC(void) _PyErr_SetLocaleString(
0087     PyObject *exception,
0088     const char *string);
0089 
0090 PyAPI_FUNC(PyObject *) _PyErr_Format(
0091     PyThreadState *tstate,
0092     PyObject *exception,
0093     const char *format,
0094     ...);
0095 
0096 PyAPI_FUNC(void) _PyErr_NormalizeException(
0097     PyThreadState *tstate,
0098     PyObject **exc,
0099     PyObject **val,
0100     PyObject **tb);
0101 
0102 PyAPI_FUNC(PyObject *) _PyErr_FormatFromCauseTstate(
0103     PyThreadState *tstate,
0104     PyObject *exception,
0105     const char *format,
0106     ...);
0107 
0108 PyAPI_FUNC(PyObject *) _PyExc_CreateExceptionGroup(
0109     const char *msg,
0110     PyObject *excs);
0111 
0112 PyAPI_FUNC(PyObject *) _PyExc_PrepReraiseStar(
0113     PyObject *orig,
0114     PyObject *excs);
0115 
0116 PyAPI_FUNC(int) _PyErr_CheckSignalsTstate(PyThreadState *tstate);
0117 
0118 PyAPI_FUNC(void) _Py_DumpExtensionModules(int fd, PyInterpreterState *interp);
0119 
0120 extern PyObject* _Py_Offer_Suggestions(PyObject* exception);
0121 PyAPI_FUNC(Py_ssize_t) _Py_UTF8_Edit_Cost(PyObject *str_a, PyObject *str_b,
0122                                           Py_ssize_t max_cost);
0123 
0124 void _PyErr_FormatNote(const char *format, ...);
0125 
0126 #ifdef __cplusplus
0127 }
0128 #endif
0129 #endif /* !Py_INTERNAL_PYERRORS_H */