The C function is 

int sqlite3_exec(
  sqlite3*,                                  /* An open database */
  const char *sql,                           /* SQL to be evaluated */
  int (*callback)(void*,int,char**,char**),  /* Callback function */
  void *,                                    /* 1st argument to callback */
  char **errmsg                              /* Error msg written here */
);

and the documention says: 

"The 3rd argument to the sqlite3_exec() callback is an array of pointers to 
strings ...."

My Julia function handed over for callback is

function printrow(::Ptr{Void}, ncol::Cint, rescolp::Ptr{Ptr{Uint8}}, 
colnmp::Ptr{Ptr{Uint8}})
     for k=1:ncol
          print("$(bytestring(unsafe_load(rescolp, k))) ")
     end
    println()
    cint(0)
end

When executing a test case I get "ERROR: function is not yet c-callable"

function printrow(::Ptr{Void}, ncol::Cint, rescolp::Ptr{Void}, 
colnmp::Ptr{Void})
   println("ncol = $ncol")
end

works, but I would of course like to print the strings themselves. Several 
of my efforts to use the Julia pointer_to_array, etc were  not successful.




Reply via email to