Пример #1
0
    // The E parameter is what executes when there is an error, 
    // cannot implement here, since this is not really a macro
    // calling code must be modified to call E when truen

    //# define CODEC2(P,D,N,X,E,O) \
    //if( P.xCodec==0 ){ O=(char*)D; }else \
    //if( (O=(char*)(P.xCodec(P.pCodec,D,N,X)))==0 ){ E; }
    static bool CODEC2( Pager P, byte[] D, uint N, int X, ref byte[] O )
    {
      if ( P.xCodec == null )
      {
        O = D; // do nothing
        return false;
      }
      else
      {
        return ( ( O = P.xCodec( P.pCodec, D, N, X ) ) == null );
      }
    }
Пример #2
0
    /*
    ** A macro used for invoking the codec if there is one
    */

    // The E parameter is what executes when there is an error, 
    // cannot implement here, since this is not really a macro
    // calling code must be modified to call E when truen

#if SQLITE_HAS_CODEC
    //# define CODEC1(P,D,N,X,E) \
    //if( P.xCodec && P.xCodec(P.pCodec,D,N,X)==0 ){ E; }
    static bool CODEC1( Pager P, byte[] D, uint N /* page number */, int X /* E (moved to caller */)
    {
      return ( ( P.xCodec != null ) && ( P.xCodec( P.pCodec, D, N, X ) == null ) );
    }