cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLcode_strerror

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 27 Feb 2004 23:59:59 -0800

On Sat, Feb 28, 2004 at 06:12:45PM +1100, Peter Miller wrote:
> I use libcurl in Aegis (http://aegis.sourceforge.net/) with great
> success.
>
> However, I missed the absence of a strerror(3) equivalent, and wrote one
> for use within Aegis. The problem is that it keeps going stale as more
> values are added to the CURLcode enum. So I thought I'd contribute the
> code to cURL, and when the authors extend the enum, they can extend the
> function.
>
> Please find attached a patch which defines two new functions:
> CURLcode_strerror and CURLMcode_strerror, named after the error types
> they address and also the ANSI strerror function.
>
> Also included are documentation updates to mention the two new functions
> in suitable man pages and other docs.

I suspect the reason something like this hasn't already been added is the
problem of i18n. At best, the error strings ought to be surrounded
by N_(...) so they can be translated, and at worst, libcurl should have
a dependency on libintl and carry with it a set of language files with
translated messages. That's a lot of complication and overhead for a few
short text strings, none of which a user will actually see in normal
operation. On the other hand, it shouldn't have to be the responsibility
of each application developer to keep his own set of error strings up
to date with each libcurl release, and putting them into libcurl is the
only way to accomplish that.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2004-02-28