Beispiel #1
0
        /*
        ** 2005 May 23
        **
        ** The author disclaims copyright to this source code.  In place of
        ** a legal notice, here is a blessing:
        **
        **    May you do good and not evil.
        **    May you find forgiveness for yourself and forgive others.
        **    May you share freely, never taking more than you give.
        **
        *************************************************************************
        **
        ** This file contains functions used to access the internal hash tables
        ** of user defined functions and collation sequences.
        *************************************************************************
        **  Included in SQLite3 port to C#-SQLite;  2008 Noah B Hart
        **  C#-SQLite is an independent reimplementation of the SQLite software library
        **
        **  SQLITE_SOURCE_ID: 2011-05-19 13:26:54 ed1da510a239ea767a01dc332b667119fa3c908e
        **
        *************************************************************************
        */

        //#include "sqliteInt.h"

        /*
        ** Invoke the 'collation needed' callback to request a collation sequence
        ** in the encoding enc of name zName, length nName.
        */
        static void callCollNeeded(sqlite3 db, int enc, string zName)
        {
            Debug.Assert(db.xCollNeeded == null || db.xCollNeeded16 == null);
            if (db.xCollNeeded != null)
            {
                string zExternal = zName;// sqlite3DbStrDup(db, zName);
                if (zExternal == null)
                {
                    return;
                }
                db.xCollNeeded(db.pCollNeededArg, db, enc, zExternal);
                sqlite3DbFree(db, ref zExternal);
            }
#if !SQLITE_OMIT_UTF16
            if (db.xCollNeeded16 != null)
            {
                string        zExternal;
                sqlite3_value pTmp = sqlite3ValueNew(db);
                sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF8, SQLITE_STATIC);
                zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);
                if (zExternal != "")
                {
                    db.xCollNeeded16(db.pCollNeededArg, db, db.aDbStatic[0].pSchema.enc, zExternal);//(int)ENC(db), zExternal);
                }
                sqlite3ValueFree(ref pTmp);
            }
#endif
        }
Beispiel #2
0
    /*
    ** 2005 May 23
    **
    ** The author disclaims copyright to this source code.  In place of
    ** a legal notice, here is a blessing:
    **
    **    May you do good and not evil.
    **    May you find forgiveness for yourself and forgive others.
    **    May you share freely, never taking more than you give.
    **
    *************************************************************************
    **
    ** This file contains functions used to access the internal hash tables
    ** of user defined functions and collation sequences.
    **
    ** $Id: callback.c,v 1.42 2009/06/17 00:35:31 drh Exp $
    **
    *************************************************************************
    **  Included in SQLite3 port to C#-SQLite;  2008 Noah B Hart
    **  C#-SQLite is an independent reimplementation of the SQLite software library
    **
    **  $Header$
    *************************************************************************
    */

    //#include "sqliteInt.h"

    /*
    ** Invoke the 'collation needed' callback to request a collation sequence
    ** in the database text encoding of name zName, length nName.
    ** If the collation sequence
    */
    static void callCollNeeded( sqlite3 db, string zName )
    {
      Debug.Assert( db.xCollNeeded == null || db.xCollNeeded16 == null );
      if ( db.xCollNeeded != null )
      {
        string zExternal = zName;// sqlite3DbStrDup(db, zName);
        if ( zExternal == null ) return;
        db.xCollNeeded( db.pCollNeededArg, db, db.aDb[0].pSchema.enc, zExternal );//(int)ENC(db), zExternal);
        //sqlite3DbFree( db, ref  zExternal );
      }
#if !SQLITE_OMIT_UTF16
if( db.xCollNeeded16!=null ){
string zExternal;
sqlite3_value pTmp = sqlite3ValueNew(db);
sqlite3ValueSetStr(pTmp, -1, zName, SQLITE_UTF8, SQLITE_STATIC);
zExternal = sqlite3ValueText(pTmp, SQLITE_UTF16NATIVE);
if( zExternal!="" ){
db.xCollNeeded16( db.pCollNeededArg, db, db.aDbStatic[0].pSchema.enc, zExternal );//(int)ENC(db), zExternal);
}
sqlite3ValueFree(ref pTmp);
}
#endif
    }