Fossil SCM
Merge updates from trunk.
Commit
fc1442ca6091eae75e749cc707f08ad66eae9af4
Parent
d0ef76037b16c87…
12 files changed
+12
-12
+1
-1
+1
-1
+29
-10
+3
-3
+3
-3
+2
-2
+1
-1
+1
-1
+1
-1
+1
-1
+1
-1
+12
-12
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -778,10 +778,13 @@ | ||
| 778 | 778 | } |
| 779 | 779 | } |
| 780 | 780 | assert(nCmd && "page list is empty?"); |
| 781 | 781 | multi_column_list(aCmd, nCmd); |
| 782 | 782 | } |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 783 | 786 | |
| 784 | 787 | /* |
| 785 | 788 | ** COMMAND: version |
| 786 | 789 | ** |
| 787 | 790 | ** Usage: %fossil version ?-verbose|-v? |
| @@ -803,27 +806,24 @@ | ||
| 803 | 806 | #endif |
| 804 | 807 | fossil_print("Compiled on %s %s using %s (%d-bit)\n", |
| 805 | 808 | __DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8); |
| 806 | 809 | fossil_print("SQLite %s %.30s\n", SQLITE_VERSION, SQLITE_SOURCE_ID); |
| 807 | 810 | fossil_print("Schema version %s\n", AUX_SCHEMA); |
| 808 | - fossil_print("zlib %s\n", ZLIB_VERSION); | |
| 811 | + fossil_print("zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion()); | |
| 809 | 812 | #if defined(FOSSIL_ENABLE_SSL) |
| 810 | 813 | fossil_print("SSL (%s)\n", OPENSSL_VERSION_TEXT); |
| 811 | 814 | #endif |
| 812 | 815 | #if defined(FOSSIL_ENABLE_TCL) |
| 813 | - Th_FossilInit(0, 0); | |
| 814 | - th_register_tcl(g.interp, &g.tcl); | |
| 815 | - rc = Th_Eval(g.interp, 0, "tclEval {package require Tcl}", -1); | |
| 816 | - zRc = Th_ReturnCodeName(rc, 1); | |
| 817 | - fossil_print("TCL (Tcl %s%s%s%s)\n", zRc, zRc ? ": " : "", | |
| 818 | - Th_GetResult(g.interp, 0), | |
| 816 | + Th_FossilInit(TH_INIT_DEFAULT | TH_INIT_FORCE_TCL); | |
| 817 | + rc = Th_Eval(g.interp, 0, "tclEval {info patchlevel}", -1); | |
| 818 | + zRc = Th_ReturnCodeName(rc, 0); | |
| 819 | + fossil_print("TCL (Tcl %s, loaded %s: %s)\n", | |
| 820 | + TCL_PATCH_LEVEL, zRc, Th_GetResult(g.interp, 0) | |
| 821 | + ); | |
| 822 | +#endif | |
| 819 | 823 | #if defined(FOSSIL_ENABLE_TCL_STUBS) |
| 820 | - zRc? "" : ", loaded only when needed" | |
| 821 | -#else | |
| 822 | - "" | |
| 823 | -#endif | |
| 824 | - ); | |
| 824 | + fossil_print("TCL_STUBS\n"); | |
| 825 | 825 | #endif |
| 826 | 826 | #if defined(FOSSIL_ENABLE_JSON) |
| 827 | 827 | fossil_print("JSON (API %s)\n", FOSSIL_JSON_API_VERSION); |
| 828 | 828 | #endif |
| 829 | 829 | } |
| 830 | 830 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -778,10 +778,13 @@ | |
| 778 | } |
| 779 | } |
| 780 | assert(nCmd && "page list is empty?"); |
| 781 | multi_column_list(aCmd, nCmd); |
| 782 | } |
| 783 | |
| 784 | /* |
| 785 | ** COMMAND: version |
| 786 | ** |
| 787 | ** Usage: %fossil version ?-verbose|-v? |
| @@ -803,27 +806,24 @@ | |
| 803 | #endif |
| 804 | fossil_print("Compiled on %s %s using %s (%d-bit)\n", |
| 805 | __DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8); |
| 806 | fossil_print("SQLite %s %.30s\n", SQLITE_VERSION, SQLITE_SOURCE_ID); |
| 807 | fossil_print("Schema version %s\n", AUX_SCHEMA); |
| 808 | fossil_print("zlib %s\n", ZLIB_VERSION); |
| 809 | #if defined(FOSSIL_ENABLE_SSL) |
| 810 | fossil_print("SSL (%s)\n", OPENSSL_VERSION_TEXT); |
| 811 | #endif |
| 812 | #if defined(FOSSIL_ENABLE_TCL) |
| 813 | Th_FossilInit(0, 0); |
| 814 | th_register_tcl(g.interp, &g.tcl); |
| 815 | rc = Th_Eval(g.interp, 0, "tclEval {package require Tcl}", -1); |
| 816 | zRc = Th_ReturnCodeName(rc, 1); |
| 817 | fossil_print("TCL (Tcl %s%s%s%s)\n", zRc, zRc ? ": " : "", |
| 818 | Th_GetResult(g.interp, 0), |
| 819 | #if defined(FOSSIL_ENABLE_TCL_STUBS) |
| 820 | zRc? "" : ", loaded only when needed" |
| 821 | #else |
| 822 | "" |
| 823 | #endif |
| 824 | ); |
| 825 | #endif |
| 826 | #if defined(FOSSIL_ENABLE_JSON) |
| 827 | fossil_print("JSON (API %s)\n", FOSSIL_JSON_API_VERSION); |
| 828 | #endif |
| 829 | } |
| 830 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -778,10 +778,13 @@ | |
| 778 | } |
| 779 | } |
| 780 | assert(nCmd && "page list is empty?"); |
| 781 | multi_column_list(aCmd, nCmd); |
| 782 | } |
| 783 | |
| 784 | |
| 785 | |
| 786 | |
| 787 | /* |
| 788 | ** COMMAND: version |
| 789 | ** |
| 790 | ** Usage: %fossil version ?-verbose|-v? |
| @@ -803,27 +806,24 @@ | |
| 806 | #endif |
| 807 | fossil_print("Compiled on %s %s using %s (%d-bit)\n", |
| 808 | __DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8); |
| 809 | fossil_print("SQLite %s %.30s\n", SQLITE_VERSION, SQLITE_SOURCE_ID); |
| 810 | fossil_print("Schema version %s\n", AUX_SCHEMA); |
| 811 | fossil_print("zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion()); |
| 812 | #if defined(FOSSIL_ENABLE_SSL) |
| 813 | fossil_print("SSL (%s)\n", OPENSSL_VERSION_TEXT); |
| 814 | #endif |
| 815 | #if defined(FOSSIL_ENABLE_TCL) |
| 816 | Th_FossilInit(TH_INIT_DEFAULT | TH_INIT_FORCE_TCL); |
| 817 | rc = Th_Eval(g.interp, 0, "tclEval {info patchlevel}", -1); |
| 818 | zRc = Th_ReturnCodeName(rc, 0); |
| 819 | fossil_print("TCL (Tcl %s, loaded %s: %s)\n", |
| 820 | TCL_PATCH_LEVEL, zRc, Th_GetResult(g.interp, 0) |
| 821 | ); |
| 822 | #endif |
| 823 | #if defined(FOSSIL_ENABLE_TCL_STUBS) |
| 824 | fossil_print("TCL_STUBS\n"); |
| 825 | #endif |
| 826 | #if defined(FOSSIL_ENABLE_JSON) |
| 827 | fossil_print("JSON (API %s)\n", FOSSIL_JSON_API_VERSION); |
| 828 | #endif |
| 829 | } |
| 830 |
+1
-1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -691,11 +691,11 @@ | ||
| 691 | 691 | zlib: |
| 692 | 692 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 693 | 693 | |
| 694 | 694 | openssl: zlib |
| 695 | 695 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 696 | - $(MAKE) -C $(OPENSSLLIBDIR) | |
| 696 | + $(MAKE) -C $(OPENSSLLIBDIR) build_libs | |
| 697 | 697 | |
| 698 | 698 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 699 | 699 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 700 | 700 | |
| 701 | 701 | # This rule prevents make from using its default rules to try build |
| 702 | 702 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -691,11 +691,11 @@ | |
| 691 | zlib: |
| 692 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 693 | |
| 694 | openssl: zlib |
| 695 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 696 | $(MAKE) -C $(OPENSSLLIBDIR) |
| 697 | |
| 698 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 699 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 700 | |
| 701 | # This rule prevents make from using its default rules to try build |
| 702 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -691,11 +691,11 @@ | |
| 691 | zlib: |
| 692 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 693 | |
| 694 | openssl: zlib |
| 695 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 696 | $(MAKE) -C $(OPENSSLLIBDIR) build_libs |
| 697 | |
| 698 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 699 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 700 | |
| 701 | # This rule prevents make from using its default rules to try build |
| 702 |
+1
-1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -691,11 +691,11 @@ | ||
| 691 | 691 | zlib: |
| 692 | 692 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 693 | 693 | |
| 694 | 694 | openssl: zlib |
| 695 | 695 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 696 | - $(MAKE) -C $(OPENSSLLIBDIR) | |
| 696 | + $(MAKE) -C $(OPENSSLLIBDIR) build_libs | |
| 697 | 697 | |
| 698 | 698 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 699 | 699 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 700 | 700 | |
| 701 | 701 | # This rule prevents make from using its default rules to try build |
| 702 | 702 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -691,11 +691,11 @@ | |
| 691 | zlib: |
| 692 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 693 | |
| 694 | openssl: zlib |
| 695 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 696 | $(MAKE) -C $(OPENSSLLIBDIR) |
| 697 | |
| 698 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 699 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 700 | |
| 701 | # This rule prevents make from using its default rules to try build |
| 702 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -691,11 +691,11 @@ | |
| 691 | zlib: |
| 692 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 693 | |
| 694 | openssl: zlib |
| 695 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 696 | $(MAKE) -C $(OPENSSLLIBDIR) build_libs |
| 697 | |
| 698 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 699 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 700 | |
| 701 | # This rule prevents make from using its default rules to try build |
| 702 |
+29
-10
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -20,10 +20,23 @@ | ||
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "th_main.h" |
| 23 | 23 | #include "sqlite3.h" |
| 24 | 24 | |
| 25 | +#if INTERFACE | |
| 26 | +/* | |
| 27 | +** Flag parameters to the Th_FossilInit() routine used to control the | |
| 28 | +** interpreter creation and initialization process. | |
| 29 | +*/ | |
| 30 | +#define TH_INIT_NONE ((u32)0x00000000) /* No flags. */ | |
| 31 | +#define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ | |
| 32 | +#define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ | |
| 33 | +#define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH commands re-added? */ | |
| 34 | +#define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ | |
| 35 | +#define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ | |
| 36 | +#endif | |
| 37 | + | |
| 25 | 38 | /* |
| 26 | 39 | ** Global variable counting the number of outstanding calls to malloc() |
| 27 | 40 | ** made by the th1 implementation. This is used to catch memory leaks |
| 28 | 41 | ** in the interpreter. Obviously, it also means th1 is not threadsafe. |
| 29 | 42 | */ |
| @@ -810,12 +823,16 @@ | ||
| 810 | 823 | ** Make sure the interpreter has been initialized. Initialize it if |
| 811 | 824 | ** it has not been already. |
| 812 | 825 | ** |
| 813 | 826 | ** The interpreter is stored in the g.interp global variable. |
| 814 | 827 | */ |
| 815 | -void Th_FossilInit(int needConfig, int forceSetup){ | |
| 828 | +void Th_FossilInit(u32 flags){ | |
| 816 | 829 | int wasInit = 0; |
| 830 | + int needConfig = flags & TH_INIT_NEED_CONFIG; | |
| 831 | + int forceReset = flags & TH_INIT_FORCE_RESET; | |
| 832 | + int forceTcl = flags & TH_INIT_FORCE_TCL; | |
| 833 | + int forceSetup = flags & TH_INIT_FORCE_SETUP; | |
| 817 | 834 | static unsigned int aFlags[] = { 0, 1, WIKI_LINKSONLY }; |
| 818 | 835 | static struct _Command { |
| 819 | 836 | const char *zName; |
| 820 | 837 | Th_CommandProc xProc; |
| 821 | 838 | void *pContext; |
| @@ -850,16 +867,18 @@ | ||
| 850 | 867 | ** the necessary database connections are open prior to continuing. |
| 851 | 868 | */ |
| 852 | 869 | db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0); |
| 853 | 870 | db_open_config(0); |
| 854 | 871 | } |
| 855 | - if( g.interp==0 ){ | |
| 872 | + if( forceReset || forceTcl || g.interp==0 ){ | |
| 856 | 873 | int i; |
| 857 | - g.interp = Th_CreateInterp(&vtab); | |
| 858 | - th_register_language(g.interp); /* Basic scripting commands. */ | |
| 874 | + if( g.interp==0 ) g.interp = Th_CreateInterp(&vtab); | |
| 875 | + if( forceReset || g.interp==0 ){ | |
| 876 | + th_register_language(g.interp); /* Basic scripting commands. */ | |
| 877 | + } | |
| 859 | 878 | #ifdef FOSSIL_ENABLE_TCL |
| 860 | - if( getenv("TH1_ENABLE_TCL")!=0 || db_get_boolean("tcl", 0) ){ | |
| 879 | + if( forceTcl || getenv("TH1_ENABLE_TCL")!=0 || db_get_boolean("tcl", 0) ){ | |
| 861 | 880 | if( !g.tcl.setup ){ |
| 862 | 881 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 863 | 882 | } |
| 864 | 883 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 865 | 884 | } |
| @@ -894,11 +913,11 @@ | ||
| 894 | 913 | |
| 895 | 914 | /* |
| 896 | 915 | ** Store a string value in a variable in the interpreter. |
| 897 | 916 | */ |
| 898 | 917 | void Th_Store(const char *zName, const char *zValue){ |
| 899 | - Th_FossilInit(0, 0); | |
| 918 | + Th_FossilInit(TH_INIT_DEFAULT); | |
| 900 | 919 | if( zValue ){ |
| 901 | 920 | if( g.thTrace ){ |
| 902 | 921 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| 903 | 922 | } |
| 904 | 923 | Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue)); |
| @@ -909,11 +928,11 @@ | ||
| 909 | 928 | ** Store an integer value in a variable in the interpreter. |
| 910 | 929 | */ |
| 911 | 930 | void Th_StoreInt(const char *zName, int iValue){ |
| 912 | 931 | Blob value; |
| 913 | 932 | char *zValue; |
| 914 | - Th_FossilInit(0, 0); | |
| 933 | + Th_FossilInit(TH_INIT_DEFAULT); | |
| 915 | 934 | blob_zero(&value); |
| 916 | 935 | blob_appendf(&value, "%d", iValue); |
| 917 | 936 | zValue = blob_str(&value); |
| 918 | 937 | if( g.thTrace ){ |
| 919 | 938 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| @@ -935,11 +954,11 @@ | ||
| 935 | 954 | ** Retrieve a string value from the interpreter. If no such |
| 936 | 955 | ** variable exists, return NULL. |
| 937 | 956 | */ |
| 938 | 957 | char *Th_Fetch(const char *zName, int *pSize){ |
| 939 | 958 | int rc; |
| 940 | - Th_FossilInit(0, 0); | |
| 959 | + Th_FossilInit(TH_INIT_DEFAULT); | |
| 941 | 960 | rc = Th_GetVar(g.interp, (char*)zName, -1); |
| 942 | 961 | if( rc==TH_OK ){ |
| 943 | 962 | return (char*)Th_GetResult(g.interp, pSize); |
| 944 | 963 | }else{ |
| 945 | 964 | return 0; |
| @@ -1015,11 +1034,11 @@ | ||
| 1015 | 1034 | int Th_Render(const char *z){ |
| 1016 | 1035 | int i = 0; |
| 1017 | 1036 | int n; |
| 1018 | 1037 | int rc = TH_OK; |
| 1019 | 1038 | char *zResult; |
| 1020 | - Th_FossilInit(0, 0); | |
| 1039 | + Th_FossilInit(TH_INIT_DEFAULT); | |
| 1021 | 1040 | while( z[i] ){ |
| 1022 | 1041 | if( z[i]=='$' && (n = validVarName(&z[i+1]))>0 ){ |
| 1023 | 1042 | const char *zVar; |
| 1024 | 1043 | int nVar; |
| 1025 | 1044 | int encode = 1; |
| @@ -1095,11 +1114,11 @@ | ||
| 1095 | 1114 | db_open_config(0); |
| 1096 | 1115 | } |
| 1097 | 1116 | if( g.argc!=3 ){ |
| 1098 | 1117 | usage("script"); |
| 1099 | 1118 | } |
| 1100 | - Th_FossilInit(0, 0); | |
| 1119 | + Th_FossilInit(TH_INIT_DEFAULT); | |
| 1101 | 1120 | rc = Th_Eval(g.interp, 0, g.argv[2], -1); |
| 1102 | 1121 | zRc = Th_ReturnCodeName(rc, 1); |
| 1103 | 1122 | fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0)); |
| 1104 | 1123 | Th_PrintTraceLog(); |
| 1105 | 1124 | } |
| 1106 | 1125 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -20,10 +20,23 @@ | |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "th_main.h" |
| 23 | #include "sqlite3.h" |
| 24 | |
| 25 | /* |
| 26 | ** Global variable counting the number of outstanding calls to malloc() |
| 27 | ** made by the th1 implementation. This is used to catch memory leaks |
| 28 | ** in the interpreter. Obviously, it also means th1 is not threadsafe. |
| 29 | */ |
| @@ -810,12 +823,16 @@ | |
| 810 | ** Make sure the interpreter has been initialized. Initialize it if |
| 811 | ** it has not been already. |
| 812 | ** |
| 813 | ** The interpreter is stored in the g.interp global variable. |
| 814 | */ |
| 815 | void Th_FossilInit(int needConfig, int forceSetup){ |
| 816 | int wasInit = 0; |
| 817 | static unsigned int aFlags[] = { 0, 1, WIKI_LINKSONLY }; |
| 818 | static struct _Command { |
| 819 | const char *zName; |
| 820 | Th_CommandProc xProc; |
| 821 | void *pContext; |
| @@ -850,16 +867,18 @@ | |
| 850 | ** the necessary database connections are open prior to continuing. |
| 851 | */ |
| 852 | db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0); |
| 853 | db_open_config(0); |
| 854 | } |
| 855 | if( g.interp==0 ){ |
| 856 | int i; |
| 857 | g.interp = Th_CreateInterp(&vtab); |
| 858 | th_register_language(g.interp); /* Basic scripting commands. */ |
| 859 | #ifdef FOSSIL_ENABLE_TCL |
| 860 | if( getenv("TH1_ENABLE_TCL")!=0 || db_get_boolean("tcl", 0) ){ |
| 861 | if( !g.tcl.setup ){ |
| 862 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 863 | } |
| 864 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 865 | } |
| @@ -894,11 +913,11 @@ | |
| 894 | |
| 895 | /* |
| 896 | ** Store a string value in a variable in the interpreter. |
| 897 | */ |
| 898 | void Th_Store(const char *zName, const char *zValue){ |
| 899 | Th_FossilInit(0, 0); |
| 900 | if( zValue ){ |
| 901 | if( g.thTrace ){ |
| 902 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| 903 | } |
| 904 | Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue)); |
| @@ -909,11 +928,11 @@ | |
| 909 | ** Store an integer value in a variable in the interpreter. |
| 910 | */ |
| 911 | void Th_StoreInt(const char *zName, int iValue){ |
| 912 | Blob value; |
| 913 | char *zValue; |
| 914 | Th_FossilInit(0, 0); |
| 915 | blob_zero(&value); |
| 916 | blob_appendf(&value, "%d", iValue); |
| 917 | zValue = blob_str(&value); |
| 918 | if( g.thTrace ){ |
| 919 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| @@ -935,11 +954,11 @@ | |
| 935 | ** Retrieve a string value from the interpreter. If no such |
| 936 | ** variable exists, return NULL. |
| 937 | */ |
| 938 | char *Th_Fetch(const char *zName, int *pSize){ |
| 939 | int rc; |
| 940 | Th_FossilInit(0, 0); |
| 941 | rc = Th_GetVar(g.interp, (char*)zName, -1); |
| 942 | if( rc==TH_OK ){ |
| 943 | return (char*)Th_GetResult(g.interp, pSize); |
| 944 | }else{ |
| 945 | return 0; |
| @@ -1015,11 +1034,11 @@ | |
| 1015 | int Th_Render(const char *z){ |
| 1016 | int i = 0; |
| 1017 | int n; |
| 1018 | int rc = TH_OK; |
| 1019 | char *zResult; |
| 1020 | Th_FossilInit(0, 0); |
| 1021 | while( z[i] ){ |
| 1022 | if( z[i]=='$' && (n = validVarName(&z[i+1]))>0 ){ |
| 1023 | const char *zVar; |
| 1024 | int nVar; |
| 1025 | int encode = 1; |
| @@ -1095,11 +1114,11 @@ | |
| 1095 | db_open_config(0); |
| 1096 | } |
| 1097 | if( g.argc!=3 ){ |
| 1098 | usage("script"); |
| 1099 | } |
| 1100 | Th_FossilInit(0, 0); |
| 1101 | rc = Th_Eval(g.interp, 0, g.argv[2], -1); |
| 1102 | zRc = Th_ReturnCodeName(rc, 1); |
| 1103 | fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0)); |
| 1104 | Th_PrintTraceLog(); |
| 1105 | } |
| 1106 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -20,10 +20,23 @@ | |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "th_main.h" |
| 23 | #include "sqlite3.h" |
| 24 | |
| 25 | #if INTERFACE |
| 26 | /* |
| 27 | ** Flag parameters to the Th_FossilInit() routine used to control the |
| 28 | ** interpreter creation and initialization process. |
| 29 | */ |
| 30 | #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */ |
| 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH commands re-added? */ |
| 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ |
| 36 | #endif |
| 37 | |
| 38 | /* |
| 39 | ** Global variable counting the number of outstanding calls to malloc() |
| 40 | ** made by the th1 implementation. This is used to catch memory leaks |
| 41 | ** in the interpreter. Obviously, it also means th1 is not threadsafe. |
| 42 | */ |
| @@ -810,12 +823,16 @@ | |
| 823 | ** Make sure the interpreter has been initialized. Initialize it if |
| 824 | ** it has not been already. |
| 825 | ** |
| 826 | ** The interpreter is stored in the g.interp global variable. |
| 827 | */ |
| 828 | void Th_FossilInit(u32 flags){ |
| 829 | int wasInit = 0; |
| 830 | int needConfig = flags & TH_INIT_NEED_CONFIG; |
| 831 | int forceReset = flags & TH_INIT_FORCE_RESET; |
| 832 | int forceTcl = flags & TH_INIT_FORCE_TCL; |
| 833 | int forceSetup = flags & TH_INIT_FORCE_SETUP; |
| 834 | static unsigned int aFlags[] = { 0, 1, WIKI_LINKSONLY }; |
| 835 | static struct _Command { |
| 836 | const char *zName; |
| 837 | Th_CommandProc xProc; |
| 838 | void *pContext; |
| @@ -850,16 +867,18 @@ | |
| 867 | ** the necessary database connections are open prior to continuing. |
| 868 | */ |
| 869 | db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0); |
| 870 | db_open_config(0); |
| 871 | } |
| 872 | if( forceReset || forceTcl || g.interp==0 ){ |
| 873 | int i; |
| 874 | if( g.interp==0 ) g.interp = Th_CreateInterp(&vtab); |
| 875 | if( forceReset || g.interp==0 ){ |
| 876 | th_register_language(g.interp); /* Basic scripting commands. */ |
| 877 | } |
| 878 | #ifdef FOSSIL_ENABLE_TCL |
| 879 | if( forceTcl || getenv("TH1_ENABLE_TCL")!=0 || db_get_boolean("tcl", 0) ){ |
| 880 | if( !g.tcl.setup ){ |
| 881 | g.tcl.setup = db_get("tcl-setup", 0); /* Grab Tcl setup script. */ |
| 882 | } |
| 883 | th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ |
| 884 | } |
| @@ -894,11 +913,11 @@ | |
| 913 | |
| 914 | /* |
| 915 | ** Store a string value in a variable in the interpreter. |
| 916 | */ |
| 917 | void Th_Store(const char *zName, const char *zValue){ |
| 918 | Th_FossilInit(TH_INIT_DEFAULT); |
| 919 | if( zValue ){ |
| 920 | if( g.thTrace ){ |
| 921 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| 922 | } |
| 923 | Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue)); |
| @@ -909,11 +928,11 @@ | |
| 928 | ** Store an integer value in a variable in the interpreter. |
| 929 | */ |
| 930 | void Th_StoreInt(const char *zName, int iValue){ |
| 931 | Blob value; |
| 932 | char *zValue; |
| 933 | Th_FossilInit(TH_INIT_DEFAULT); |
| 934 | blob_zero(&value); |
| 935 | blob_appendf(&value, "%d", iValue); |
| 936 | zValue = blob_str(&value); |
| 937 | if( g.thTrace ){ |
| 938 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| @@ -935,11 +954,11 @@ | |
| 954 | ** Retrieve a string value from the interpreter. If no such |
| 955 | ** variable exists, return NULL. |
| 956 | */ |
| 957 | char *Th_Fetch(const char *zName, int *pSize){ |
| 958 | int rc; |
| 959 | Th_FossilInit(TH_INIT_DEFAULT); |
| 960 | rc = Th_GetVar(g.interp, (char*)zName, -1); |
| 961 | if( rc==TH_OK ){ |
| 962 | return (char*)Th_GetResult(g.interp, pSize); |
| 963 | }else{ |
| 964 | return 0; |
| @@ -1015,11 +1034,11 @@ | |
| 1034 | int Th_Render(const char *z){ |
| 1035 | int i = 0; |
| 1036 | int n; |
| 1037 | int rc = TH_OK; |
| 1038 | char *zResult; |
| 1039 | Th_FossilInit(TH_INIT_DEFAULT); |
| 1040 | while( z[i] ){ |
| 1041 | if( z[i]=='$' && (n = validVarName(&z[i+1]))>0 ){ |
| 1042 | const char *zVar; |
| 1043 | int nVar; |
| 1044 | int encode = 1; |
| @@ -1095,11 +1114,11 @@ | |
| 1114 | db_open_config(0); |
| 1115 | } |
| 1116 | if( g.argc!=3 ){ |
| 1117 | usage("script"); |
| 1118 | } |
| 1119 | Th_FossilInit(TH_INIT_DEFAULT); |
| 1120 | rc = Th_Eval(g.interp, 0, g.argv[2], -1); |
| 1121 | zRc = Th_ReturnCodeName(rc, 1); |
| 1122 | fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0)); |
| 1123 | Th_PrintTraceLog(); |
| 1124 | } |
| 1125 |
+3
-3
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -136,11 +136,11 @@ | ||
| 136 | 136 | ** when the Tcl library is being loaded dynamically by a stubs-enabled |
| 137 | 137 | ** application (i.e. the inverse of using a stubs-enabled package). These are |
| 138 | 138 | ** the only Tcl API functions that MUST be called prior to being able to call |
| 139 | 139 | ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). |
| 140 | 140 | */ |
| 141 | -typedef void (tcl_FindExecutableProc) (CONST char * argv0); | |
| 141 | +typedef void (tcl_FindExecutableProc) (const char * argv0); | |
| 142 | 142 | typedef Tcl_Interp *(tcl_CreateInterpProc) (void); |
| 143 | 143 | |
| 144 | 144 | /* |
| 145 | 145 | ** The function types for the "hook" functions to be called before and after a |
| 146 | 146 | ** TH1 command makes a call to evaluate a Tcl script. If the "pre" function |
| @@ -436,11 +436,11 @@ | ||
| 436 | 436 | */ |
| 437 | 437 | static int Th1EvalObjCmd( |
| 438 | 438 | ClientData clientData, |
| 439 | 439 | Tcl_Interp *interp, |
| 440 | 440 | int objc, |
| 441 | - Tcl_Obj *CONST objv[] | |
| 441 | + Tcl_Obj *const objv[] | |
| 442 | 442 | ){ |
| 443 | 443 | Th_Interp *th1Interp; |
| 444 | 444 | int nArg; |
| 445 | 445 | const char *arg; |
| 446 | 446 | int rc; |
| @@ -468,11 +468,11 @@ | ||
| 468 | 468 | */ |
| 469 | 469 | static int Th1ExprObjCmd( |
| 470 | 470 | ClientData clientData, |
| 471 | 471 | Tcl_Interp *interp, |
| 472 | 472 | int objc, |
| 473 | - Tcl_Obj *CONST objv[] | |
| 473 | + Tcl_Obj *const objv[] | |
| 474 | 474 | ){ |
| 475 | 475 | Th_Interp *th1Interp; |
| 476 | 476 | int nArg; |
| 477 | 477 | const char *arg; |
| 478 | 478 | int rc; |
| 479 | 479 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -136,11 +136,11 @@ | |
| 136 | ** when the Tcl library is being loaded dynamically by a stubs-enabled |
| 137 | ** application (i.e. the inverse of using a stubs-enabled package). These are |
| 138 | ** the only Tcl API functions that MUST be called prior to being able to call |
| 139 | ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). |
| 140 | */ |
| 141 | typedef void (tcl_FindExecutableProc) (CONST char * argv0); |
| 142 | typedef Tcl_Interp *(tcl_CreateInterpProc) (void); |
| 143 | |
| 144 | /* |
| 145 | ** The function types for the "hook" functions to be called before and after a |
| 146 | ** TH1 command makes a call to evaluate a Tcl script. If the "pre" function |
| @@ -436,11 +436,11 @@ | |
| 436 | */ |
| 437 | static int Th1EvalObjCmd( |
| 438 | ClientData clientData, |
| 439 | Tcl_Interp *interp, |
| 440 | int objc, |
| 441 | Tcl_Obj *CONST objv[] |
| 442 | ){ |
| 443 | Th_Interp *th1Interp; |
| 444 | int nArg; |
| 445 | const char *arg; |
| 446 | int rc; |
| @@ -468,11 +468,11 @@ | |
| 468 | */ |
| 469 | static int Th1ExprObjCmd( |
| 470 | ClientData clientData, |
| 471 | Tcl_Interp *interp, |
| 472 | int objc, |
| 473 | Tcl_Obj *CONST objv[] |
| 474 | ){ |
| 475 | Th_Interp *th1Interp; |
| 476 | int nArg; |
| 477 | const char *arg; |
| 478 | int rc; |
| 479 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -136,11 +136,11 @@ | |
| 136 | ** when the Tcl library is being loaded dynamically by a stubs-enabled |
| 137 | ** application (i.e. the inverse of using a stubs-enabled package). These are |
| 138 | ** the only Tcl API functions that MUST be called prior to being able to call |
| 139 | ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). |
| 140 | */ |
| 141 | typedef void (tcl_FindExecutableProc) (const char * argv0); |
| 142 | typedef Tcl_Interp *(tcl_CreateInterpProc) (void); |
| 143 | |
| 144 | /* |
| 145 | ** The function types for the "hook" functions to be called before and after a |
| 146 | ** TH1 command makes a call to evaluate a Tcl script. If the "pre" function |
| @@ -436,11 +436,11 @@ | |
| 436 | */ |
| 437 | static int Th1EvalObjCmd( |
| 438 | ClientData clientData, |
| 439 | Tcl_Interp *interp, |
| 440 | int objc, |
| 441 | Tcl_Obj *const objv[] |
| 442 | ){ |
| 443 | Th_Interp *th1Interp; |
| 444 | int nArg; |
| 445 | const char *arg; |
| 446 | int rc; |
| @@ -468,11 +468,11 @@ | |
| 468 | */ |
| 469 | static int Th1ExprObjCmd( |
| 470 | ClientData clientData, |
| 471 | Tcl_Interp *interp, |
| 472 | int objc, |
| 473 | Tcl_Obj *const objv[] |
| 474 | ){ |
| 475 | Th_Interp *th1Interp; |
| 476 | int nArg; |
| 477 | const char *arg; |
| 478 | int rc; |
| 479 |
+3
-3
| --- src/th_tcl.c | ||
| +++ src/th_tcl.c | ||
| @@ -136,11 +136,11 @@ | ||
| 136 | 136 | ** when the Tcl library is being loaded dynamically by a stubs-enabled |
| 137 | 137 | ** application (i.e. the inverse of using a stubs-enabled package). These are |
| 138 | 138 | ** the only Tcl API functions that MUST be called prior to being able to call |
| 139 | 139 | ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). |
| 140 | 140 | */ |
| 141 | -typedef void (tcl_FindExecutableProc) (CONST char * argv0); | |
| 141 | +typedef void (tcl_FindExecutableProc) (const char * argv0); | |
| 142 | 142 | typedef Tcl_Interp *(tcl_CreateInterpProc) (void); |
| 143 | 143 | |
| 144 | 144 | /* |
| 145 | 145 | ** The function types for the "hook" functions to be called before and after a |
| 146 | 146 | ** TH1 command makes a call to evaluate a Tcl script. If the "pre" function |
| @@ -436,11 +436,11 @@ | ||
| 436 | 436 | */ |
| 437 | 437 | static int Th1EvalObjCmd( |
| 438 | 438 | ClientData clientData, |
| 439 | 439 | Tcl_Interp *interp, |
| 440 | 440 | int objc, |
| 441 | - Tcl_Obj *CONST objv[] | |
| 441 | + Tcl_Obj *const objv[] | |
| 442 | 442 | ){ |
| 443 | 443 | Th_Interp *th1Interp; |
| 444 | 444 | int nArg; |
| 445 | 445 | const char *arg; |
| 446 | 446 | int rc; |
| @@ -468,11 +468,11 @@ | ||
| 468 | 468 | */ |
| 469 | 469 | static int Th1ExprObjCmd( |
| 470 | 470 | ClientData clientData, |
| 471 | 471 | Tcl_Interp *interp, |
| 472 | 472 | int objc, |
| 473 | - Tcl_Obj *CONST objv[] | |
| 473 | + Tcl_Obj *const objv[] | |
| 474 | 474 | ){ |
| 475 | 475 | Th_Interp *th1Interp; |
| 476 | 476 | int nArg; |
| 477 | 477 | const char *arg; |
| 478 | 478 | int rc; |
| 479 | 479 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -136,11 +136,11 @@ | |
| 136 | ** when the Tcl library is being loaded dynamically by a stubs-enabled |
| 137 | ** application (i.e. the inverse of using a stubs-enabled package). These are |
| 138 | ** the only Tcl API functions that MUST be called prior to being able to call |
| 139 | ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). |
| 140 | */ |
| 141 | typedef void (tcl_FindExecutableProc) (CONST char * argv0); |
| 142 | typedef Tcl_Interp *(tcl_CreateInterpProc) (void); |
| 143 | |
| 144 | /* |
| 145 | ** The function types for the "hook" functions to be called before and after a |
| 146 | ** TH1 command makes a call to evaluate a Tcl script. If the "pre" function |
| @@ -436,11 +436,11 @@ | |
| 436 | */ |
| 437 | static int Th1EvalObjCmd( |
| 438 | ClientData clientData, |
| 439 | Tcl_Interp *interp, |
| 440 | int objc, |
| 441 | Tcl_Obj *CONST objv[] |
| 442 | ){ |
| 443 | Th_Interp *th1Interp; |
| 444 | int nArg; |
| 445 | const char *arg; |
| 446 | int rc; |
| @@ -468,11 +468,11 @@ | |
| 468 | */ |
| 469 | static int Th1ExprObjCmd( |
| 470 | ClientData clientData, |
| 471 | Tcl_Interp *interp, |
| 472 | int objc, |
| 473 | Tcl_Obj *CONST objv[] |
| 474 | ){ |
| 475 | Th_Interp *th1Interp; |
| 476 | int nArg; |
| 477 | const char *arg; |
| 478 | int rc; |
| 479 |
| --- src/th_tcl.c | |
| +++ src/th_tcl.c | |
| @@ -136,11 +136,11 @@ | |
| 136 | ** when the Tcl library is being loaded dynamically by a stubs-enabled |
| 137 | ** application (i.e. the inverse of using a stubs-enabled package). These are |
| 138 | ** the only Tcl API functions that MUST be called prior to being able to call |
| 139 | ** Tcl_InitStubs (i.e. because it requires a Tcl interpreter). |
| 140 | */ |
| 141 | typedef void (tcl_FindExecutableProc) (const char * argv0); |
| 142 | typedef Tcl_Interp *(tcl_CreateInterpProc) (void); |
| 143 | |
| 144 | /* |
| 145 | ** The function types for the "hook" functions to be called before and after a |
| 146 | ** TH1 command makes a call to evaluate a Tcl script. If the "pre" function |
| @@ -436,11 +436,11 @@ | |
| 436 | */ |
| 437 | static int Th1EvalObjCmd( |
| 438 | ClientData clientData, |
| 439 | Tcl_Interp *interp, |
| 440 | int objc, |
| 441 | Tcl_Obj *const objv[] |
| 442 | ){ |
| 443 | Th_Interp *th1Interp; |
| 444 | int nArg; |
| 445 | const char *arg; |
| 446 | int rc; |
| @@ -468,11 +468,11 @@ | |
| 468 | */ |
| 469 | static int Th1ExprObjCmd( |
| 470 | ClientData clientData, |
| 471 | Tcl_Interp *interp, |
| 472 | int objc, |
| 473 | Tcl_Obj *const objv[] |
| 474 | ){ |
| 475 | Th_Interp *th1Interp; |
| 476 | int nArg; |
| 477 | const char *arg; |
| 478 | int rc; |
| 479 |
+2
-2
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -313,21 +313,21 @@ | ||
| 313 | 313 | /* |
| 314 | 314 | ** Create the TH1 interpreter and load the "common" code. |
| 315 | 315 | */ |
| 316 | 316 | void ticket_init(void){ |
| 317 | 317 | const char *zConfig; |
| 318 | - Th_FossilInit(0, 0); | |
| 318 | + Th_FossilInit(TH_INIT_DEFAULT); | |
| 319 | 319 | zConfig = ticket_common_code(); |
| 320 | 320 | Th_Eval(g.interp, 0, zConfig, -1); |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /* |
| 324 | 324 | ** Create the TH1 interpreter and load the "change" code. |
| 325 | 325 | */ |
| 326 | 326 | int ticket_change(void){ |
| 327 | 327 | const char *zConfig; |
| 328 | - Th_FossilInit(0, 0); | |
| 328 | + Th_FossilInit(TH_INIT_DEFAULT); | |
| 329 | 329 | zConfig = ticket_change_code(); |
| 330 | 330 | return Th_Eval(g.interp, 0, zConfig, -1); |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | /* |
| 334 | 334 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -313,21 +313,21 @@ | |
| 313 | /* |
| 314 | ** Create the TH1 interpreter and load the "common" code. |
| 315 | */ |
| 316 | void ticket_init(void){ |
| 317 | const char *zConfig; |
| 318 | Th_FossilInit(0, 0); |
| 319 | zConfig = ticket_common_code(); |
| 320 | Th_Eval(g.interp, 0, zConfig, -1); |
| 321 | } |
| 322 | |
| 323 | /* |
| 324 | ** Create the TH1 interpreter and load the "change" code. |
| 325 | */ |
| 326 | int ticket_change(void){ |
| 327 | const char *zConfig; |
| 328 | Th_FossilInit(0, 0); |
| 329 | zConfig = ticket_change_code(); |
| 330 | return Th_Eval(g.interp, 0, zConfig, -1); |
| 331 | } |
| 332 | |
| 333 | /* |
| 334 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -313,21 +313,21 @@ | |
| 313 | /* |
| 314 | ** Create the TH1 interpreter and load the "common" code. |
| 315 | */ |
| 316 | void ticket_init(void){ |
| 317 | const char *zConfig; |
| 318 | Th_FossilInit(TH_INIT_DEFAULT); |
| 319 | zConfig = ticket_common_code(); |
| 320 | Th_Eval(g.interp, 0, zConfig, -1); |
| 321 | } |
| 322 | |
| 323 | /* |
| 324 | ** Create the TH1 interpreter and load the "change" code. |
| 325 | */ |
| 326 | int ticket_change(void){ |
| 327 | const char *zConfig; |
| 328 | Th_FossilInit(TH_INIT_DEFAULT); |
| 329 | zConfig = ticket_change_code(); |
| 330 | return Th_Eval(g.interp, 0, zConfig, -1); |
| 331 | } |
| 332 | |
| 333 | /* |
| 334 |
+1
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -827,11 +827,11 @@ | ||
| 827 | 827 | */ |
| 828 | 828 | static int run_script(const char *zScript){ |
| 829 | 829 | if( !zScript ){ |
| 830 | 830 | return TH_OK; /* No script, return success. */ |
| 831 | 831 | } |
| 832 | - Th_FossilInit(0, 0); /* Make sure TH1 is ready. */ | |
| 832 | + Th_FossilInit(TH_INIT_DEFAULT); /* Make sure TH1 is ready. */ | |
| 833 | 833 | return Th_Eval(g.interp, 0, zScript, -1); |
| 834 | 834 | } |
| 835 | 835 | |
| 836 | 836 | /* |
| 837 | 837 | ** Run the pre-transfer TH1 script, if any, and returns the return code. |
| 838 | 838 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -827,11 +827,11 @@ | |
| 827 | */ |
| 828 | static int run_script(const char *zScript){ |
| 829 | if( !zScript ){ |
| 830 | return TH_OK; /* No script, return success. */ |
| 831 | } |
| 832 | Th_FossilInit(0, 0); /* Make sure TH1 is ready. */ |
| 833 | return Th_Eval(g.interp, 0, zScript, -1); |
| 834 | } |
| 835 | |
| 836 | /* |
| 837 | ** Run the pre-transfer TH1 script, if any, and returns the return code. |
| 838 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -827,11 +827,11 @@ | |
| 827 | */ |
| 828 | static int run_script(const char *zScript){ |
| 829 | if( !zScript ){ |
| 830 | return TH_OK; /* No script, return success. */ |
| 831 | } |
| 832 | Th_FossilInit(TH_INIT_DEFAULT); /* Make sure TH1 is ready. */ |
| 833 | return Th_Eval(g.interp, 0, zScript, -1); |
| 834 | } |
| 835 | |
| 836 | /* |
| 837 | ** Run the pre-transfer TH1 script, if any, and returns the return code. |
| 838 |
+1
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -658,11 +658,11 @@ | ||
| 658 | 658 | zlib: |
| 659 | 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | 660 | |
| 661 | 661 | openssl: zlib |
| 662 | 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | - $(MAKE) -C $(OPENSSLLIBDIR) | |
| 663 | + $(MAKE) -C $(OPENSSLLIBDIR) build_libs | |
| 664 | 664 | |
| 665 | 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | 667 | |
| 668 | 668 | # This rule prevents make from using its default rules to try build |
| 669 | 669 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -658,11 +658,11 @@ | |
| 658 | zlib: |
| 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | |
| 661 | openssl: zlib |
| 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | $(MAKE) -C $(OPENSSLLIBDIR) |
| 664 | |
| 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | |
| 668 | # This rule prevents make from using its default rules to try build |
| 669 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -658,11 +658,11 @@ | |
| 658 | zlib: |
| 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | |
| 661 | openssl: zlib |
| 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | $(MAKE) -C $(OPENSSLLIBDIR) build_libs |
| 664 | |
| 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | |
| 668 | # This rule prevents make from using its default rules to try build |
| 669 |
+1
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -658,11 +658,11 @@ | ||
| 658 | 658 | zlib: |
| 659 | 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | 660 | |
| 661 | 661 | openssl: zlib |
| 662 | 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | - $(MAKE) -C $(OPENSSLLIBDIR) | |
| 663 | + $(MAKE) -C $(OPENSSLLIBDIR) build_libs | |
| 664 | 664 | |
| 665 | 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | 667 | |
| 668 | 668 | # This rule prevents make from using its default rules to try build |
| 669 | 669 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -658,11 +658,11 @@ | |
| 658 | zlib: |
| 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | |
| 661 | openssl: zlib |
| 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | $(MAKE) -C $(OPENSSLLIBDIR) |
| 664 | |
| 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | |
| 668 | # This rule prevents make from using its default rules to try build |
| 669 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -658,11 +658,11 @@ | |
| 658 | zlib: |
| 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | |
| 661 | openssl: zlib |
| 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | $(MAKE) -C $(OPENSSLLIBDIR) build_libs |
| 664 | |
| 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | |
| 668 | # This rule prevents make from using its default rules to try build |
| 669 |
+1
-1
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -658,11 +658,11 @@ | ||
| 658 | 658 | zlib: |
| 659 | 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | 660 | |
| 661 | 661 | openssl: zlib |
| 662 | 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | - $(MAKE) -C $(OPENSSLLIBDIR) | |
| 663 | + $(MAKE) -C $(OPENSSLLIBDIR) build_libs | |
| 664 | 664 | |
| 665 | 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | 667 | |
| 668 | 668 | # This rule prevents make from using its default rules to try build |
| 669 | 669 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -658,11 +658,11 @@ | |
| 658 | zlib: |
| 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | |
| 661 | openssl: zlib |
| 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | $(MAKE) -C $(OPENSSLLIBDIR) |
| 664 | |
| 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | |
| 668 | # This rule prevents make from using its default rules to try build |
| 669 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -658,11 +658,11 @@ | |
| 658 | zlib: |
| 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | |
| 661 | openssl: zlib |
| 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | $(MAKE) -C $(OPENSSLLIBDIR) build_libs |
| 664 | |
| 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | |
| 668 | # This rule prevents make from using its default rules to try build |
| 669 |
+1
-1
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -658,11 +658,11 @@ | ||
| 658 | 658 | zlib: |
| 659 | 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | 660 | |
| 661 | 661 | openssl: zlib |
| 662 | 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | - $(MAKE) -C $(OPENSSLLIBDIR) | |
| 663 | + $(MAKE) -C $(OPENSSLLIBDIR) build_libs | |
| 664 | 664 | |
| 665 | 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | 667 | |
| 668 | 668 | # This rule prevents make from using its default rules to try build |
| 669 | 669 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -658,11 +658,11 @@ | |
| 658 | zlib: |
| 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | |
| 661 | openssl: zlib |
| 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | $(MAKE) -C $(OPENSSLLIBDIR) |
| 664 | |
| 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | |
| 668 | # This rule prevents make from using its default rules to try build |
| 669 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -658,11 +658,11 @@ | |
| 658 | zlib: |
| 659 | $(MAKE) -C $(ZLIBDIR) PREFIX=$(PREFIX) -f win32/Makefile.gcc libz.a |
| 660 | |
| 661 | openssl: zlib |
| 662 | cd $(OPENSSLLIBDIR);./Configure --cross-compile-prefix=$(PREFIX) --with-zlib-lib=$(PWD)/$(ZLIBDIR) --with-zlib-include=$(PWD)/$(ZLIBDIR) zlib mingw |
| 663 | $(MAKE) -C $(OPENSSLLIBDIR) build_libs |
| 664 | |
| 665 | $(APPNAME): $(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/fossil.o zlib |
| 666 | $(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/fossil.o |
| 667 | |
| 668 | # This rule prevents make from using its default rules to try build |
| 669 |