satyr
0.43
Toggle main menu visibility
Loading...
Searching...
No Matches
include
rpm.h
Go to the documentation of this file.
1
/*
2
rpm.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_RPM_H
21
#define SATYR_RPM_H
22
27
28
#ifdef __cplusplus
29
extern
"C"
{
30
#endif
31
32
#include <stdbool.h>
33
#include <inttypes.h>
34
#include <json.h>
35
36
/* XXX: Should be moved to separated header once we support more package types.
37
*/
38
enum
sr_package_role
39
{
40
/* The role the package has in the problem is either unknown or
41
* irrelevant.
42
*/
43
SR_ROLE_UNKNOWN = 0,
44
45
/* The packages contains the executable or script the execution of which
46
* caused the problem to manifest.
47
*/
48
SR_ROLE_AFFECTED
49
};
50
51
struct
sr_rpm_consistency
52
{
53
char
*path;
54
bool
owner_changed;
55
bool
group_changed;
56
bool
mode_changed;
57
bool
md5_mismatch;
58
bool
size_changed;
59
bool
major_number_changed;
60
bool
minor_number_changed;
61
bool
symlink_changed;
62
bool
modification_time_changed;
63
struct
sr_rpm_consistency
*next;
64
};
65
66
struct
sr_rpm_package
67
{
68
char
*name;
69
uint32_t epoch;
70
char
*version;
71
char
*release;
72
char
*architecture;
73
uint64_t install_time;
74
enum
sr_package_role role;
75
struct
sr_rpm_consistency
*consistency;
76
struct
sr_rpm_package
*next;
77
};
78
79
struct
sr_rpm_package
*
80
sr_rpm_package_new(
void
);
81
82
void
83
sr_rpm_package_init(
struct
sr_rpm_package
*package);
84
85
void
86
sr_rpm_package_free(
struct
sr_rpm_package
*package,
87
bool
recursive);
88
102
int
103
sr_rpm_package_cmp
(
struct
sr_rpm_package
*package1,
104
struct
sr_rpm_package
*package2);
105
119
int
120
sr_rpm_package_cmp_nvr
(
struct
sr_rpm_package
*package1,
121
struct
sr_rpm_package
*package2);
122
137
int
138
sr_rpm_package_cmp_nevra
(
struct
sr_rpm_package
*package1,
139
struct
sr_rpm_package
*package2);
140
147
struct
sr_rpm_package
*
148
sr_rpm_package_append
(
struct
sr_rpm_package
*dest,
149
struct
sr_rpm_package
*item);
150
154
int
155
sr_rpm_package_count
(
struct
sr_rpm_package
*packages);
156
157
struct
sr_rpm_package
*
158
sr_rpm_package_sort(
struct
sr_rpm_package
*packages);
159
160
struct
sr_rpm_package
*
161
sr_rpm_package_uniq(
struct
sr_rpm_package
*packages);
162
163
struct
sr_rpm_package
*
164
sr_rpm_package_get_by_name(
const
char
*name,
165
char
**error_message);
166
167
struct
sr_rpm_package
*
168
sr_rpm_package_get_by_path(
const
char
*path,
169
char
**error_message);
170
171
char
*
172
sr_rpm_package_to_json(
struct
sr_rpm_package
*package,
173
bool
recursive);
174
175
int
176
sr_rpm_package_from_json(
struct
sr_rpm_package
**rpm_package, json_object *list,
177
bool
recursive,
char
**error_message);
178
179
bool
180
sr_rpm_package_parse_nvr(
const
char
*text,
181
char
**name,
182
char
**version,
183
char
**release);
184
185
bool
186
sr_rpm_package_parse_nevra(
const
char
*text,
187
char
**name,
188
uint32_t *epoch,
189
char
**version,
190
char
**release,
191
char
**architecture);
192
193
struct
sr_rpm_consistency
*
194
sr_rpm_consistency_new(
void
);
195
196
void
197
sr_rpm_consistency_init(
struct
sr_rpm_consistency
*consistency);
198
199
void
200
sr_rpm_consistency_free(
struct
sr_rpm_consistency
*consistency,
201
bool
recursive);
202
203
int
204
sr_rpm_consistency_cmp(
struct
sr_rpm_consistency
*consistency1,
205
struct
sr_rpm_consistency
*consistency2);
206
207
int
208
sr_rpm_consistency_cmp_recursive(
struct
sr_rpm_consistency
*consistency1,
209
struct
sr_rpm_consistency
*consistency2);
210
217
struct
sr_rpm_consistency
*
218
sr_rpm_consistency_append
(
struct
sr_rpm_consistency
*dest,
219
struct
sr_rpm_consistency
*item);
220
221
#ifdef __cplusplus
222
}
223
#endif
224
225
#endif
sr_rpm_package_count
int sr_rpm_package_count(struct sr_rpm_package *packages)
sr_rpm_package_cmp
int sr_rpm_package_cmp(struct sr_rpm_package *package1, struct sr_rpm_package *package2)
sr_rpm_package_cmp_nevra
int sr_rpm_package_cmp_nevra(struct sr_rpm_package *package1, struct sr_rpm_package *package2)
sr_rpm_package_cmp_nvr
int sr_rpm_package_cmp_nvr(struct sr_rpm_package *package1, struct sr_rpm_package *package2)
sr_rpm_package_append
struct sr_rpm_package * sr_rpm_package_append(struct sr_rpm_package *dest, struct sr_rpm_package *item)
sr_rpm_consistency_append
struct sr_rpm_consistency * sr_rpm_consistency_append(struct sr_rpm_consistency *dest, struct sr_rpm_consistency *item)
sr_rpm_consistency
Definition
rpm.h:52
sr_rpm_package
Definition
rpm.h:67
Generated by
1.17.0