blob: 217c06a665671130c93b69af7b73c3fc121e7478 [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 Stinner14e461d2013-08-26 22:28:21 +020020PyAPI_FUNC(int) PyErr_WarnExplicitObject(
21 PyObject *category,
22 PyObject *message,
23 PyObject *filename,
24 int lineno,
25 PyObject *module,
26 PyObject *registry);
Victor Stinner555a24f2010-12-27 01:49:26 +000027PyAPI_FUNC(int) PyErr_WarnExplicit(
28 PyObject *category,
29 const char *message, /* UTF-8 encoded string */
Victor Stinnercb428f02010-12-27 20:10:36 +000030 const char *filename, /* decoded from the filesystem encoding */
Victor Stinner555a24f2010-12-27 01:49:26 +000031 int lineno,
32 const char *module, /* UTF-8 encoded string */
33 PyObject *registry);
Christian Heimes33fe8092008-04-13 13:53:33 +000034
Antoine Pitrou070cb3c2013-05-08 13:23:25 +020035PyAPI_FUNC(int)
36PyErr_WarnExplicitFormat(PyObject *category,
37 const char *filename, int lineno,
38 const char *module, PyObject *registry,
39 const char *format, ...);
40
Christian Heimes33fe8092008-04-13 13:53:33 +000041/* DEPRECATED: Use PyErr_WarnEx() instead. */
Martin v. Löwis4d0d4712010-12-03 20:14:31 +000042#ifndef Py_LIMITED_API
Christian Heimes33fe8092008-04-13 13:53:33 +000043#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
Martin v. Löwis4d0d4712010-12-03 20:14:31 +000044#endif
Christian Heimes33fe8092008-04-13 13:53:33 +000045
46#ifdef __cplusplus
47}
48#endif
49#endif /* !Py_WARNINGS_H */
50