Re: D Bindings for C Opaque Pointers

2020-12-02 Thread Kyle Ingraham via Digitalmars-d-learn
On Thursday, 3 December 2020 at 01:19:05 UTC, bachmeier wrote: On Thursday, 3 December 2020 at 00:30:06 UTC, Kyle Ingraham wrote: What did I do wrong in constructing the bindings? If it helps the library provides a function called EdsRelease for cleaning-up allocated objects. Is the

Re: D Bindings for C Opaque Pointers

2020-12-02 Thread Kyle Ingraham via Digitalmars-d-learn
On Thursday, 3 December 2020 at 00:58:20 UTC, Paul Backus wrote: On Thursday, 3 December 2020 at 00:30:06 UTC, Kyle Ingraham wrote: // EDSDKTypes.h typedef struct __EdsObject* EdsBaseRef; typedef EdsBaseRef EdsCameraListRef; // [...] // edsdk.d struct EdsBaseRef; alias EdsBaseRef

Re: D Bindings for C Opaque Pointers

2020-12-02 Thread bachmeier via Digitalmars-d-learn
On Thursday, 3 December 2020 at 00:30:06 UTC, Kyle Ingraham wrote: What did I do wrong in constructing the bindings? If it helps the library provides a function called EdsRelease for cleaning-up allocated objects. Is the management of pointers between D and C the issue? Please forgive me if

Re: D Bindings for C Opaque Pointers

2020-12-02 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 3 December 2020 at 00:30:06 UTC, Kyle Ingraham wrote: // EDSDKTypes.h typedef struct __EdsObject* EdsBaseRef; typedef EdsBaseRef EdsCameraListRef; // [...] // edsdk.d struct EdsBaseRef; alias EdsBaseRef EdsCameraListRef; You've dropped a level of indirection here. In the C

D Bindings for C Opaque Pointers

2020-12-02 Thread Kyle Ingraham via Digitalmars-d-learn
Hello all. I am new to D and loving the experience so far. I am trying to make use of a C library from Canon that provides a header and a pre-compiled binary containing implementations of declarations found in the header. I used the excellent guide at