I am trying to have my Julia code communicate with an external program. The external program provides a C API for the inter-process communications. The documentation is a bit sparse but it says:
“Call flc_attach(NULL,0); at program startup.”
I’ve been using a Pluto notebook to try and learn about the @ccall macro. I’ve had good success calling c’s clock function with the line:
t2 = @ccall clock()::Int32
I’m having a hard time figuring out what type I need to pass as an argument to the flc_attach() function as well as what type it should return.
I’ve tried the following and get an error: “TypeError: in ccall method definition, expected Type, got a value of type Nothing”
flcomms = “~//Downloads//libflcomms.so”
NULL=Ptr{UInt8}(C_NULL)
@ccall flcomms.flcattach(NULL::C_NULL)::nothing
I have also tried
@ccall flcomms.flcattach(NULL::C_NULL)::Int8
in case the function returns a 1 or a 0 but then I get this error: “MethodError: no method matching cconvert(::Ptr{Nothing}, ::Ptr{UInt8})”
Sorry if this is overly basic. I use Julia because I do not know C.