Ok again I've worked it after asking the question, sorry.

Answer is:

function print_key(key_::Ptr{Uint8}, key_length_::Ptr{Int8})
    key_length = unsafe_load(key_length_)
    key = bytestring(key_, key_length*4)
    println("jlkey: ", key)
    return nothing
end
const print_key_c = cfunction(print_key, Void, (Ptr{Uint8}, Ptr{Int8}))

Problem was I was confused about what a Union was, still can't find any 
clear documentation (as i said above it get mixed up with union) but I 
worked it it mean *either* of the types rather than some strange grouping 
of them.

The *4* is requied because the original string was Cwchar_t so 4 times the 
size. I'm not sure of the legitimacy of changing the pointer type from 
Ptr{Cwchar_t} to Ptr{Uint8} ??? but it seems to work

Reply via email to