Re: [sqlite] sqlite3StrICmp and sqlite3StrNICmp

2009-07-10 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[I changed the order of your questions]

Pierre Cart-Grandjean wrote:
> What is recommended to use 
> instead in the client application?

Those are internal undocumented SQLite functions.  For example you will
see that they are not part of the documented API at
http://sqlite.org/c3ref/funclist.html nor do they start with the prefix
of all of the api sqlite3_  (note the underscore).

The C library does have similar functions (eg stricmp) but because they
involve case insensitivity that brings in a whole host of i18n issues.
You'll need to decide what to do in your code and what you want to do
about the locale, what character set the data is in etc.  There is no
single answer for everyone.

> Why are those functions not extern anymore?

They are internal SQLite functions and so should not be used or relied
upon by non-SQLite code.  Internal functions can be changed or deleted
at any point.

There is also a case for internal SQLite functions to not "pollute"
whatever they are compiled with (eg a containing library/dll/so).  For
some developers such as myself this is very important:

  http://www.sqlite.org/cvstrac/tktview?tn=2554

I whine every time some are missed in new releases :-)  See the derived
tickets list at the bottom of that page.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpX1FkACgkQmOOfHg372QRPJwCgrItHAZOYegKjvBxhtKRtu8U1
qJIAn3brJaY/9gVYp4pgu+g9PPS00c0k
=5MwS
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3StrICmp and sqlite3StrNICmp

2009-07-10 Thread Pierre Cart-Grandjean
Hello,

In version 3.3.6 of sqlite, the functions sqlite3StrICmp and 
sqlite3StrNICmp were extern:

/usr/local/lib>nm -C libsqlite3.so | grep ICmp
0005c63c T sqlite3StrICmp
0005c744 T sqlite3StrNICmp
 
In more recent versions like the current one (3.6.16), those functions are 
intern:

/usr/local/lib>nm -C libsqlite3.so | grep ICmp
0005c63c t sqlite3StrICmp
0005c744 t sqlite3StrNICmp

This causes, for example, the current version of CVSTrac (v2.0.1 
28/01/2007)  to fail from compiling.

Why are those functions not extern anymore? What is recommended to use 
instead in the client application?

Thanks,
Pierre
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3StrICmp

2008-04-04 Thread Steven Fisher
On 04-Apr-2008, at 2:15 PM, Nicolas Williams wrote:
> Right, except for the thing about multiple columns with the same name
> being OK.

"AS"

>> 2. I need to use stricmp for comparing column names. I'd rather use
>> the same comparison that sqlite3 uses for comparing column NAMES.
>
> Why can't you use strcasecmp()?

Nothing, if you can guarantee me that:
strcasecmp( a, b ) == sqlite3StrICmp( a, b )
and
stricmp( a, b ) == sqlite3StrICmp( a, b )

...for all a, and all b, in the present version of sqlite3 and for all  
future versions of sqlite3, for all our current platforms and all  
platforms we'll ever deploy to.

Otherwise, I'd rather use the same code sqlite3 uses.

> IMO a SQLite-specific version of strcasecmp() is only really  
> valuable if
> it can deal with user-defined collations.  Otherwise what's the point?
> You already have straight strcasecmp() implementations elsewhere (even
> ones aware of UTF-8 and UTF-16).

See above. I'm not discounting the value of a comparison that deals  
with collations at all. That would be very useful. It's just not what  
I'm currently accessing sqlite3 internals for. I'm currently accessing  
them to find named columns. (I'd rather have a linker error than  
changed behaviour.)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users