How can I call the following C function from Swift and what is its swift signature?
int search(const char * const input_words[])
This function expects the C Strings to be in EUC Japanese Encoding, which I already have in the required form. But how do I create an this C array of C string in swift?
I tried adapting the solution suggested in How to pass an array of Swift strings to a C function taking a char ** parameter :
let args = ["-c", "1.2.3.4", "-p", "8000"]
// Create [UnsafeMutablePointer<Int8>]:
var cargs = args.map { strdup($0) }
search(&cargs) // This gives me "Cannot invoke 'search'
// with an argument list of type '(inout
// Array<UnsafeMutablePointer<Int8>>)'".
Does XCode generates something where I can look it up? I looked in the Derived folder but did not find a thing. I have no idea what the swift signature of the function is and how to call it.