warnings.h 1.7 KB

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