Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tcl-integration Excluding Merge-Ins
This is equivalent to a diff from 98cc5206 to dd275844
2011-11-04
| ||
19:46 | Merge the tcl-integration branch into trunk. To make use of big-tcl, recompile using the --with-tcl option to ./configure and either set the global "tcl" setting or set the TH1_ENABLE_TCL environment variable. Big-tcl is turned off by default. (check-in: d8ed5a0d user: drh tags: trunk) | |
19:39 | Patch the auto.def file so that the TCL library is found even if it is named tcl8.6 or tcl8.5 instead of just tcl. (Closed-Leaf check-in: dd275844 user: drh tags: tcl-integration) | |
2011-10-27
| ||
15:00 | Prevent shell argument manipulation performed automatically by the MinGW shell from interfering with the makeheaders tool used by the Makefile. (check-in: 827a54fe user: mistachkin tags: tcl-integration) | |
2011-10-26
| ||
15:41 | Improvements to the User-Agent bot recognizer. Add the test-ishuman command for testing the bot recognizer. (check-in: 06e0cb70 user: drh tags: trunk) | |
15:17 | Merge updates from trunk. (check-in: 7017c87b user: mistachkin tags: tcl-integration) | |
14:58 | Add configuration options under /Admin/Access to enable the automatic hyperlink enabling for nobody based on User-Agent. (check-in: 98cc5206 user: drh tags: trunk) | |
14:00 | Automatically enable hyperlinks for user agents that appear to be human. (check-in: e059e5a2 user: drh tags: trunk) | |
Changes to Makefile.in.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + + + + - + | #!/usr/bin/make # # This is the top-level makefile for Fossil when the build is occurring # on a unix platform. This works out-of-the-box on most unix platforms. # But you are free to vary some of the definitions if desired. # #### The toplevel directory of the source tree. Fossil can be built # in a directory that is separate from the source tree. Just change # the following to point from the build directory to the src/ folder. # SRCDIR = @srcdir@/src #### The directory into which object code files should be written. # Having a "./" prefix in the value of this variable breaks our use of the # "makeheaders" tool when running make on the MinGW platform, apparently # due to some command line argument manipulation performed automatically # by the shell. # # |
︙ |
Changes to auto.def.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | + | # System autoconfiguration. Try: ./configure --help use cc cc-lib options { with-openssl:path|auto|none => {Look for openssl in the given path, or auto or none} with-zlib:path => {Look for zlib in the given path} with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} internal-sqlite=1 => {Don't use the internal sqlite, use the system one} static=0 => {Link a static executable} lineedit=1 => {Disable line editing} fossil-debug=0 => {Build with fossil debugging enabled} } # sqlite wants these types if possible |
︙ | |||
76 77 78 79 80 81 82 83 84 85 86 87 88 89 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | + + + + + + + + + + + + + + + + + + + + + + + + | cc-with [list -cflags "-I$zlibpath -L$zlibpath"] define-append EXTRA_CFLAGS -I$zlibpath define-append EXTRA_LDFLAGS -L$zlibpath } if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} { user-error "zlib not found please install it or specify the location with --with-zlib" } set tclpath [opt-val with-tcl] if {$tclpath ne ""} { if {$tclpath ne "1"} { cc-with [list -cflags [list -I$tclpath/include -L$tclpath/lib]] } if {![cc-check-includes tcl.h]} { user-error "Cannot find tcl.h" } foreach tlib {tcl8.6 tcl8.5 tcl notfound} { if {$tlib=="notfound"} { user-error "Cannot find a usable libtcl" } if {[cc-check-function-in-lib Tcl_CreateInterp $tlib]} { define-append LIBS -l$tlib break } } define FOSSIL_ENABLE_TCL if {$tclpath ne "1"} { define-append EXTRA_CFLAGS -I$tclpath/include define-append EXTRA_LDFLAGS -L$tclpath/lib } } # Helper for openssl checking proc check-for-openssl {msg {cflags {}}} { msg-checking "Checking for $msg..." set rc 0 msg-quiet cc-with [list -cflags $cflags -libs {-lssl -lcrypto}] { if {[cc-check-includes openssl/ssl.h] && [cc-check-functions SSL_new]} { |
︙ |
Changes to src/db.c.
︙ | |||
1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 | 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 | + + + | { "proxy", 0, 32, 0, "off" }, { "relative-paths",0, 0, 0, "on" }, { "repo-cksum", 0, 0, 0, "on" }, { "self-register", 0, 0, 0, "off" }, { "ssl-ca-location",0, 40, 0, "" }, { "ssl-identity", 0, 40, 0, "" }, { "ssh-command", 0, 32, 0, "" }, #ifdef FOSSIL_ENABLE_TCL { "tcl", 0, 0, 0, "off" }, #endif { "web-browser", 0, 32, 0, "" }, { "white-foreground", 0, 0, 0, "off" }, { 0,0,0,0,0 } }; /* ** COMMAND: settings |
︙ | |||
1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 | 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 | + + + + + + | ** the certificate and private key files. ** This identity will be presented to SSL servers to ** authenticate this client, in addition to the normal ** password authentication. ** ** ssh-command Command used to talk to a remote machine with ** the "ssh://" protocol. ** ** tcl If enabled, Tcl integration commands will be added to ** the TH1 interpreter, allowing Tcl expressions and ** scripts to be evaluated from TH1. Additionally, the ** Tcl interpreter will be able to evaluate TH1 expressions ** and scripts. Default: off. ** ** web-browser A shell command used to launch your preferred ** web browser when given a URL as an argument. ** Defaults to "start" on windows, "open" on Mac, ** and "firefox" on Unix. */ void setting_cmd(void){ |
︙ |
Changes to src/main.c.
︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | + + + + | #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #if INTERFACE #ifdef FOSSIL_ENABLE_TCL #include "tcl.h" #endif /* ** Number of elements in an array */ #define count(X) (sizeof(X)/sizeof(X[0])) /* ** Size of a UUID in characters |
︙ | |||
67 68 69 70 71 72 73 74 75 76 77 78 79 80 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | + + + + + + + + + + + + + | char WrTkt; /* w: make changes to tickets via web */ char Attach; /* b: add attachments */ char TktFmt; /* t: create new ticket report formats */ char RdAddr; /* e: read email addresses or other private data */ char Zip; /* z: download zipped artifact via /zip URL */ char Private; /* x: can send and receive private content */ }; #ifdef FOSSIL_ENABLE_TCL /* ** All Tcl related context information is in this structure. This structure ** definition has been copied from and should be kept in sync with the one in ** "th_tcl.c". */ struct TclContext { int argc; char **argv; Tcl_Interp *interp; }; #endif /* ** All global variables are in this structure. */ struct Global { int argc; char **argv; /* Command-line arguments to the program */ int isConst; /* True if the output is unchanging */ |
︙ | |||
143 144 145 146 147 148 149 150 151 152 153 154 155 156 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | + + + + + | /* Information used to populate the RCVFROM table */ int rcvid; /* The rcvid. 0 if not yet defined. */ char *zIpAddr; /* The remote IP address */ char *zNonce; /* The nonce used for login */ /* permissions used by the server */ struct FossilUserPerms perm; #ifdef FOSSIL_ENABLE_TCL /* all Tcl related context necessary for integration */ struct TclContext tcl; #endif /* For defense against Cross-site Request Forgery attacks */ char zCsrfToken[12]; /* Value of the anti-CSRF token */ int okCsrf; /* Anti-CSRF token is present and valid */ int parseCnt[10]; /* Counts of artifacts parsed */ FILE *fDebug; /* Write debug information here, if the file exists */ |
︙ | |||
311 312 313 314 315 316 317 318 319 320 321 322 323 324 | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | + + + + + + | ** This procedure runs first. */ int main(int argc, char **argv){ const char *zCmdName = "unknown"; int idx; int rc; int i; #ifdef FOSSIL_ENABLE_TCL g.tcl.argc = argc; g.tcl.argv = argv; g.tcl.interp = 0; #endif sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); g.now = time(0); g.argc = argc; g.argv = argv; expand_args_option(); argc = g.argc; |
︙ |
Changes to src/main.mk.
︙ | |||
299 300 301 302 303 304 305 | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | + + + + - + | # to 1. If it is set to 1, then there is no need to build or link # the sqlite3.o object. Instead, the system sqlite will be linked # using -lsqlite3. SQLITE3_OBJ.1 = SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o SQLITE3_OBJ. = $(SQLITE3_OBJ.0) TCL_OBJ.1 = TCL_OBJ.0 = $(OBJDIR)/th_tcl.o TCL_OBJ. = $(TCL_OBJ.0) |
︙ | |||
907 908 909 910 911 912 913 | 911 912 913 914 915 916 917 918 919 920 | + + + | $(OBJDIR)/th.o: $(SRCDIR)/th.c $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th.c -o $(OBJDIR)/th.o $(OBJDIR)/th_lang.o: $(SRCDIR)/th_lang.c $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_lang.c -o $(OBJDIR)/th_lang.o $(OBJDIR)/th_tcl.o: $(SRCDIR)/th_tcl.c $(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_tcl.c -o $(OBJDIR)/th_tcl.o |
Changes to src/makemake.tcl.
︙ | |||
196 197 198 199 200 201 202 203 204 205 206 | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | + + + + - + + | # to 1. If it is set to 1, then there is no need to build or link # the sqlite3.o object. Instead, the system sqlite will be linked # using -lsqlite3. SQLITE3_OBJ.1 = SQLITE3_OBJ.0 = $(OBJDIR)/sqlite3.o SQLITE3_OBJ. = $(SQLITE3_OBJ.0) TCL_OBJ.1 = TCL_OBJ.0 = $(OBJDIR)/th_tcl.o TCL_OBJ. = $(TCL_OBJ.0) EXTRAOBJ = \ $(SQLITE3_OBJ.$(USE_SYSTEM_SQLITE)) \ $(OBJDIR)/shell.o \ $(OBJDIR)/th.o \ |
︙ | |||
263 264 265 266 267 268 269 270 271 272 273 274 275 276 | 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | + + + | writeln "\$(OBJDIR)/th.o:\t\$(SRCDIR)/th.c" writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o \$(OBJDIR)/th.o\n" writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c" writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n" writeln "\$(OBJDIR)/th_tcl.o:\t\$(SRCDIR)/th_tcl.c" writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_tcl.c -o \$(OBJDIR)/th_tcl.o\n" close $output_file # # End of the main.mk output ############################################################################## ############################################################################## ############################################################################## # Begin win/Makefile.mingw |
︙ |
Changes to src/th.h.
︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | + | /* ** Interfaces to register the language extensions. */ int th_register_language(Th_Interp *interp); /* th_lang.c */ int th_register_sqlite(Th_Interp *interp); /* th_sqlite.c */ int th_register_vfs(Th_Interp *interp); /* th_vfs.c */ int th_register_testvfs(Th_Interp *interp); /* th_testvfs.c */ int th_register_tcl(Th_Interp *interp, void *pContext); /* th_tcl.c */ /* ** General purpose hash table from th_lang.c. */ typedef struct Th_Hash Th_Hash; typedef struct Th_HashEntry Th_HashEntry; struct Th_HashEntry { |
︙ |
Changes to src/th_main.c.
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | + | z = htmlize(z, n); n = strlen(z); } if( g.cgiOutput ){ cgi_append_content(z, n); }else{ fwrite(z, 1, n, stdout); fflush(stdout); } if( encode ) free((char*)z); } } /* ** TH command: puts STRING |
︙ | |||
332 333 334 335 336 337 338 339 340 341 342 343 344 345 | 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } } if( n<iMin ) n = iMin; if( n>iMax ) n = iMax; Th_SetResultInt(interp, n); return TH_OK; } /* ** TH1 command: repository ?BOOLEAN? ** ** Return the fully qualified file name of the open repository or an empty ** string if one is not currently open. Optionally, it will attempt to open ** the repository if the boolean argument is non-zero. */ static int repositoryCmd( Th_Interp *interp, void *p, int argc, const char **argv, int *argl ){ int openRepository; if( argc!=1 && argc!=2 ){ return Th_WrongNumArgs(interp, "repository ?BOOLEAN?"); } if( argc==2 ){ if( Th_ToInt(interp, argv[1], argl[1], &openRepository) ){ return TH_ERROR; } if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0); } Th_SetResult(interp, g.zRepositoryName, -1); return TH_OK; } /* ** Make sure the interpreter has been initialized. Initialize it if ** it has not been already. ** ** The interpreter is stored in the g.interp global variable. */ |
︙ | |||
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | + + + + + + | {"linecount", linecntCmd, 0}, {"hascap", hascapCmd, 0}, {"htmlize", htmlizeCmd, 0}, {"date", dateCmd, 0}, {"html", putsCmd, 0}, {"puts", putsCmd, (void*)1}, {"wiki", wikiCmd, 0}, {"repository", repositoryCmd, 0}, }; if( g.interp==0 ){ int i; g.interp = Th_CreateInterp(&vtab); th_register_language(g.interp); /* Basic scripting commands. */ #ifdef FOSSIL_ENABLE_TCL if( getenv("TH1_ENABLE_TCL")!=0 || db_get_boolean("tcl", 0) ){ th_register_tcl(g.interp, &g.tcl); /* Tcl integration commands. */ } #endif for(i=0; i<sizeof(aCommand)/sizeof(aCommand[0]); i++){ Th_CreateCommand(g.interp, aCommand[i].zName, aCommand[i].xProc, aCommand[i].pContext, 0); } } } |
︙ | |||
527 528 529 530 531 532 533 534 535 536 537 | 563 564 565 566 567 568 569 570 571 572 573 574 | + | ** COMMAND: test-th-render */ void test_th_render(void){ Blob in; if( g.argc<3 ){ usage("FILE"); } db_open_config(0); /* Needed for "tcl" setting. */ blob_zero(&in); blob_read_from_file(&in, g.argv[2]); Th_Render(blob_str(&in)); } |
Added src/th_tcl.c.