Thanks.  I have  changed the use of sqlite3CreateFunc to
sqlite3_create_function.  I did not need to include the source code for
sqlite3utf8CharLen because there's a sqlite3Utf8CharLen (note different
capitalization) in the library.  However, the definition
of sqlite3ReadUtf8 and needed definitions READ_UTF8, xtra_utf8_bytes,
xtra_utf8_bits, utf_mask are not in 3.4.2, so I needed to
salvage from 3.3.13 source.  This compiles and loads OK, but I'm wondering
if there is a 3.4 way of doing what sqlite3ReadUtf8 did
so that I don't have to carry the definitions.   If anyone has a suggestion
I'd appreciate hearing about it.

Liam


On 8/31/07, Joe Wilson <[EMAIL PROTECTED]> wrote:
>
> --- Liam Healy <[EMAIL PROTECTED]> wrote:
> > I was the one who packaged up extension-functions.tgz and posted on
> > contrib.  I didn't author the original code but I'd like to fix this up.
> > I'm not clear on what needs to be changed.  I gather that
> sqlite3utf8CharLen
> > and sqlite3CreateFunc shouldn't be used.  I'm not sure how to convert to
> use
> > the external API.  Anyone have a pointer?
>
> See:
>
>   http://www.sqlite.org/capi3ref.html#sqlite3_create_function
>
>   http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions
>
> And include this statically in your code, if you require it:
>
> #define SQLITE_SKIP_UTF8(zIn) {                        \
>   if( (*(zIn++))>=0xc0 ){                              \
>     while( (*zIn & 0xc0)==0x80 ){ zIn++; }             \
>   }                                                    \
> }
>
> int sqlite3Utf8CharLen(const char *zIn, int nByte){
>   int r = 0;
>   const u8 *z = (const u8*)zIn;
>   const u8 *zTerm;
>   if( nByte>=0 ){
>     zTerm = &z[nByte];
>   }else{
>     zTerm = (const u8*)(-1);
>   }
>   assert( z<=zTerm );
>   while( *z!=0 && z<zTerm ){
>     SQLITE_SKIP_UTF8(z);
>     r++;
>   }
>   return r;
> }
>
>

Reply via email to