Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=a0d6d9335f39d1aab09cba7db3a7d168a1a6deb7
commit a0d6d9335f39d1aab09cba7db3a7d168a1a6deb7 Author: Michel Hermier <herm...@frugalware.org> Date: Fri Nov 15 12:19:54 2013 +0100 libpacman: s/download_state/downloadstate/. diff --git a/doc/libpacman-changes.txt b/doc/libpacman-changes.txt index ce9ade6..63d987b 100644 --- a/doc/libpacman-changes.txt +++ b/doc/libpacman-changes.txt @@ -28,7 +28,7 @@ pacman_reg_match: Make arguments constants. pacman_trans_cb_progress: Make 'pkgname' argument a constant. -pacman_trans_cb_download: Changed the not usable PM_NETBUF *ctl to a const pmdownload_state_t *download_states (thougt only one supported for now). +pacman_trans_cb_download: Changed the not usable PM_NETBUF *ctl to a const pmdownloadstate_t *downloadstates (thougt only one supported for now). ==== Symbols added: @@ -36,7 +36,7 @@ pmconflict_t: is now public and deprecate PM_CONFLICT. pmdb_t: is now public and deprecate PM_DB. -pacman_download_state_size: Access to a download final size. +pacman_downloadstate_size: Access to a download final size. pmdepmissing_t: is now public and deprecate PM_DEPMISS. diff --git a/lib/libpacman/pacman.c b/lib/libpacman/pacman.c index 5ac14fb..289246d 100644 --- a/lib/libpacman/pacman.c +++ b/lib/libpacman/pacman.c @@ -412,20 +412,20 @@ pmlist_t *pacman_db_getgrpcache(pmdb_t *db) /** @} */ -/** @defgroup pacman_download_state Download States Functions +/** @defgroup pacman_downloadstate Download States Functions * @brief Functions to informations from libpacman downloads * @{ */ /** Get the final size of the download - * @param download_state pointer to the download state to get the informations from. + * @param downloadstate pointer to the download state to get the informations from. * @return the size of the file or ((off_t) -1) in case of error. */ -off_t pacman_download_state_size(const pmdownload_state_t *download_state) +off_t pacman_downloadstate_size(const pmdownloadstate_t *downloadstate) { - ASSERT(download_state != NULL, return((off_t) -1)); + ASSERT(downloadstate != NULL, return((off_t) -1)); - return download_state->dst_size; + return downloadstate->dst_size; } /** @} */ diff --git a/lib/libpacman/pacman.h b/lib/libpacman/pacman.h index 5c65bf5..5dba69a 100644 --- a/lib/libpacman/pacman.h +++ b/lib/libpacman/pacman.h @@ -51,7 +51,7 @@ extern "C" { typedef struct __pmconflict_t pmconflict_t; typedef struct __pmdb_t pmdb_t; typedef struct __pmdepmissing_t pmdepmissing_t; -typedef struct __pmdownload_state_t pmdownload_state_t; +typedef struct __pmdownloadstate_t pmdownloadstate_t; typedef struct __pmgrp_t pmgrp_t; typedef struct __pmlist_t pmlist_t; typedef struct __pmpkg_t pmpkg_t; @@ -174,7 +174,7 @@ pmlist_t *pacman_db_test(pmdb_t *db); * Download states */ -off_t pacman_download_state_size(const pmdownload_state_t *download_state); +off_t pacman_downloadstate_size(const pmdownloadstate_t *downloadstate); /* * Packages @@ -357,7 +357,7 @@ typedef void (*pacman_trans_cb_conv)(unsigned char, void *, void *, void *, int typedef void (*pacman_trans_cb_progress)(unsigned char, const char *, int, int, int); /* Download Progress callback */ -typedef int (*pacman_trans_cb_download)(const pmdownload_state_t *download_states, int xfered, void *arg); +typedef int (*pacman_trans_cb_download)(const pmdownloadstate_t *downloadstates, int xfered, void *arg); /* Info parameters */ enum { diff --git a/lib/libpacman/server.c b/lib/libpacman/server.c index f43326d..1c11321 100644 --- a/lib/libpacman/server.c +++ b/lib/libpacman/server.c @@ -145,9 +145,9 @@ int _pacman_downloadfiles(pmlist_t *servers, const char *localpath, pmlist_t *fi static int _pacman_ftplib_download_cb(netbuf *control, int xfered, void *arg) { - pmdownload_state_t *download_state = arg; + pmdownloadstate_t *downloadstate = arg; - return pm_dlcb(download_state, xfered, &download_state->dst_size); + return pm_dlcb(downloadstate, xfered, &downloadstate->dst_size); } /* @@ -166,7 +166,7 @@ int _pacman_ftplib_download_cb(netbuf *control, int xfered, void *arg) int _pacman_downloadfiles_forreal(pmlist_t *servers, const char *localpath, pmlist_t *files, const time_t *mtime1, time_t *mtime2, int skip) { - pmdownload_state_t download_state = { 0 }; + pmdownloadstate_t downloadstate = { 0 }; netbuf *control = NULL; pmlist_t *lp; int done = 0; @@ -243,7 +243,7 @@ int _pacman_downloadfiles_forreal(pmlist_t *servers, const char *localpath, _pacman_log(PM_LOG_DEBUG, _("downloadfiles: progress bar's callback is not set\n")); } FtpOptions(FTPLIB_IDLETIME, (long)1000, control); - FtpOptions(FTPLIB_CALLBACKARG, (long)&download_state, control); + FtpOptions(FTPLIB_CALLBACKARG, (long)&downloadstate, control); FtpOptions(FTPLIB_CALLBACKBYTES, (10*1024), control); FtpOptions(FTPLIB_LOSTTIME, (long)5, control); } @@ -390,7 +390,7 @@ int _pacman_downloadfiles_forreal(pmlist_t *servers, const char *localpath, } if(!strcmp(server->protocol, "ftp") && !handle->proxyhost) { - if(!FtpSize(fn, &download_state.dst_size, FTPLIB_IMAGE, control)) { + if(!FtpSize(fn, &downloadstate.dst_size, FTPLIB_IMAGE, control)) { _pacman_log(PM_LOG_WARNING, _("failed to get filesize for %s\n"), fn); } /* check mtimes */ @@ -477,7 +477,7 @@ int _pacman_downloadfiles_forreal(pmlist_t *servers, const char *localpath, _pacman_log(PM_LOG_DEBUG, _("downloadfiles: progress bar's callback is not set\n")); } FtpOptions(FTPLIB_IDLETIME, (long)1000, control); - FtpOptions(FTPLIB_CALLBACKARG, (long)&download_state, control); + FtpOptions(FTPLIB_CALLBACKARG, (long)&downloadstate, control); FtpOptions(FTPLIB_CALLBACKBYTES, (10*1024), control); FtpOptions(FTPLIB_LOSTTIME, (long)5, control); } @@ -496,7 +496,7 @@ int _pacman_downloadfiles_forreal(pmlist_t *servers, const char *localpath, if(mtime1 && *mtime1 != PM_TIME_INVALID) { fmtime1 = *gmtime(mtime1); } - if(!HttpGet(server->server, output, src, &download_state.dst_size, control, (pm_dloffset ? *pm_dloffset:0), + if(!HttpGet(server->server, output, src, &downloadstate.dst_size, control, (pm_dloffset ? *pm_dloffset:0), (mtime1) ? &fmtime1 : NULL, (mtime2) ? &fmtime2 : NULL)) { if(strstr(FtpLastResponse(control), "304")) { _pacman_log(PM_LOG_DEBUG, _("mtimes are identical, skipping %s\n"), fn); @@ -538,7 +538,7 @@ int _pacman_downloadfiles_forreal(pmlist_t *servers, const char *localpath, if(!strcmp(server->protocol, "file")) { EVENT(handle->trans, PM_TRANS_EVT_RETRIEVE_LOCAL, pm_dlfnm, server->path); } else if(pm_dlcb) { - pm_dlcb(&download_state, download_state.dst_size-*pm_dloffset, &download_state.dst_size); + pm_dlcb(&downloadstate, downloadstate.dst_size-*pm_dloffset, &downloadstate.dst_size); } complete = _pacman_list_add(complete, fn); /* rename "output.part" file to "output" file */ diff --git a/lib/libpacman/server.h b/lib/libpacman/server.h index fc3676a..597448d 100644 --- a/lib/libpacman/server.h +++ b/lib/libpacman/server.h @@ -43,7 +43,7 @@ typedef struct __pmserver_t { char *path; } pmserver_t; -struct __pmdownload_state_t { +struct __pmdownloadstate_t { // FIXME: change int to off_t when the download backend will permit that. int dst_size; }; diff --git a/src/pacman-g2/download.c b/src/pacman-g2/download.c index 35ead4d..ca6d9a4 100644 --- a/src/pacman-g2/download.c +++ b/src/pacman-g2/download.c @@ -53,9 +53,9 @@ extern config_t *config; extern unsigned int maxcols; /* FIXME: log10() want float */ -int log_progress(const pmdownload_state_t *download_state, int xfered, void *arg) +int log_progress(const pmdownloadstate_t *downloadstate, int xfered, void *arg) { - int fsz = pacman_download_state_size(download_state); + int fsz = pacman_downloadstate_size(downloadstate); int pct = ((float)(xfered+offset) / fsz) * 100; static int lastpct=0; unsigned int i, cur; diff --git a/src/pacman-g2/download.h b/src/pacman-g2/download.h index 151a2bf..81f4691 100644 --- a/src/pacman-g2/download.h +++ b/src/pacman-g2/download.h @@ -30,7 +30,7 @@ extern float rate; extern int xfered1; extern unsigned int eta_h, eta_m, eta_s, remain, howmany; -int log_progress(const pmdownload_state_t *download_state, int xfered, void *arg); +int log_progress(const pmdownloadstate_t *downloadstate, int xfered, void *arg); #endif /* _PM_DOWNLOAD_H */ _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git