curl-library
Re: curl_mprintf questions
Date: Wed, 7 Jun 2006 00:27:32 +0200 (CEST)
On Fri, 2 Jun 2006, Mohun Biswas wrote:
> Q1: According to the README, curl_m*printf is deprecated in favor of
> curlx_m*printf. In order to use these it seems I must include
> "curl/curlx.h". But when I do so it then expects additional headers
> "curl/strequal.h", "curl/timeval.h", etc. These create additional conflicts;
> in particular the struct timeval declared conflicts with the version in
> <sys/time.h>. How can I cleanly use the curlx_* functions?
So it seems this isn't cleanly made yet so this needs fixing. This is not high
prio work for me.
> Q2: If I understand correctly, these mprintf functions are an early version
> of trio.
Yes, after I added this code to curl I and Bjorn Reese worked further on the
code and later used it in trio, in which we have further developed and fine
tuned the *printf() code.
If you want a truly fine and portable *printf() lib, trio is a good choice.
> The only documentation I can find is for trio, and that shows the following
> printing 42 in binary:
>
> trio_printf("|%10.8.2i|%10..2i|%..2i|", 42, 42, 42);
> | 00101010| 101010|101010|
>
> When I try this with curl_mprintf it fails:
Right, trio is not used within curl.
> So is the curl_mprintf suite capable of doing radix conversion or would I
> have to get trio separately?
I can't recall any radix conversion code present in libcurl.
> Which I'd rather not do due to the burden of building and maintaining it on
> lots of platforms, while I've already assumed that burden for libcurl (and
> happily, I might add, since curl is a great piece of work).
I'm quite sure trio is already pretty well maintained and portable enough, but
sure I do understand you rather use a lib you already use...
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2006-06-07