curl-library
Re: max download/upload speed setting (libcurl, Delphi)
Date: Mon, 6 Jul 2009 23:12:02 +0200 (CEST)
On Mon, 6 Jul 2009, Jeff Pohlmeyer wrote:
>> The CURL_SIZEOF_CURL_OFF_T define should be usable for this. And the
>> CURL_TYPEOF_CURL_OFF_T define should be useful to figure out what "real"
>> type the curl_off_t is.
>
> But again, since the pascal compiler can't read curlbuild.h, I can't think
> of any way to generate a portable binding without access to the specific
> curlbuild.h file for each possible platform.
I assumed there was a piece of underlying C code that did some magic (in which
these defines could be used). I'll admit that was just a guess and I haven't
checked how this bindings works.
> Possibly the best approach for the pascal side is to define curl_off_t as
> int64 with a disclaimer in the docs saying the application must either use a
> DLL that is compatible with that definition, or redefine it to suit.
That might make sense yes. On most modern platforms it will be 64 bit.
> Another runtime approach that comes to mind is to use curl_version_info() to
> check if the CURL_VERSION_LARGEFILE bit is set, would that guarantee that we
> are using a 64bit curl_off_t ?
I think that is more strictly meant to signal the libraries ability to
actually use files larger than 4GB, which may at times not be exactly the same
as if the curl_off_t is 32 or 64bit.
Like libcurl can still do a range request to a remote server using 64bit
sizes, even if it can't actually save a file larger than 4GB.
-- / daniel.haxx.seReceived on 2009-07-06