warnings.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifndef Py_LIMITED_API
  19. PyAPI_FUNC(int) PyErr_WarnExplicitObject(
  20. PyObject *category,
  21. PyObject *message,
  22. PyObject *filename,
  23. int lineno,
  24. PyObject *module,
  25. PyObject *registry);
  26. #endif
  27. PyAPI_FUNC(int) PyErr_WarnExplicit(
  28. PyObject *category,
  29. const char *message, /* UTF-8 encoded string */
  30. const char *filename, /* decoded from the filesystem encoding */
  31. int lineno,
  32. const char *module, /* UTF-8 encoded string */
  33. PyObject *registry);
  34. #ifndef Py_LIMITED_API
  35. PyAPI_FUNC(int)
  36. PyErr_WarnExplicitFormat(PyObject *category,
  37. const char *filename, int lineno,
  38. const char *module, PyObject *registry,
  39. const char *format, ...);
  40. #endif
  41. /* DEPRECATED: Use PyErr_WarnEx() instead. */
  42. #ifndef Py_LIMITED_API
  43. #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)
  44. #endif
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif /* !Py_WARNINGS_H */