diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_report.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/report.c | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h index fd372ae6d83..f6307806491 100644 --- a/source/blender/blenkernel/BKE_report.h +++ b/source/blender/blenkernel/BKE_report.h @@ -66,6 +66,8 @@ char *BKE_reports_string(ReportList *reports, ReportType level); void BKE_reports_print(ReportList *reports, ReportType level); Report *BKE_reports_last_displayable(ReportList *reports); + +int BKE_reports_contain(ReportList *reports, ReportType level); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index ffa9e027108..04bb45df282 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -37,7 +37,6 @@ #include "BKE_report.h" #include "BKE_global.h" /* G.background only */ - #include <stdarg.h> #include <stdio.h> #include <string.h> @@ -264,12 +263,24 @@ void BKE_reports_print(ReportList *reports, ReportType level) Report *BKE_reports_last_displayable(ReportList *reports) { - Report *report=NULL; + Report *report; - for (report= (Report *)reports->list.last; report; report=report->prev) { + for (report= reports->list.last; report; report=report->prev) { if (ELEM3(report->type, RPT_ERROR, RPT_WARNING, RPT_INFO)) return report; } return NULL; } + +int BKE_reports_contain(ReportList *reports, ReportType level) +{ + Report *report; + + for(report=reports->list.first; report; report=report->next) + if(report->type >= level) + return TRUE; + + return FALSE; +} + |