summaryrefslogtreecommitdiffstats
path: root/src/apk_database.h
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2008-11-27 20:25:01 +0200
committerTimo Teras <timo.teras@iki.fi>2008-11-27 20:25:01 +0200
commitf0609951b9fd2938c0f30853e0aa6b08b8698a88 (patch)
tree3b1f72cbaad90d715d60643c0fac98b7aaedd37e /src/apk_database.h
parent1a7f3e3678844165d2660ebff09da26b9ba01576 (diff)
hash, db: use apk_blob_t and list_*
Diffstat (limited to 'src/apk_database.h')
-rw-r--r--src/apk_database.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/apk_database.h b/src/apk_database.h
index 5cf2928..b0b84d6 100644
--- a/src/apk_database.h
+++ b/src/apk_database.h
@@ -71,7 +71,7 @@ struct apk_database {
} available;
struct {
- struct hlist_head packages;
+ struct list_head packages;
struct apk_hash dirs;
struct {
unsigned files;
@@ -81,7 +81,12 @@ struct apk_database {
} installed;
};
-struct apk_name *apk_db_get_name(struct apk_database *db, const char *name);
+typedef union apk_database_or_void {
+ struct apk_database *db;
+ void *ptr;
+} apk_database_t __attribute__ ((__transparent_union__));
+
+struct apk_name *apk_db_get_name(struct apk_database *db, apk_blob_t name);
void apk_name_free(struct apk_name *pkgname);
int apk_db_create(const char *root);
@@ -91,10 +96,10 @@ void apk_db_close(struct apk_database *db);
int apk_db_pkg_add_file(struct apk_database *db, const char *file);
struct apk_package *apk_db_get_pkg(struct apk_database *db, csum_t sum);
-int apk_db_index_read(struct apk_database *db, int fd, int repo);
+int apk_db_index_read(struct apk_database *db, struct apk_istream *is, int repo);
void apk_db_index_write(struct apk_database *db, int fd);
-int apk_db_add_repository(struct apk_database *db, const char *repo);
+int apk_db_add_repository(apk_database_t db, apk_blob_t repository);
int apk_db_recalculate_and_commit(struct apk_database *db);
int apk_db_install_pkg(struct apk_database *db,