19 #ifndef LIBREPORT_PROBLEM_REPORT_H
20 #define LIBREPORT_PROBLEM_REPORT_H
30 #define PR_SEC_SUMMARY "summary"
31 #define PR_SEC_DESCRIPTION "description"
45 struct problem_report;
46 typedef struct problem_report problem_report_t;
55 typedef FILE problem_report_buffer;
60 #define problem_report_buffer_printf(buf, fmt, ...)\
61 fprintf((buf), (fmt), ##__VA_ARGS__)
73 problem_report_buffer *problem_report_get_buffer(
const problem_report_t *
self,
74 const char *section_name);
85 const char *problem_report_get_summary(
const problem_report_t *
self);
96 const char *problem_report_get_description(
const problem_report_t *
self);
108 const char *problem_report_get_section(
const problem_report_t *
self,
109 const char *section_name);
117 GList *problem_report_get_attachments(
const problem_report_t *
self);
124 void problem_report_free(problem_report_t *
self);
130 enum problem_formatter_section_flags {
131 PFFF_REQUIRED = 1 << 0,
141 struct problem_formatter;
142 typedef struct problem_formatter problem_formatter_t;
149 problem_formatter_t *problem_formatter_new(
void);
156 void problem_formatter_free(problem_formatter_t *
self);
187 int problem_formatter_add_section(problem_formatter_t *
self,
const char *name,
int flags);
197 int problem_formatter_load_string(problem_formatter_t*
self,
const char *fmt);
208 int problem_formatter_load_file(problem_formatter_t*
self,
const char *path);
219 int problem_formatter_generate_report(
const problem_formatter_t *
self, problem_data_t *data, problem_report_t **report);
225 #endif // LIBREPORT_PROBLEM_REPORT_H