summaryrefslogtreecommitdiff
path: root/src/apk_database.h
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-14 19:14:05 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-14 19:14:05 +0300
commit981bc118f8bdf1df6c23c096a52c890a87ee3e5e (patch)
tree73063efdb73ce4ee3511cc827181ff9c6b28427e /src/apk_database.h
parente9eaedff5071b94d166973f13df90e47ff4936fe (diff)
downloadapk-tools-981bc118f8bdf1df6c23c096a52c890a87ee3e5e.tar.gz
apk-tools-981bc118f8bdf1df6c23c096a52c890a87ee3e5e.tar.bz2
apk-tools-981bc118f8bdf1df6c23c096a52c890a87ee3e5e.tar.xz
apk-tools-981bc118f8bdf1df6c23c096a52c890a87ee3e5e.zip
db: live with sha1 and md5
this also convers scripts file to a tar archive.
Diffstat (limited to 'src/apk_database.h')
-rw-r--r--src/apk_database.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/apk_database.h b/src/apk_database.h
index 4235c56..b4c3f04 100644
--- a/src/apk_database.h
+++ b/src/apk_database.h
@@ -17,7 +17,8 @@
#include "apk_archive.h"
#include "apk_package.h"
-#define APK_MAX_REPOS 32
+#define APK_MAX_REPOS 32
+#define APK_CACHE_CSUM_BYTES 4
extern const char * const apk_index_gz;
@@ -29,8 +30,8 @@ struct apk_db_file {
struct hlist_node diri_files_list;
struct apk_db_dir_instance *diri;
- csum_t csum;
unsigned short namelen;
+ struct apk_checksum csum;
char name[];
};
@@ -73,7 +74,7 @@ struct apk_name {
struct apk_repository {
char *url;
- csum_t url_csum;
+ struct apk_checksum csum;
};
struct apk_database {
@@ -135,7 +136,7 @@ int apk_db_cache_active(struct apk_database *db);
struct apk_package *apk_db_pkg_add_file(struct apk_database *db, const char *file);
struct apk_package *apk_db_pkg_add(struct apk_database *db, struct apk_package *pkg);
-struct apk_package *apk_db_get_pkg(struct apk_database *db, csum_t sum);
+struct apk_package *apk_db_get_pkg(struct apk_database *db, struct apk_checksum *csum);
struct apk_package *apk_db_get_file_owner(struct apk_database *db, apk_blob_t filename);
int apk_db_index_read(struct apk_database *db, struct apk_bstream *bs, int repo);
@@ -143,9 +144,10 @@ int apk_db_index_write(struct apk_database *db, struct apk_ostream *os);
int apk_db_add_repository(apk_database_t db, apk_blob_t repository);
int apk_repository_update(struct apk_database *db, struct apk_repository *repo);
-int apk_cache_download(struct apk_database *db, csum_t csum,
+int apk_cache_download(struct apk_database *db, struct apk_checksum *csum,
const char *url, const char *item);
-int apk_cache_exists(struct apk_database *db, csum_t csum, const char *item);
+int apk_cache_exists(struct apk_database *db, struct apk_checksum *csum,
+ const char *item);
int apk_db_install_pkg(struct apk_database *db,
struct apk_package *oldpkg,