httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: pre-patch: struct sockaddr_in error messages
Date Sat, 25 Oct 1997 07:21:41 GMT
Dean Gaudet wrote:
> We can replace both of these, and skirt the ap_snprintf debate, with a
> single core routine:
> 
>     int vformatter(int (*write_func)(void *data, const void *buf, size_t len),
>                     void *data, const char *format_string, va_list ap);
> 
> Which will naturally have a wrapper:
> 
>     int formatter(int (*write_func)(void *data, const void *buf, size_t len),
>                     void *data, const char *format_string, ...);
> 
> And then it can have wrappers for whatever other types of things we
> normally want to format into -- like BUFF *, constant length buffers,
> and dynamically allocated buffers.
> 
> POSIX doesn't give you anything like this, yet this is what we really
> need.  So we can't use what the operating system supplies.

I've been thinking about doing this in a vague sort of way for a long
time, so definitely +1.

BTW, C++ streams may solve these problems, but sometimes printf is what
you really want. Early C++s had a function "format()" which did the
necessary, but it seems to have gone out of style (because it was
dangerous).

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |Apache-SSL author
A.L. Digital Ltd,     |http://www.algroup.co.uk/Apache-SSL
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Mime
View raw message