From af2fb3324a925af6caa9d53aacac92173fc47885 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 31 Oct 2006 06:39:59 +0000 Subject: Numerous changes: * Furthered the "lazy caching" to force the pkgcache to read nothing (INFRQ_NONE) by default. Anything requiring package data should now check the infolevel of each package and attempt to update it. This could be ironed out a bit more later (by using the front-end get_info function * Switched to libfetch. Drastic changes to the download code and the callback progress bar functions. Also fixed the return value of _alpm_downloadfiles_forreal. Downloading now supports http, ftp, https, and files urls, along with 'mtime's and numerous other fancy features from libfetch. --- lib/libalpm/server.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'lib/libalpm/server.h') diff --git a/lib/libalpm/server.h b/lib/libalpm/server.h index 218c172a..258df223 100644 --- a/lib/libalpm/server.h +++ b/lib/libalpm/server.h @@ -23,7 +23,8 @@ #include "list.h" #include -#include + +#include #define FREESERVER(p) \ do { \ @@ -37,11 +38,14 @@ do { \ /* Servers */ typedef struct __pmserver_t { - char *protocol; - char *server; char *path; + struct url *s_url; } pmserver_t; +#define PM_DLBUF_LEN (1024 * 10) + +typedef void (*download_progress_cb)(const char *filename, int xfered, int total); + pmserver_t *_alpm_server_new(char *url); void _alpm_server_free(void *data); int _alpm_downloadfiles(pmlist_t *servers, const char *localpath, pmlist_t *files); @@ -50,15 +54,7 @@ int _alpm_downloadfiles_forreal(pmlist_t *servers, const char *localpath, char *_alpm_fetch_pkgurl(char *target); -extern FtpCallback pm_dlcb; - -/* progress bar */ -extern char *pm_dlfnm; -extern int *pm_dloffset; -extern struct timeval *pm_dlt0, *pm_dlt; -extern float *pm_dlrate; -extern int *pm_dlxfered1; -extern unsigned char *pm_dleta_h, *pm_dleta_m, *pm_dleta_s; +extern download_progress_cb pm_dlcb; #endif /* _ALPM_SERVER_H */ -- cgit v1.2.3-54-g00ecf