4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * Contributor(s): Blender Foundation (2008).
25 * ***** END GPL LICENSE BLOCK *****
35 #include "DNA_listBase.h"
37 /* Reporting Information and Errors
39 * These functions also accept NULL in case no error reporting
42 typedef enum ReportType {
48 RPT_ERROR_INVALID_INPUT = 1<<5,
49 RPT_ERROR_INVALID_CONTEXT = 1<<6,
50 RPT_ERROR_OUT_OF_MEMORY = 1<<7
53 #define RPT_DEBUG_ALL (RPT_DEBUG)
54 #define RPT_INFO_ALL (RPT_INFO)
55 #define RPT_OPERATOR_ALL (RPT_OPERATOR)
56 #define RPT_WARNING_ALL (RPT_WARNING)
57 #define RPT_ERROR_ALL (RPT_ERROR|RPT_ERROR_INVALID_INPUT|RPT_ERROR_INVALID_CONTEXT|RPT_ERROR_OUT_OF_MEMORY)
59 enum ReportListFlags {
64 typedef struct Report {
65 struct Report *next, *prev;
71 typedef struct ReportList {
73 ReportType printlevel;
74 ReportType storelevel;
78 void BKE_reports_init(ReportList *reports, int flag);
79 void BKE_reports_clear(ReportList *reports);
81 void BKE_report(ReportList *reports, ReportType type, const char *message);
82 void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...);
84 void BKE_reports_prepend(ReportList *reports, const char *prepend);
85 void BKE_reports_prependf(ReportList *reports, const char *prepend, ...);
87 ReportType BKE_report_print_level(ReportList *reports);
88 void BKE_report_print_level_set(ReportList *reports, ReportType level);
90 ReportType BKE_report_store_level(ReportList *reports);
91 void BKE_report_store_level_set(ReportList *reports, ReportType level);
93 char *BKE_reports_string(ReportList *reports, ReportType level);
94 void BKE_reports_print(ReportList *reports, ReportType level);