diff -r 067ea2315a8a -r 5da2cf15eb44 dav/main.h --- a/dav/main.h Mon Dec 18 11:56:11 2017 +0100 +++ b/dav/main.h Mon Dec 18 16:24:32 2017 +0100 @@ -29,6 +29,7 @@ #ifndef MAIN_H #define MAIN_H +#include #include #include "optparser.h" #include @@ -45,12 +46,26 @@ char *path; } GetResource; +typedef struct { + FILE *out; + int isstdout; + int64_t total; + int64_t cur; + int64_t last_res_cur; + int64_t last_res_total; + DavResource *last_resource; + time_t ts; +} Progress; + typedef int(*getfunc)(Repository *, GetResource *, CmdArgs *, void *); void print_usage(char *cmd); char* password_input(char *prompt); int request_auth(Repository *repo, DavSession *sn, CmdArgs *args); +int update_progress(DavResource *res, int64_t total, int64_t now, Progress *p); +void download_progress(DavResource *res, int64_t total, int64_t now, void *data); + int cmd_list(CmdArgs *args); void ls_print_list_elm(DavResource *res, char *parent, CmdArgs *args); void ls_print_elm(DavResource *res, char *parent, CmdArgs *args);