vfprintf equivalent in D

2012-02-23 Thread Sarath Kumar
Hi, Is there an equivalent to vfprintf(const char *fmt, , va_list ap) in D? -- Thanks, Sarath

Re: vfprintf equivalent in D

2012-02-23 Thread Sarath Kumar
Thanks Jonathan and Teoh. I just have to pass the var args in my function to writefln and Variadic templates is the right solution for me. -- Thanks, Sarath

Passing opaque struct between functions/modules

2013-01-23 Thread Sarath Kumar
DMD v2.61; openSUSE 12.1 Source: --- libA.d: module libA; extern (C) { struct Opaque; Opaque* getObject(); void doSomething(Opaque *); } -- libB.d: module libB; extern (C) { struct Opaque; void doAction(Opaque *); } --- bug.d imp

Re: Passing opaque struct between functions/modules

2013-01-24 Thread Sarath Kumar
On Wednesday, 23 January 2013 at 17:14:31 UTC, Ali Çehreli wrote: On 01/23/2013 08:33 AM, Sarath Kumar wrote: > Can someone please tell me the right way to pass an opaque object > between module's functions. I am assuming that you are interfacing with a C library. That library mu

Re: Passing opaque struct between functions/modules

2013-01-24 Thread Sarath Kumar
On Thursday, 24 January 2013 at 09:04:09 UTC, Mike Parker wrote: The error message here is deceiving. Declare the struct in one module only and then import it in every module that uses it. So, for example, keep the declaration in libA, remove it from libB and in libB add "import libA;". I c

Re: Passing opaque struct between functions/modules

2013-01-24 Thread Sarath Kumar
On Thursday, 24 January 2013 at 11:52:57 UTC, Mike Parker wrote: The only potential bug I see here is in the error message. What you're seeing is a conflict that arises from D's name mangling. The doSomething in libA is expecting a parameter of type libA.Opaque* and getObject is returning the