BKE_report.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * ***** BEGIN GPL LICENSE BLOCK *****
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software Foundation,
  16. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. *
  18. * Contributor(s): Blender Foundation (2008).
  19. *
  20. * ***** END GPL LICENSE BLOCK *****
  21. */
  22. #ifndef __BKE_REPORT_H__
  23. #define __BKE_REPORT_H__
  24. /** \file BKE_report.h
  25. * \ingroup bke
  26. */
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #include <stdio.h>
  31. #include "DNA_windowmanager_types.h"
  32. #include "BLI_compiler_attrs.h"
  33. #include "BLI_utildefines.h"
  34. /* Reporting Information and Errors
  35. *
  36. * These functions also accept NULL in case no error reporting
  37. * is needed. */
  38. /* report structures are stored in DNA */
  39. void BKE_reports_init(ReportList *reports, int flag);
  40. void BKE_reports_clear(ReportList *reports);
  41. void BKE_report(ReportList *reports, ReportType type, const char *message);
  42. void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...) ATTR_PRINTF_FORMAT(3, 4);
  43. void BKE_reports_prepend(ReportList *reports, const char *prepend);
  44. void BKE_reports_prependf(ReportList *reports, const char *prepend, ...) ATTR_PRINTF_FORMAT(2, 3);
  45. ReportType BKE_report_print_level(ReportList *reports);
  46. void BKE_report_print_level_set(ReportList *reports, ReportType level);
  47. ReportType BKE_report_store_level(ReportList *reports);
  48. void BKE_report_store_level_set(ReportList *reports, ReportType level);
  49. char *BKE_reports_string(ReportList *reports, ReportType level);
  50. void BKE_reports_print(ReportList *reports, ReportType level);
  51. Report *BKE_reports_last_displayable(ReportList *reports);
  52. bool BKE_reports_contain(ReportList *reports, ReportType level);
  53. const char *BKE_report_type_str(ReportType type);
  54. bool BKE_report_write_file_fp(FILE *fp, ReportList *reports, const char *header);
  55. bool BKE_report_write_file(const char *filepath, ReportList *reports, const char *header);
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif