- allow repositories that don't consist of a single block of solvables
[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 end;                      /* last solvable + 1 of this repo */
23   int nsolvables;               /* number of solvables repo is contributing to pool */
24
25   int priority;                 /* priority of this repo */
26
27   Id *idarraydata;              /* array of metadata Ids, solvable dependencies are offsets into this array */
28   int idarraysize;
29   Offset lastoff;
30
31   Id *rpmdbid;
32 } Repo;
33
34 extern Repo *repo_create(Pool *pool, const char *name);
35 extern void repo_free(Repo *repo, int reuseids);
36
37 extern Offset repo_addid(Repo *repo, Offset olddeps, Id id);
38 extern Offset repo_addid_dep(Repo *repo, Offset olddeps, Id id, int isreq);
39 extern Offset repo_reserve_ids(Repo *repo, Offset olddeps, int num);
40 extern Offset repo_fix_legacy(Repo *repo, Offset provides, Offset supplements);
41
42 extern void pool_freeallrepos(Pool *pool, int reuseids);
43
44 static inline const char *repo_name(const Repo *repo)
45 {
46   return repo->name;
47 }
48
49 #endif /* REPO_H */