diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:12:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:12:14 +0000 |
commit | 4b8a0f3f3dcf60dac2ce308ea08d413a535af29f (patch) | |
tree | 0f09c0ad2a4d0f535d89040a63dc3a866a6606e6 /downloadcache.h | |
parent | Initial commit. (diff) | |
download | reprepro-4b8a0f3f3dcf60dac2ce308ea08d413a535af29f.tar.xz reprepro-4b8a0f3f3dcf60dac2ce308ea08d413a535af29f.zip |
Adding upstream version 5.4.4.upstream/5.4.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'downloadcache.h')
-rw-r--r-- | downloadcache.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/downloadcache.h b/downloadcache.h new file mode 100644 index 0000000..60558d7 --- /dev/null +++ b/downloadcache.h @@ -0,0 +1,49 @@ +#ifndef REPREPRO_DOWNLOADLIST_H +#define REPREPRO_DOWNLOADLIST_H + +#ifndef REPREPRO_ERROR_H +#include "error.h" +#warning "What's hapening here?" +#endif +#ifndef REPREPRO_STRLIST_H +#include "strlist.h" +#warning "What's hapening here?" +#endif +#ifndef REPREPRO_DATABASE_H +#include "database.h" +#endif +#ifndef REPREPRO_APTMETHOD_H +#include "aptmethod.h" +#endif +#ifndef REPREPRO_CHECKSUMS_H +#include "checksums.h" +#endif +#ifndef REPREPRO_FREESPACE_H +#include "freespace.h" +#endif + +struct downloaditem; + +struct downloadcache { + /*@null@*/struct downloaditem *items; + /*@null@*/struct devices *devices; + + /* for showing what percentage was downloaded */ + long long size_todo, size_done; + unsigned int last_percent; +}; + +/* Initialize a new download session */ +retvalue downloadcache_initialize(enum spacecheckmode, off_t /*reserveddb*/, off_t /*reservedother*/, /*@out@*/struct downloadcache **); + +/* free all memory */ +retvalue downloadcache_free(/*@null@*//*@only@*/struct downloadcache *); + +/* queue a new file to be downloaded: + * results in RET_ERROR_WRONG_MD5, if someone else already asked + * for the same destination with other md5sum created. */ +retvalue downloadcache_add(struct downloadcache *, struct aptmethod *, const char * /*orig*/, const char * /*filekey*/, const struct checksums *); + +/* some as above, only for more files... */ +retvalue downloadcache_addfiles(struct downloadcache *, struct aptmethod *, const struct checksumsarray * /*origfiles*/, const struct strlist * /*filekeys*/); +#endif |