Christian Heimes | 33fe809 | 2008-04-13 13:53:33 +0000 | [diff] [blame] | 1 | #ifndef Py_WARNINGS_H |
| 2 | #define Py_WARNINGS_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 7 | #ifndef Py_LIMITED_API |
Martin v. Löwis | 1a21451 | 2008-06-11 05:26:20 +0000 | [diff] [blame] | 8 | PyAPI_FUNC(PyObject*) _PyWarnings_Init(void); |
Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 9 | #endif |
Christian Heimes | 33fe809 | 2008-04-13 13:53:33 +0000 | [diff] [blame] | 10 | |
Victor Stinner | 555a24f | 2010-12-27 01:49:26 +0000 | [diff] [blame] | 11 | PyAPI_FUNC(int) PyErr_WarnEx( |
| 12 | PyObject *category, |
| 13 | const char *message, /* UTF-8 encoded string */ |
| 14 | Py_ssize_t stack_level); |
| 15 | PyAPI_FUNC(int) PyErr_WarnFormat( |
| 16 | PyObject *category, |
| 17 | Py_ssize_t stack_level, |
| 18 | const char *format, /* ASCII-encoded string */ |
| 19 | ...); |
Victor Stinner | 914cde8 | 2016-03-19 01:03:51 +0100 | [diff] [blame] | 20 | |
Serhiy Storchaka | 34d0ac8 | 2016-12-27 14:57:39 +0200 | [diff] [blame] | 21 | #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000 |
Victor Stinner | 914cde8 | 2016-03-19 01:03:51 +0100 | [diff] [blame] | 22 | /* Emit a ResourceWarning warning */ |
| 23 | PyAPI_FUNC(int) PyErr_ResourceWarning( |
| 24 | PyObject *source, |
| 25 | Py_ssize_t stack_level, |
| 26 | const char *format, /* ASCII-encoded string */ |
| 27 | ...); |
Serhiy Storchaka | 34d0ac8 | 2016-12-27 14:57:39 +0200 | [diff] [blame] | 28 | #endif |
Martin v. Löwis | 1c0689c | 2014-01-03 21:36:49 +0100 | [diff] [blame] | 29 | #ifndef Py_LIMITED_API |
Victor Stinner | 14e461d | 2013-08-26 22:28:21 +0200 | [diff] [blame] | 30 | PyAPI_FUNC(int) PyErr_WarnExplicitObject( |
| 31 | PyObject *category, |
| 32 | PyObject *message, |
| 33 | PyObject *filename, |
| 34 | int lineno, |
| 35 | PyObject *module, |
| 36 | PyObject *registry); |
Martin v. Löwis | 1c0689c | 2014-01-03 21:36:49 +0100 | [diff] [blame] | 37 | #endif |
Victor Stinner | 555a24f | 2010-12-27 01:49:26 +0000 | [diff] [blame] | 38 | PyAPI_FUNC(int) PyErr_WarnExplicit( |
| 39 | PyObject *category, |
| 40 | const char *message, /* UTF-8 encoded string */ |
Victor Stinner | cb428f0 | 2010-12-27 20:10:36 +0000 | [diff] [blame] | 41 | const char *filename, /* decoded from the filesystem encoding */ |
Victor Stinner | 555a24f | 2010-12-27 01:49:26 +0000 | [diff] [blame] | 42 | int lineno, |
| 43 | const char *module, /* UTF-8 encoded string */ |
| 44 | PyObject *registry); |
Christian Heimes | 33fe809 | 2008-04-13 13:53:33 +0000 | [diff] [blame] | 45 | |
Martin v. Löwis | 1c0689c | 2014-01-03 21:36:49 +0100 | [diff] [blame] | 46 | #ifndef Py_LIMITED_API |
Antoine Pitrou | 070cb3c | 2013-05-08 13:23:25 +0200 | [diff] [blame] | 47 | PyAPI_FUNC(int) |
| 48 | PyErr_WarnExplicitFormat(PyObject *category, |
| 49 | const char *filename, int lineno, |
| 50 | const char *module, PyObject *registry, |
| 51 | const char *format, ...); |
Martin v. Löwis | 1c0689c | 2014-01-03 21:36:49 +0100 | [diff] [blame] | 52 | #endif |
Antoine Pitrou | 070cb3c | 2013-05-08 13:23:25 +0200 | [diff] [blame] | 53 | |
Christian Heimes | 33fe809 | 2008-04-13 13:53:33 +0000 | [diff] [blame] | 54 | /* DEPRECATED: Use PyErr_WarnEx() instead. */ |
Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 55 | #ifndef Py_LIMITED_API |
Christian Heimes | 33fe809 | 2008-04-13 13:53:33 +0000 | [diff] [blame] | 56 | #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) |
Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 57 | #endif |
Christian Heimes | 33fe809 | 2008-04-13 13:53:33 +0000 | [diff] [blame] | 58 | |
| 59 | #ifdef __cplusplus |
| 60 | } |
| 61 | #endif |
| 62 | #endif /* !Py_WARNINGS_H */ |
| 63 | |