satyr 0.43
Loading...
Searching...
No Matches
report.h
Go to the documentation of this file.
1/*
2 report.h
3
4 Copyright (C) 2012 Red Hat, Inc.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
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.
15
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20#ifndef SATYR_REPORT_H
21#define SATYR_REPORT_H
22
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#include "report_type.h"
33#include <inttypes.h>
34#include <json.h>
35#include <stdbool.h>
36
37struct sr_stacktrace;
38
40{
41 char *key;
42 char *value;
43 struct sr_report_custom_entry *next;
44};
45
47{
48 uint32_t report_version;
49 enum sr_report_type report_type;
50
51 char *reporter_name;
52 char *reporter_version;
53
54 // This is the real user id, not effective.
55 bool user_root;
56 bool user_local;
57
58 struct sr_operating_system *operating_system;
59
60 char *component_name;
61 struct sr_rpm_package *rpm_packages;
62
63 struct sr_stacktrace *stacktrace;
64
65 struct sr_report_custom_entry *auth_entries;
66
67 uint32_t serial;
68};
69
70struct sr_report *
71sr_report_new(void);
72
73void
74sr_report_init(struct sr_report *report);
75
76void
77sr_report_free(struct sr_report *report);
78
79
80/* @brief Adds a new entry to 'auth' object
81 *
82 * The implementation is LIFO. The resulting list is in reversed.
83 */
84void
85sr_report_add_auth(struct sr_report *report, const char *key, const char *value);
86
87char *
88sr_report_to_json(struct sr_report *report);
89
90struct sr_report *
91sr_report_from_json(json_object *root, char **error_message);
92
93struct sr_report *
94sr_report_from_json_text(const char *text, char **error_message);
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif
Report type.
Definition report.h:40