Hi Clemens,

> Ulrich Telle wrote:
> > In the comment of the sqlite3_bind_pointer() routine I found this note:
> >
> > The T parameter should be a static string, preferably a string literal.
> >
> > In my case this is quite cumbersome, since in my wrapper I have to extract
> > the value of parameter T from a temporary string object.
> 
> <http://www.sqlite.org/bindptr.html> says:
> | The "pointer type" string which is the last parameter to each of the
> | pointer-passing interfaces should be a distinct, application-specific
> | string literal that appears directly in the API call. The pointer type
> | should not be a parameter passed in from a higher-level function.
> 
> If you think that you really need to get this string from a higher-level
> function, offer a mechanism to 'register' this string, i.e., make
> a permanent copy that can be referenced by later calls.

Yes, I know I will have to do that to make things work, but it is really 
cumbersome, since I need a global object holding these 'registered' strings and 
have to take care that memory is cleaned up at some point in time. Doing it 
within SQLite would be much easier, since SQLite has to call the destructor 
function for the pointer (if it was given). So SQLite 'knows' when the pointer 
value goes out of scope ... and freeing the type string when checking whether 
the destructor function for the pointer has to be called or not, would probably 
be just one statement more in the SQLite source.

Regards,

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

Reply via email to