Permalink
Browse files

Let ShowPromises take a ReportOutputType

  • Loading branch information...
1 parent 6332f4e commit 2815dcc7f7d0abafde96d5b020e1e3583341ba00 @sigurdteigen sigurdteigen committed Jul 18, 2012
Showing with 15 additions and 5 deletions.
  1. +2 −1 src/generic_agent.c
  2. +12 −3 src/reporting.c
  3. +1 −1 src/reporting.h
View
@@ -1388,7 +1388,8 @@ void CompilationReport(Policy *policy, char *fname)
OpenCompilationReportFiles(fname);
#endif
- ShowPromises(policy->bundles, policy->bodies);
+ ShowPromises(REPORT_OUTPUT_TYPE_TEXT, policy->bundles, policy->bodies);
+ ShowPromises(REPORT_OUTPUT_TYPE_HTML, policy->bundles, policy->bodies);
fclose(FREPORT_HTML);
fclose(FREPORT_TXT);
View
@@ -155,13 +155,22 @@ static void ShowControlBodies()
/*******************************************************************/
-void ShowPromises(const Bundle *bundles, const Body *bodies)
+void ShowPromises(ReportOutputType type, const Bundle *bundles, const Body *bodies)
{
#if defined(HAVE_NOVA)
Nova_ShowPromises(bundles, bodies);
#else
- ShowPromisesInReportText(bundles, bodies);
- ShowPromisesInReportHtml(bundles, bodies);
+ switch (type)
+ {
+ case REPORT_OUTPUT_TYPE_HTML:
+ ShowPromisesInReportHtml(bundles, bodies);
+ break;
+
+ default:
+ case REPORT_OUTPUT_TYPE_TEXT:
+ ShowPromisesInReportText(bundles, bodies);
+ break;
+ }
#endif
}
View
@@ -33,7 +33,7 @@ typedef enum
REPORT_OUTPUT_TYPE_HTML
} ReportOutputType;
-void ShowPromises(const Bundle *bundles, const Body *bodies);
+void ShowPromises(ReportOutputType type, const Bundle *bundles, const Body *bodies);
void ShowPromise(ReportOutputType type, const Promise *pp, int indent);
void ShowScopedVariables(void);

0 comments on commit 2815dcc

Please sign in to comment.