コード例 #1
0
ファイル: test_stat_c.cs プロジェクト: Jaden-J/csharp-sqlite
 static void statResetCsr( StatCursor pCsr )
 {
   int i;
   sqlite3_reset( pCsr.pStmt );
   for ( i = 0; i < ArraySize( pCsr.aPage ); i++ )
   {
     statClearPage( ref pCsr.aPage[i] );
   }
   pCsr.iPage = 0;
   //sqlite3_free(pCsr.zPath);
   pCsr.zPath = null;
 }
コード例 #2
0
ファイル: test_stat_c.cs プロジェクト: Jaden-J/csharp-sqlite
    /*
    ** Open a new statvfs cursor.
    */
    static int statOpen( sqlite3_vtab pVTab, out sqlite3_vtab_cursor ppCursor )
    {
      StatTable pTab = (StatTable)pVTab;
      StatCursor pCsr;
      int rc;

      pCsr = new StatCursor();//(StatCursor )sqlite3_malloc(sizeof(StatCursor));
      //memset(pCsr, 0, sizeof(StatCursor));
      pCsr.pVtab = pVTab;

      rc = sqlite3_prepare_v2( pTab.db,
          "SELECT 'sqlite_master' AS name, 1 AS rootpage, 'table' AS type" +
          "  UNION ALL  " +
          "SELECT name, rootpage, type FROM sqlite_master WHERE rootpage!=0" +
          "  ORDER BY name", -1,
          ref pCsr.pStmt, 0
      );
      if ( rc != SQLITE_OK )
      {
        pCsr = null;//sqlite3_free( pCsr );
        ppCursor = null;
        return rc;
      }

      ppCursor = (sqlite3_vtab_cursor)pCsr;
      return SQLITE_OK;
    }