Ejemplo n.º 1
0
        public static int Sqlitetest3_Init(Tcl_Interp interp)
        {
            _aCmd[] aCmd = new _aCmd[] {
                new _aCmd("btree_open", (Tcl_CmdProc)btree_open),
                new _aCmd("btree_close", (Tcl_CmdProc)btree_close),
                new _aCmd("btree_begin_transaction", (Tcl_CmdProc)btree_begin_transaction),
                new _aCmd("btree_pager_stats", (Tcl_CmdProc)btree_pager_stats),
                new _aCmd("btree_cursor", (Tcl_CmdProc)btree_cursor),
                new _aCmd("btree_close_cursor", (Tcl_CmdProc)btree_close_cursor),
                new _aCmd("btree_next", (Tcl_CmdProc)btree_next),
//new _aCmd( "btree_eof",                (Tcl_CmdProc)btree_eof                ),
                new _aCmd("btree_payload_size", (Tcl_CmdProc)btree_payload_size),
                new _aCmd("btree_first", (Tcl_CmdProc)btree_first),
                new _aCmd("btree_varint_test", (Tcl_CmdProc)btree_varint_test),
                new _aCmd("btree_from_db", (Tcl_CmdProc)btree_from_db),
                new _aCmd("btree_ismemdb", (Tcl_CmdProc)btree_ismemdb),
//new _aCmd( "btree_set_cache_size",     (Tcl_CmdProc)btree_set_cache_size     ),
            };
            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);
            }

            return(TCL.TCL_OK);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 /*
 ** Register the two TCL commands above with the TCL interpreter.
 */
 static public int Md5_Init(Tcl_Interp interp)
 {
     TCL.Tcl_CreateCommand(interp, "md5", md5_cmd, null, null);
     TCL.Tcl_CreateCommand(interp, "md5file", md5file_cmd, null, null);
     return(TCL.TCL_OK);
 }