path: root/src/apk_io.h
diff options
authorTimo Teräs <>2012-02-22 08:45:40 +0200
committerTimo Teräs <>2012-02-22 08:45:40 +0200
commitbf82e2e5fd45f4ba425a128ae4fdb6144c82f218 (patch)
treeb7d97e0aede851d3d0222ee30141cb00bccf217f /src/apk_io.h
parent568d57336d84179b3e97a301872890dc51969a36 (diff)
db, solver, io: scan cache items at startup
It is faster to just scan the cache directory for existing packages at startup than trying to faccessat() them on demand. It also makes quite a few parts of the code more readable and simpler.
Diffstat (limited to 'src/apk_io.h')
1 files changed, 3 insertions, 0 deletions
diff --git a/src/apk_io.h b/src/apk_io.h
index 83e9327..6379c3b 100644
--- a/src/apk_io.h
+++ b/src/apk_io.h
@@ -106,10 +106,13 @@ size_t apk_ostream_write_string(struct apk_ostream *ostream, const char *string)
apk_blob_t apk_blob_from_istream(struct apk_istream *istream, size_t size);
apk_blob_t apk_blob_from_file(int atfd, const char *file);
+typedef int apk_dir_file_cb(void *ctx, const char *entry);
#define APK_FI_NOFOLLOW 0x80000000
int apk_file_get_info(int atfd, const char *filename, unsigned int flags,
struct apk_file_info *fi);
+int apk_dir_foreach_file(int dirfd, apk_dir_file_cb cb, void *ctx);
int apk_move_file(int atfd, const char *from, const char *to);
int apk_url_download(const char *url, int atfd, const char *file);
const char *apk_url_local_file(const char *url);