Stephan Beal wrote, On 1/25/2012 11:01 AM:
On Wed, Jan 25, 2012 at 5:45 PM, Bill McCormick<wpmccorm...@gmail.com>wrote:

2. What will be void* argument be to the destructor?
3. What void* should the destructor return?


int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));


It doesn't return a (void *) - it returns void. The (*) is part of the
function pointer declaration. The last function takes a pointer to memory
to free, e.g. semantically compatible with free().

For the full description of the semantics of the final argument, see:

http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob
Ha! That's the full description that left me with my questions in the first place!!

though it is admittedly somewhat confusing that one passes a (char const *)
as opposed to (char *) even when expecting (depending on the value of the
last parameter) it to be freed.

Here's an example of its usage:

http://www.adp-gmbh.ch/sqlite/bind_insert.html
Ha!! That example doesn't use the destructor arg.
But it's OK; I think I can finger this out.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to