The wildcard callback is called before each transfer so it would
basically
say "here comes a new file". That means the previous file ended and it
would have to be closed, or similar. A bit awkward I'd say (especially
for
the last downloaded file). Possibly we should consider one callback
before
and one after each file.
I think it's a trade-off anyway. Such a "callback" can be easily
created on
the application level. Instead of setting a callback, the function may
just
be called from two places:
1. once from the "open" callback - to close the previously opened file
(+ ensure that closing a not opened file is noop)
2. as soon as the curl_easy_perform() finishes - to close the last one
I'd prefer to keep the interface as simple as possible. However it might
become more interesting if the "close" callback brought some extra info
with itself.
I don't know what information do you think? But yes, it may be more
flexible.
As for the name, WILDCARDFUNCTION does not sound generic enough to me.
What
about e.g. START_UNIT and eventually FINISH_UNIT (slightly inspired by
the
API for gcc plug-ins - http://gcc.gnu.org/onlinedocs/gccint/Plugins.html
)
Ok, it makes sense.
Pavel
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html