예제 #1
0
        /*
        ** This function is called during initialization (sqlite3_initialize()) to
        ** install the default pluggable cache module, assuming the user has not
        ** already provided an alternative.
        */
        static void sqlite3PCacheSetDefault()
        {
            sqlite3_pcache_methods defaultMethods = new sqlite3_pcache_methods(
                0,                                /* pArg */
                (dxPC_Init)pcache1Init,           /* xInit */
                (dxPC_Shutdown)pcache1Shutdown,   /* xShutdown */
                (dxPC_Create)pcache1Create,       /* xCreate */
                (dxPC_Cachesize)pcache1Cachesize, /* xCachesize */
                (dxPC_Pagecount)pcache1Pagecount, /* xPagecount */
                (dxPC_Fetch)pcache1Fetch,         /* xFetch */
                (dxPC_Unpin)pcache1Unpin,         /* xUnpin */
                (dxPC_Rekey)pcache1Rekey,         /* xRekey */
                (dxPC_Truncate)pcache1Truncate,   /* xTruncate */
                (dxPC_Destroy)pcache1Destroy      /* xDestroy */
                );

            sqlite3_config(SQLITE_CONFIG_PCACHE, defaultMethods);
        }
예제 #2
0
        /*
        ** This function is called during initialization (sqlite3_initialize()) to
        ** install the default pluggable cache module, assuming the user has not
        ** already provided an alternative.
        */
        private static void sqlite3PCacheSetDefault()
        {
            var defaultMethods = new sqlite3_pcache_methods(
                0,                /* pArg */
                pcache1Init,      /* xInit */
                pcache1Shutdown,  /* xShutdown */
                pcache1Create,    /* xCreate */
                pcache1Cachesize, /* xCachesize */
                pcache1Pagecount, /* xPagecount */
                pcache1Fetch,     /* xFetch */
                pcache1Unpin,     /* xUnpin */
                pcache1Rekey,     /* xRekey */
                pcache1Truncate,  /* xTruncate */
                pcache1Destroy    /* xDestroy */
                );

            sqlite3_config(SQLITE_CONFIG_PCACHE, defaultMethods);
        }
예제 #3
0
파일: main_c.cs 프로젝트: seeseekey/CSCL
 static int sqlite3_config( int op, ref sqlite3_pcache_methods ap )
 {      //  va_list ap;
   int rc = SQLITE_OK;
   switch ( op )
   {
     case SQLITE_CONFIG_GETPCACHE:
       {
         if ( sqlite3GlobalConfig.pcache.xInit == null )
         {
           sqlite3PCacheSetDefault();
         }
         ap = sqlite3GlobalConfig.pcache;//va_arg(ap, sqlite3_pcache_methods) = sqlite3GlobalConfig.pcache;
         break;
       }
   }
   return rc;
 }
예제 #4
0
파일: main_c.cs 프로젝트: seeseekey/CSCL
 /*
 ** This API allows applications to modify the global configuration of
 ** the SQLite library at run-time.
 **
 ** This routine should only be called when there are no outstanding
 ** database connections or memory allocations.  This routine is not
 ** threadsafe.  Failure to heed these warnings can lead to unpredictable
 ** behavior.
 */
 // Overloads for ap assignments
 static int sqlite3_config( int op, sqlite3_pcache_methods ap )
 {      //  va_list ap;
   int rc = SQLITE_OK;
   switch ( op )
   {
     case SQLITE_CONFIG_PCACHE:
       {
         /* Specify an alternative malloc implementation */
         sqlite3GlobalConfig.pcache = ap; //sqlite3GlobalConfig.pcache = (sqlite3_pcache_methods)va_arg(ap, "sqlite3_pcache_methods");
         break;
       }
   }
   return rc;
 }
예제 #5
0
 /*
 ** This function is called during initialization (sqlite3_initialize()) to
 ** install the default pluggable cache module, assuming the user has not
 ** already provided an alternative.
 */
 static void sqlite3PCacheSetDefault()
 {
   sqlite3_pcache_methods defaultMethods = new sqlite3_pcache_methods(
   0,                                /* pArg */
   (dxPC_Init)pcache1Init,             /* xInit */
   (dxPC_Shutdown)pcache1Shutdown,  /* xShutdown */
   (dxPC_Create)pcache1Create,      /* xCreate */
   (dxPC_Cachesize)pcache1Cachesize,/* xCachesize */
   (dxPC_Pagecount)pcache1Pagecount,/* xPagecount */
   (dxPC_Fetch)pcache1Fetch,         /* xFetch */
   (dxPC_Unpin)pcache1Unpin,         /* xUnpin */
   (dxPC_Rekey)pcache1Rekey,         /* xRekey */
   (dxPC_Truncate)pcache1Truncate,   /* xTruncate */
   (dxPC_Destroy)pcache1Destroy      /* xDestroy */
   );
   sqlite3_config( SQLITE_CONFIG_PCACHE, defaultMethods );
 }