I wrote a wrapper of C library. Here is one of C functions:
extern "C" bool start(char* nodeName)
and Julia equivalent:
export start
function start(nodeName::String)
ccall((:start, "libsimc.so"), Bool, (Cstring,), nodeName)
end
Rereading the manual, I noticed that ccall
should really be written as:
ccall((:start, "libsimc.so"), Cuchar, (Cstring,), nodeName)
i.e. Cuchar
instead of Bool
. Cuchar
and Bool
are both represented by one byte, but the types seem to be unrelated. Was I just lucky that my implementation seemed to work?