Hallvard B Furuseth wrote:
>
> regis writes:
> > I think most functions modifying / returning a string
> > -- e.g. the function changing the letters to uppercase --
> > should allow the three following modes:
> >
> > 1) the output string is provided by the caller.
> > For most function, it should be allowed
> > that it is the input string itself.
> >
> > 2) the caller provide NULL for the result, and then
> > the function allocates the memory for the output.
> >
> > in both cases, the output is returned.
>
> That's an idea. I'll bring it up on comp.lang.c if you don't want to,
> in a couple of days. Unless the libclc discussion there takes off,
> then I'll delay it a bit.
By the way, it's a convention I was forced to use for my
bitset implementation, otherwise I would have three times
as many functions the current interface has. Since I believe it's
a general problem not restricted to bitsets, I signal
this issue to the implementators of the string module.
|