- add a license
[platform/upstream/libsolv.git] / src / repo.h
1 /*
2  * Copyright (c) 2007, Novell Inc.
3  *
4  * This program is licensed under the BSD license, read LICENSE.BSD
5  * for further information
6  */
7
8 /*
9  * repo.h
10  * 
11  */
12
13 #ifndef REPO_H
14 #define REPO_H
15
16 #include "pooltypes.h"
17
18 typedef struct _Repo {
19   const char *name;
20   struct _Pool *pool;           /* pool containing repo data */
21   int start;                    /* start of this repo solvables within pool->solvables */
22   int nsolvables;               /* number of solvables repo is contributing to pool */
23
24   int priority;                 /* priority of this repo */
25
26   Id *idarraydata;              /* array of metadata Ids, solvable dependencies are offsets into this array */
27   int idarraysize;
28   Offset lastoff;
29
30   Id *rpmdbid;
31 } Repo;
32
33 extern Offset repo_addid(Repo *repo, Offset olddeps, Id id);
34 extern Offset repo_addid_dep(Repo *repo, Offset olddeps, Id id, int isreq);
35 extern Offset repo_reserve_ids(Repo *repo, Offset olddeps, int num);
36 extern Offset repo_fix_legacy(Repo *repo, Offset provides, Offset supplements);
37
38 extern Repo *pool_addrepo_empty(Pool *pool);
39 extern void pool_freerepo(Pool *pool, Repo *repo);
40
41 static inline const char *repo_name(const Repo *repo)
42 {
43   return repo->name;
44 }
45
46 #endif /* REPO_H */