2 * Copyright (c) 2007-2008, Novell Inc.
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
13 extern int repo_add_rpmdb(Repo *repo, Repo *ref, int flags);
14 extern int repo_add_rpmdb_reffp(Repo *repo, FILE *reffp, int flags);
15 extern Id repo_add_rpm(Repo *repo, const char *rpm, int flags);
17 #define RPMDB_REPORT_PROGRESS (1 << 8)
18 #define RPM_ADD_WITH_PKGID (1 << 9)
19 #define RPM_ADD_NO_FILELIST (1 << 10)
20 #define RPM_ADD_NO_RPMLIBREQS (1 << 11)
21 #define RPM_ADD_WITH_SHA1SUM (1 << 12)
22 #define RPM_ADD_WITH_SHA256SUM (1 << 13)
23 #define RPM_ADD_TRIGGERS (1 << 14)
24 #define RPM_ADD_WITH_HDRID (1 << 15)
25 #define RPM_ADD_WITH_LEADSIGID (1 << 16)
26 #define RPM_ADD_WITH_CHANGELOG (1 << 17)
27 #define RPM_ADD_FILTERED_FILELIST (1 << 18)
29 #define RPMDB_EMPTY_REFREPO (1 << 30) /* internal */
31 #define RPM_ITERATE_FILELIST_ONLYDIRS (1 << 0)
32 #define RPM_ITERATE_FILELIST_WITHMD5 (1 << 1)
33 #define RPM_ITERATE_FILELIST_WITHCOL (1 << 2)
34 #define RPM_ITERATE_FILELIST_NOGHOSTS (1 << 3)
36 /* create and free internal state, rootdir is the rootdir of the rpm database */
37 extern void *rpm_state_create(Pool *pool, const char *rootdir);
38 extern void *rpm_state_free(void *rpmstate);
40 /* return all matching rpmdbids */
41 extern int rpm_installedrpmdbids(void *rpmstate, const char *index, const char *match, Queue *rpmdbidq);
43 /* return handles to a rpm header */
44 extern void *rpm_byrpmdbid(void *rpmstate, Id rpmdbid);
45 extern void *rpm_byfp(void *rpmstate, FILE *fp, const char *name);
46 extern void *rpm_byrpmh(void *rpmstate, struct headerToken_s *h);
48 /* operations on a rpm header handle */
58 extern char *rpm_query(void *rpmhandle, Id what);
59 extern unsigned long long rpm_query_num(void *rpmhandle, Id what, unsigned long long notfound);
60 extern void rpm_iterate_filelist(void *rpmhandle, int flags, void (*cb)(void *, const char *, struct filelistinfo *), void *cbdata);
61 extern Id repo_add_rpm_handle(Repo *repo, void *rpmhandle, int flags);