Beispiel #1
0
        static public int Sqlitetest_mutex_Init(Tcl_Interp interp)
        {
            //static struct {
            //  string zName;
            //  Tcl_ObjCmdProc *xProc;
            //}
            _aObjCmd[] aCmd = new _aObjCmd[] {
                new _aObjCmd("sqlite3_shutdown", test_shutdown),
                new _aObjCmd("sqlite3_initialize", test_initialize),
                new _aObjCmd("sqlite3_config", test_config),

                new _aObjCmd("enter_db_mutex", test_enter_db_mutex),
                new _aObjCmd("leave_db_mutex", test_leave_db_mutex),

                new _aObjCmd("alloc_dealloc_mutex", test_alloc_mutex),
                new _aObjCmd("install_mutex_counters", test_install_mutex_counters),
                new _aObjCmd("read_mutex_counters", test_read_mutex_counters),
                new _aObjCmd("clear_mutex_counters", test_clear_mutex_counters),
            };
            int i;

            for (i = 0; i < aCmd.Length; i++)
            {//sizeof(aCmd)/sizeof(aCmd[0]); i++){
                TCL.Tcl_CreateObjCommand(interp, aCmd[i].zName, aCmd[i].xProc, null, null);
            }

            TCL.Tcl_LinkVar(interp, "disable_mutex_init", disableInit, VarFlags.SQLITE3_LINK_INT);
            //g.disableInit, VarFlags.SQLITE3_LINK_INT );
            TCL.Tcl_LinkVar(interp, "disable_mutex_try", disableTry, VarFlags.SQLITE3_LINK_INT);
            //g.disableTry, VarFlags.SQLITE3_LINK_INT );
            return(SQLITE_OK);
        }
Beispiel #2
0
        public static int Sqlitetest2_Init(Tcl_Interp interp)
        {
            //extern int sqlite3_io_error_persist;
            //extern int sqlite3_io_error_pending;
            //extern int sqlite3_io_error_hit;
            //extern int sqlite3_io_error_hardhit;
            //extern int sqlite3_diskfull_pending;
            //extern int sqlite3_diskfull;
            //extern int sqlite3_pager_n_sort_bucket;
            //static struct {
            //  char *zName;
            //  Tcl_CmdProc *xProc;
            //} aCmd[] = {
            _aCmd[] aCmd = new _aCmd[] {
//new _aCmd( "pager_open",              (Tcl_CmdProc)pager_open          ),
//new _aCmd( "pager_close",             (Tcl_CmdProc)pager_close         ),
//    { "pager_commit",            (Tcl_CmdProc*)pager_commit        },
//    { "pager_rollback",          (Tcl_CmdProc*)pager_rollback      },
//    { "pager_stmt_begin",        (Tcl_CmdProc*)pager_stmt_begin    },
//    { "pager_stmt_commit",       (Tcl_CmdProc*)pager_stmt_commit   },
//    { "pager_stmt_rollback",     (Tcl_CmdProc*)pager_stmt_rollback },
//    { "pager_stats",             (Tcl_CmdProc*)pager_stats         },
//    { "pager_pagecount",         (Tcl_CmdProc*)pager_pagecount     },
//    { "page_get",                (Tcl_CmdProc*)page_get            },
//    { "page_lookup",             (Tcl_CmdProc*)page_lookup         },
//    { "page_unref",              (Tcl_CmdProc*)page_unref          },
//    { "page_read",               (Tcl_CmdProc*)page_read           },
//    { "page_write",              (Tcl_CmdProc*)page_write          },
//    { "page_number",             (Tcl_CmdProc*)page_number         },
//    { "pager_truncate",          (Tcl_CmdProc*)pager_truncate      },
#if !SQLITE_OMIT_DISKIO
//    { "fake_big_file",           (Tcl_CmdProc*)fake_big_file       },
#endif
                new _aCmd("sqlite3BitvecBuiltinTest", (Tcl_CmdProc)testBitvecBuiltinTest),
                new _aCmd("sqlite3_test_control_pending_byte", (Tcl_CmdProc)testPendingByte),
            };
            int i;
            for (i = 0; i < aCmd.Length; i++)
            {//sizeof(aCmd)/sizeof(aCmd[0]); i++){
                TCL.Tcl_CreateCommand(interp, aCmd[i].zName, aCmd[i].xProc, null, null);
            }
            TCL.Tcl_LinkVar(interp, "sqlite_io_error_pending",
                            sqlite3_io_error_pending, VarFlags.SQLITE3_LINK_INT);
            TCL.Tcl_LinkVar(interp, "sqlite_io_error_persist",
                            sqlite3_io_error_persist, VarFlags.SQLITE3_LINK_INT);
            TCL.Tcl_LinkVar(interp, "sqlite_io_error_hit",
                            sqlite3_io_error_hit, VarFlags.SQLITE3_LINK_INT);
            TCL.Tcl_LinkVar(interp, "sqlite_io_error_hardhit",
                            sqlite3_io_error_hardhit, VarFlags.SQLITE3_LINK_INT);
            TCL.Tcl_LinkVar(interp, "sqlite_diskfull_pending",
                            sqlite3_diskfull_pending, VarFlags.SQLITE3_LINK_INT);
            TCL.Tcl_LinkVar(interp, "sqlite_diskfull",
                            sqlite3_diskfull, VarFlags.SQLITE3_LINK_INT);
            TCL.Tcl_LinkVar(interp, "sqlite_pending_byte",
                            TCLsqlite3PendingByte, VarFlags.SQLITE3_LINK_INT);
            TCLsqlite3PendingByte.iValue = sqlite3PendingByte;
            return(TCL.TCL_OK);
        }