Swift and C Interop

531 views Asked by At

I want to interoperate from Swift with the Firebird database. There is a function named fb_interpret with the following header.

SC_LONG ISC_EXPORT fb_interpret(ISC_SCHAR*,
                                 unsigned int,
                                 const ISC_STATUS**);

The first two parameters are clear for me, but the third I don't see how to write the pendant in swift. I tried a lot but always get a compile error on that line.

var status = [CLong](count: 20, repeatedValue: 0)
var buffer = [CChar](count: 1024, repeatedValue: 0)
let r = fb_interpret(&buffer, 0, &status)

I already know that isc_status is a

typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef intptr_t ISC_STATUS;
0

There are 0 answers