blob: c1c6992553ec0618b7b16ac78a7ee719dde5c5cd [file] [log] [blame]
Christian Heimes33fe8092008-04-13 13:53:33 +00001#ifndef Py_WARNINGS_H
2#define Py_WARNINGS_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
Martin v. Löwis4d0d4712010-12-03 20:14:31 +00007#ifndef Py_LIMITED_API
Martin v. Löwis1a214512008-06-11 05:26:20 +00008PyAPI_FUNC(PyObject*) _PyWarnings_Init(void);
Martin v. Löwis4d0d4712010-12-03 20:14:31 +00009#endif
Christian Heimes33fe8092008-04-13 13:53:33 +000010
Victor Stinner555a24f2010-12-27 01:49:26 +000011PyAPI_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 ...);
Victor Stinner914cde82016-03-19 01:03:51 +010020
21/* Emit a ResourceWarning warning */
22PyAPI_FUNC(int) PyErr_ResourceWarning(
23 PyObject *source,
24 Py_ssize_t stack_level,
25 const char *format, /* ASCII-encoded string */
26 ...);
Martin v. Löwis1c0689c2014-01-03 21:36:49 +010027#ifndef Py_LIMITED_API
Victor Stinner14e461d2013-08-26 22:28:21 +020028PyAPI_FUNC(int) PyErr_WarnExplicitObject(
29 PyObject *category,
30 PyObject *message,
31 PyObject *filename,
32 int lineno,
33 PyObject *module,
34 PyObject *registry);
Martin v. Löwis1c0689c2014-01-03 21:36:49 +010035#endif
Victor Stinner555a24f2010-12-27 01:49:26 +000036PyAPI_FUNC(int) PyErr_WarnExplicit(
37 PyObject *category,
38 const char *message, /* UTF-8 encoded string */
Victor Stinnercb428f02010-12-27 20:10:36 +000039 const char *filename, /* decoded from the filesystem encoding */
Victor Stinner555a24f2010-12-27 01:49:26 +000040 int lineno,
41 const char *module, /* UTF-8 encoded string */
42 PyObject *registry);
Christian Heimes33fe8092008-04-13 13:53:33 +000043
Martin v. Löwis1c0689c2014-01-03 21:36:49 +010044#ifndef Py_LIMITED_API
Antoine Pitrou070cb3c2013-05-08 13:23:25 +020045PyAPI_FUNC(int)
46PyErr_WarnExplicitFormat(PyObject *category,
47 const char *filename, int lineno,
48 const char *module, PyObject *registry,
49 const char *format, ...);
Martin v. Löwis1c0689c2014-01-03 21:36:49 +010050#endif
Antoine Pitrou070cb3c2013-05-08 13:23:25 +020051
Christian Heimes33fe8092008-04-13 13:53:33 +000052/* DEPRECATED: Use PyErr_WarnEx() instead. */
Martin v. Löwis4d0d4712010-12-03 20:14:31 +000053#ifndef Py_LIMITED_API
Christian Heimes33fe8092008-04-13 13:53:33 +000054#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
Martin v. Löwis4d0d4712010-12-03 20:14:31 +000055#endif
Christian Heimes33fe8092008-04-13 13:53:33 +000056
57#ifdef __cplusplus
58}
59#endif
60#endif /* !Py_WARNINGS_H */
61