summaryrefslogtreecommitdiff
path: root/lib/depends.h
blob: 8d60228dac71f4722eee7b8aa6961b599c4b46fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#ifndef H_DEPENDS
#define H_DEPENDS

#include <header.h>

struct availablePackage {
    Header h;
    /*@owned@*/ const char ** provides;
    /*@owned@*/ const char ** providesEVR;
    /*@dependent@*/ int * provideFlags;
    /*@owned@*/ const char ** baseNames;
    /*@dependent@*/ const char * name;
    /*@dependent@*/ const char * version;
    /*@dependent@*/ const char * release;
    /*@dependent@*/ int_32 * epoch;
    int providesCount, filesCount;
    /*@dependent@*/ const void * key;
    rpmRelocation * relocs;
    /*@null@*/ FD_t fd;
} ;

enum indexEntryType { IET_NAME, IET_PROVIDES };

struct availableIndexEntry {
    /*@dependent@*/ struct availablePackage * package;
    /*@dependent@*/ const char * entry;
    enum indexEntryType type;
} ;

struct fileIndexEntry {
    int pkgNum;
    /*@dependent@*/ const char * baseName;
} ;

struct dirInfo {
    /*@owned@*/ char * dirName;			/* xstrdup'd */
    int dirNameLen;
    /*@owned@*/ struct fileIndexEntry * files;	/* xmalloc'd */
    int numFiles;
} ;

struct availableIndex {
    /*@null@*/ struct availableIndexEntry * index ;
    int size;
} ;

struct availableList {
    /*@owned@*/ /*@null@*/ struct availablePackage * list;
    struct availableIndex index;
    int size, alloced;
    int numDirs;
    /*@owned@*/ struct dirInfo * dirs;		/* xmalloc'd */
};

struct transactionElement {
    enum rpmTransactionType { TR_ADDED, TR_REMOVED } type;
    union { 
	int addedIndex;
	struct {
	    int dboffset;
	    int dependsOnIndex;
	} removed;
    } u;
};

struct rpmTransactionSet_s {
    /*@owned@*/ /*@null@*/ rpmdb db;			/* may be NULL */
    /*@only@*/ int * removedPackages;
    int numRemovedPackages, allocedRemovedPackages;
    struct availableList addedPackages, availablePackages;
    /*@only@*/ struct transactionElement * order;
    int orderCount, orderAlloced;
    /*@only@*/ const char * root;
    /*@null@*/ FD_t scriptFd;
};

struct problemsSet {
    struct rpmDependencyConflict * problems;
    int num;
    int alloced;
};

#ifdef __cplusplus
extern "C" {
#endif

int headerMatchesDepFlags(Header h, const char *reqName, const char * reqInfo, int reqFlags);

#ifdef __cplusplus
}
#endif

#endif	/* H_DEPENDS */