httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <>
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



Ben Laurie            |Phone: +44 (181) 735 0686|Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|
and Technical Director|Email: |Apache-SSL author
A.L. Digital Ltd,     |
London, England.      |"Apache: TDG"

View raw message