Re: [sqlite] va_list
Christian Smith <csmith@...
2004-04-01 10:42:22 GMT
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.