|
krh@27
|
1 |
#ifndef _RAZOR_H_
|
|
krh@27
|
2 |
#define _RAZOR_H_
|
|
krh@27
|
3 |
|
|
krh@43
|
4 |
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
|
krh@43
|
5 |
|
|
krh@43
|
6 |
struct razor_set;
|
|
krh@43
|
7 |
|
|
krh@66
|
8 |
enum razor_property_type {
|
|
krh@66
|
9 |
RAZOR_PROPERTY_REQUIRES,
|
|
krh@66
|
10 |
RAZOR_PROPERTY_PROVIDES,
|
|
krh@66
|
11 |
RAZOR_PROPERTY_CONFLICTS,
|
|
krh@66
|
12 |
RAZOR_PROPERTY_OBSOLETES
|
|
krh@66
|
13 |
};
|
|
krh@66
|
14 |
|
|
krh@43
|
15 |
struct razor_set *razor_set_open(const char *filename);
|
|
krh@43
|
16 |
void razor_set_destroy(struct razor_set *set);
|
|
krh@43
|
17 |
int razor_set_write(struct razor_set *set, const char *filename);
|
|
krh@43
|
18 |
|
|
krh@54
|
19 |
void razor_set_list(struct razor_set *set, const char *pattern);
|
|
krh@66
|
20 |
void razor_set_list_properties(struct razor_set *set, const char *name,
|
|
krh@66
|
21 |
enum razor_property_type type);
|
|
krh@66
|
22 |
void razor_set_list_property_packages(struct razor_set *set,
|
|
krh@43
|
23 |
const char *name,
|
|
krh@66
|
24 |
const char *version,
|
|
krh@66
|
25 |
enum razor_property_type type);
|
|
krh@49
|
26 |
void razor_set_list_files(struct razor_set *set, const char *prefix);
|
|
krh@52
|
27 |
void razor_set_list_file_packages(struct razor_set *set, const char *filename);
|
|
krh@56
|
28 |
void razor_set_list_package_files(struct razor_set *set, const char *name);
|
|
krh@43
|
29 |
|
|
krh@43
|
30 |
void razor_set_list_unsatisfied(struct razor_set *set);
|
|
krh@43
|
31 |
struct razor_set *razor_set_update(struct razor_set *set,
|
|
krh@43
|
32 |
struct razor_set *upstream,
|
|
krh@43
|
33 |
int count, const char **packages);
|
|
krh@43
|
34 |
|
|
krh@44
|
35 |
typedef void (*razor_package_callback_t)(const char *name,
|
|
krh@44
|
36 |
const char *old_version,
|
|
krh@44
|
37 |
const char *new_version,
|
|
krh@44
|
38 |
void *data);
|
|
krh@44
|
39 |
void
|
|
krh@44
|
40 |
razor_set_diff(struct razor_set *set, struct razor_set *upstream,
|
|
krh@44
|
41 |
razor_package_callback_t callback, void *data);
|
|
krh@44
|
42 |
|
|
krh@44
|
43 |
|
|
krh@44
|
44 |
/* Importer interface; for building a razor set from external sources,
|
|
krh@44
|
45 |
* like yum, rpmdb or razor package files. */
|
|
krh@44
|
46 |
|
|
krh@30
|
47 |
struct razor_importer;
|
|
krh@27
|
48 |
|
|
krh@30
|
49 |
struct razor_importer *razor_importer_new(void);
|
|
krh@75
|
50 |
void razor_importer_destroy(struct razor_importer *importer);
|
|
krh@30
|
51 |
void razor_importer_begin_package(struct razor_importer *importer,
|
|
krh@27
|
52 |
const char *name, const char *version);
|
|
krh@66
|
53 |
void razor_importer_add_property(struct razor_importer *importer,
|
|
krh@66
|
54 |
const char *name, const char *version,
|
|
krh@66
|
55 |
enum razor_property_type type);
|
|
krh@46
|
56 |
void razor_importer_add_file(struct razor_importer *importer,
|
|
krh@46
|
57 |
const char *name);
|
|
krh@30
|
58 |
void razor_importer_finish_package(struct razor_importer *importer);
|
|
krh@75
|
59 |
|
|
krh@75
|
60 |
int razor_importer_add_rpm(struct razor_importer *importer,
|
|
krh@75
|
61 |
const char *filename);
|
|
krh@75
|
62 |
|
|
krh@30
|
63 |
struct razor_set *razor_importer_finish(struct razor_importer *importer);
|
|
krh@27
|
64 |
|
|
krh@70
|
65 |
struct razor_set *razor_set_create_from_yum(void);
|
|
krh@28
|
66 |
struct razor_set *razor_set_create_from_rpmdb(void);
|
|
krh@27
|
67 |
|
|
krh@74
|
68 |
/* RPM functions */
|
|
krh@74
|
69 |
void
|
|
krh@74
|
70 |
razor_rpm_dump(const char *filename);
|
|
krh@74
|
71 |
|
|
krh@27
|
72 |
#endif /* _RAZOR_H_ */
|