lua-users home
lua-l archive

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

On Aug 20, 2013, at 11:44 AM, Miles Bader <> wrote:
> POSIX printf actually _does_ support explicit
> parameter indexing (and I believe translation strings are indeed the
> motivator for this).
> I don't know how many printf implementations actually implement this
> feature, but GNU libc certainly does.

And for those that don't, I once wrote a library called snprintfv,
which is currently used by a few GNU projects for portability of all
POSIX specifiers to architectures that don't have native support.

Even for those that do, snprintfv also supports custom specifiers if
you want to have e.g. %S serialise and display a struct from the
calling program, or whatever else you might imagine.

The motivation for snprintfv was to provide a way to add support for
printf like string formatting in an interpreted language implemented
in C - something that cannot be done with POSIX printf and friends.

Gary V. Vaughan (gary AT vaughan DOT pe)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail