Williams, Kenneth (Ken) (TLR Corp) wrote:
Hey Rob,

One approach would be to use a wrapper wrapper:

use Inline C => <<'EOC';
  void c_printf(char *format, AV * arguments) {
    ...

It's the code that goes in here that I'm struggling with. There's no problem with passing the first argument to C's printf function, but how does one pass the arguments contained in the array reference to C's printf (or vprintf) function ? Is that also trivial ? I thought, initially, that I would be able to do that easily .... but I now realise that I don't know how to do it .... to the extent that I've just been sitting here looking at it, without really trying *anything* ....


  }
EOC

sub wrap_printf {
  my $format = shift;
  c_printf($format, [EMAIL PROTECTED]);
}

wrap_printf("%d\n", $x);
wrap_printf("%#o\n", $y);



Thanks Ken.

Cheers,
Rob



Reply via email to