OLD | NEW |
1 /* | 1 /* |
2 ** 2010 April 7 | 2 ** 2010 April 7 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 demoCurrentTime, /* xCurrentTime */ | 634 demoCurrentTime, /* xCurrentTime */ |
635 }; | 635 }; |
636 return &demovfs; | 636 return &demovfs; |
637 } | 637 } |
638 | 638 |
639 #endif /* !defined(SQLITE_TEST) || SQLITE_OS_UNIX */ | 639 #endif /* !defined(SQLITE_TEST) || SQLITE_OS_UNIX */ |
640 | 640 |
641 | 641 |
642 #ifdef SQLITE_TEST | 642 #ifdef SQLITE_TEST |
643 | 643 |
644 #include <tcl.h> | 644 #if defined(INCLUDE_SQLITE_TCL_H) |
| 645 # include "sqlite_tcl.h" |
| 646 #else |
| 647 # include "tcl.h" |
| 648 # ifndef SQLITE_TCLAPI |
| 649 # define SQLITE_TCLAPI |
| 650 # endif |
| 651 #endif |
645 | 652 |
646 #if SQLITE_OS_UNIX | 653 #if SQLITE_OS_UNIX |
647 static int register_demovfs( | 654 static int SQLITE_TCLAPI register_demovfs( |
648 ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ | 655 ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ |
649 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ | 656 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ |
650 int objc, /* Number of arguments */ | 657 int objc, /* Number of arguments */ |
651 Tcl_Obj *CONST objv[] /* Command arguments */ | 658 Tcl_Obj *CONST objv[] /* Command arguments */ |
652 ){ | 659 ){ |
653 sqlite3_vfs_register(sqlite3_demovfs(), 1); | 660 sqlite3_vfs_register(sqlite3_demovfs(), 1); |
654 return TCL_OK; | 661 return TCL_OK; |
655 } | 662 } |
656 static int unregister_demovfs( | 663 static int SQLITE_TCLAPI unregister_demovfs( |
657 ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ | 664 ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ |
658 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ | 665 Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ |
659 int objc, /* Number of arguments */ | 666 int objc, /* Number of arguments */ |
660 Tcl_Obj *CONST objv[] /* Command arguments */ | 667 Tcl_Obj *CONST objv[] /* Command arguments */ |
661 ){ | 668 ){ |
662 sqlite3_vfs_unregister(sqlite3_demovfs()); | 669 sqlite3_vfs_unregister(sqlite3_demovfs()); |
663 return TCL_OK; | 670 return TCL_OK; |
664 } | 671 } |
665 | 672 |
666 /* | 673 /* |
667 ** Register commands with the TCL interpreter. | 674 ** Register commands with the TCL interpreter. |
668 */ | 675 */ |
669 int Sqlitetest_demovfs_Init(Tcl_Interp *interp){ | 676 int Sqlitetest_demovfs_Init(Tcl_Interp *interp){ |
670 Tcl_CreateObjCommand(interp, "register_demovfs", register_demovfs, 0, 0); | 677 Tcl_CreateObjCommand(interp, "register_demovfs", register_demovfs, 0, 0); |
671 Tcl_CreateObjCommand(interp, "unregister_demovfs", unregister_demovfs, 0, 0); | 678 Tcl_CreateObjCommand(interp, "unregister_demovfs", unregister_demovfs, 0, 0); |
672 return TCL_OK; | 679 return TCL_OK; |
673 } | 680 } |
674 | 681 |
675 #else | 682 #else |
676 int Sqlitetest_demovfs_Init(Tcl_Interp *interp){ return TCL_OK; } | 683 int Sqlitetest_demovfs_Init(Tcl_Interp *interp){ return TCL_OK; } |
677 #endif | 684 #endif |
678 | 685 |
679 #endif /* SQLITE_TEST */ | 686 #endif /* SQLITE_TEST */ |
OLD | NEW |