1#ifndef Py_WARNINGS_H
2#define Py_WARNINGS_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7#ifndef Py_LIMITED_API
8PyAPI_FUNC(PyObject*) _PyWarnings_Init(void);
9#endif
10
11PyAPI_FUNC(int) PyErr_WarnEx(
12 PyObject *category,
13 const char *message, /* UTF-8 encoded string */
14 Py_ssize_t stack_level);
15PyAPI_FUNC(int) PyErr_WarnFormat(
16 PyObject *category,
17 Py_ssize_t stack_level,
18 const char *format, /* ASCII-encoded string */
19 ...);
20
21#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
22/* Emit a ResourceWarning warning */
23PyAPI_FUNC(int) PyErr_ResourceWarning(
24 PyObject *source,
25 Py_ssize_t stack_level,
26 const char *format, /* ASCII-encoded string */
27 ...);
28#endif
29#ifndef Py_LIMITED_API
30PyAPI_FUNC(int) PyErr_WarnExplicitObject(
31 PyObject *category,
32 PyObject *message,
33 PyObject *filename,
34 int lineno,
35 PyObject *module,
36 PyObject *registry);
37#endif
38PyAPI_FUNC(int) PyErr_WarnExplicit(
39 PyObject *category,
40 const char *message, /* UTF-8 encoded string */
41 const char *filename, /* decoded from the filesystem encoding */
42 int lineno,
43 const char *module, /* UTF-8 encoded string */
44 PyObject *registry);
45
46#ifndef Py_LIMITED_API
47PyAPI_FUNC(int)
48PyErr_WarnExplicitFormat(PyObject *category,
49 const char *filename, int lineno,
50 const char *module, PyObject *registry,
51 const char *format, ...);
52#endif
53
54/* DEPRECATED: Use PyErr_WarnEx() instead. */
55#ifndef Py_LIMITED_API
56#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
57#endif
58
59#ifndef Py_LIMITED_API
60void _PyErr_WarnUnawaitedCoroutine(PyObject *coro);
61#endif
62
63#ifdef __cplusplus
64}
65#endif
66#endif /* !Py_WARNINGS_H */
67
68