Hi Chris,
Thanks for your reply.  
I do have a different way of handling it in C# but I am passing the call on to the 
sqlite_vmprintf function (in printf.c and that accepts a va_list)
The way around it that I use is having a switch statement and if the use passes one 
parameter the I calls sqlite_vmprintf with one parame , if two it calls it with two 
and so on.  If I could build a va_list then I would built it and just call 
sqlite_vmprintf once.

anyway thanks
Greg
  ----- Original Message ----- 
  From: Christian Smith 
  To: Greg Obleshchuk 
  Cc: [EMAIL PROTECTED] 
  Sent: Thursday, April 01, 2004 8:42 PM
  Subject: Re: [sqlite] va_list


  On Thu, 1 Apr 2004, Greg Obleshchuk wrote:

  >Hi , Can anyone tell me if you can manually create a va_list object.  I
  >have in my wrapper now the sqlite_vmprintf function but as .NET doesn't
  >support the ... as a parameter I had to use a [ParamArray] .  Currently I
  >am testing the number of parameters passed and calling sqlite_vmprintf
  >different ways.  If I could create a va_list and just pass the object it
  >would be a one line call.

  va_list is an opaque type as far as the C standard is concerned.

  How it is implemented is a platform detail of the compiler, and should
  not be messed with.

  Looking at the gcc 3.3 stdarg.h on my Linux box, va_list isn't even a
  structure, but a typedef for an internal __gnuc_va_list type, which is
  manipulated by internal gcc functions.

  In other words, even if you think you know how a va_list is implemented on
  your platform, don't go there. A world of pain awaits.

  Instead, look at what you're using the va_list for. C generally needs it
  because it's string handling is poor and *printf is the easiest way to
  build strings from templates. By .NET I presume you're using C#, which
  should have proper strings and not need the *printf hacks used in C.


  >
  >thanks
  >Greg O


  Christian

  -- 
      /"\
      \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
       X                           - AGAINST MS ATTACHMENTS
      / \

Reply via email to