[pacman-dev] callback functions

Dan McGee dpmcgee at gmail.com
Wed May 14 20:46:12 EDT 2008


On Wed, May 14, 2008 at 4:46 AM, Xavier <shiningxc at gmail.com> wrote:
> 2008/5/14 Nagy Gabor <ngaba at bibl.u-szeged.hu>:
> About the dltotal thing, Dan indeed reverted it, but we need to add
> that feature back with another way.
> We currently have this callback :
> void cb_dl_progress(const char *filename, int xfered, int total)
> Dan suggested to add another one 2 days ago, I believe it was something like :
> void cb_dl_total_progress(int xfered, int total)
> But I already forgot. Dan, can you confirm this? :)

Yes, this is what I was thinking. The frontend(s) could then use these
two functions accordingly. Both would be called numerous times during
the download as they are now.

>>  In my opinion the parameters of callback functions should be reworked (warning,
>>  API change ;-). My preferred solution would be putting one param, a pointer to a
>>  complicated union or whatever, which can be accessed via
>>  alpm_info_get_xfered(ptr) etc. thus making it much more flexible. Thoughts?

I don't think this complexity is quite needed for the download
functions. Maybe the other functions later on though. Download we are
dealing with 4 numbers and a filename.

-Dan




More information about the pacman-dev mailing list