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)
28 #define RPMDB_EMPTY_REFREPO (1 << 30) /* internal */
30 #define RPM_ITERATE_FILELIST_ONLYDIRS (1 << 0)
31 #define RPM_ITERATE_FILELIST_WITHMD5 (1 << 1)
32 #define RPM_ITERATE_FILELIST_WITHCOL (1 << 2)
33 #define RPM_ITERATE_FILELIST_NOGHOSTS (1 << 3)
35 /* create and free internal state, rootdir is the rootdir of the rpm database */
36 extern void *rpm_state_create(Pool *pool, const char *rootdir);
37 extern void *rpm_state_free(void *rpmstate);
39 /* return all matching rpmdbids */
40 extern int rpm_installedrpmdbids(void *rpmstate, const char *index, const char *match, Queue *rpmdbidq);
42 /* return handles to a rpm header */
43 extern void *rpm_byrpmdbid(void *rpmstate, Id rpmdbid);
44 extern void *rpm_byfp(void *rpmstate, FILE *fp, const char *name);
45 extern void *rpm_byrpmh(void *rpmstate, struct headerToken_s *h);
47 /* operations on a rpm header handle */
57 extern char *rpm_query(void *rpmhandle, Id what);
58 extern unsigned long long rpm_query_num(void *rpmhandle, Id what, unsigned long long notfound);
59 extern void rpm_iterate_filelist(void *rpmhandle, int flags, void (*cb)(void *, const char *, struct filelistinfo *), void *cbdata);
60 extern Id repo_add_rpm_handle(Repo *repo, void *rpmhandle, int flags);