# The following was supposedly scribed by
# Eric Wilhelm
# on Saturday 21 August 2004 07:38 pm:

>Is there a "vgmp_printf" function?  Sounds like you'll need one.

Okay, there is gmp_vprintf(), but it isn't going to do you any good.

Looking at the minprintf() example in K&R's "The C Programming Language", it 
sounds like you're basically going to end up doing the same thing unless you 
can discover the non-portable tricks that everyone keeps talking about.

An excerpt of my adaptation:

  case 's':
    sv = va_arg(ap, SV *);
    if(! SvPOK(sv))
      croak("not a valid string\n");

I think va_list is absolutely the wrong way to go.  I've been messing with it 
a little and can't get even the SvPOK call above to not segfault.

Basically, my understanding is that the Inline_Stack_Vars macros take the 
place of the va_start and va_args, etc.

So, because you can't (portably) build a var-arg list at runtime, you're stuck 
refactoring or rewriting whatever C code you're trying to use (as in vprintf, 
etc.)

Maybe you'll have to step-through the format and use sprintf on each element, 
then printf the result.

Maybe you should just dynamically write some static code and use Inline::C in 
that way.

--Eric
-- 
"Cleanliness is next to impossible."
                                        --Unknown

Reply via email to