[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] [ANNOUNCE] First Leafnode-2.0 beta version



krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx (Cornelius Krasel) writes:

> I wrote:
> 
> [replacement for vsnprintf()]
> 
> > Mark Brown wrote:
> > > The BSDs will have an implementation - would their license not be
> > > liberal enough?
> > 
> > Sure. Leafnode is released under a BSDish license anyway. I'll have a
> > look ASAP.
> 
> After having looked I remember why I didn't choose this apparently
> obvious solution before. It has to do with the way snprintf() and
> vsnprintf() are implemented under BSD (I looked at NetBSD and OpenBSD).
> Both implementations seem to use internal quirks of the FILE stream
> which are not available under Linux.
> 
> Basically, snprintf() from OpenBSD looks like this:
> 
> snprintf(char *str, size_t n, char const *fmt, ...)
> {
>         int ret;
>         va_list ap;
>         FILE f;
> 
>         if ((int)n < 1)
>                 return (-1);
>         va_start(ap, fmt);
>         f._flags = __SWR | __SSTR;

That's the point where the Portability Axe[tm] strikes.

Note that neither of these implementations are compatible with the
BSD-free-giveaway license, regretfully.

Did you have a look at these sites:

LICENSE        SITE
------------------------------------------------------------------------
GNU GPL 2      http://www.oranda.demon.co.uk/development.html#snprintfv
Artistic-like  http://www.ijs.si/software/snprintf/
Artistic       http://www.qlue.com/downloads/c_utils_README.html

(I had www.google.com search for "snprintf replacement portable")?

Apart from providing a small snprintf package, the Slovenian (.si) site
has a lot of links to other snprintf implementations that I'm not
listing here.

-- 
Matthias Andree

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list