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