Fossil SCM
Add the 'cgiHeaderLine' command to TH1.
Commit
58e2f487e55181a1785d137f806ca828f729416f3bc1763eebaf9245a0496adf
Parent
1e3cfc1e9eaa2bc…
3 files changed
+20
+6
-6
+8
+20
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -1366,10 +1366,29 @@ | ||
| 1366 | 1366 | }else{ |
| 1367 | 1367 | Th_SetResult(interp, "repository unavailable", -1); |
| 1368 | 1368 | return TH_ERROR; |
| 1369 | 1369 | } |
| 1370 | 1370 | } |
| 1371 | + | |
| 1372 | +/* | |
| 1373 | +** TH1 command: cgiHeaderLine line | |
| 1374 | +** | |
| 1375 | +** Adds the specified line to the CGI header. | |
| 1376 | +*/ | |
| 1377 | +static int cgiHeaderLineCmd( | |
| 1378 | + Th_Interp *interp, | |
| 1379 | + void *p, | |
| 1380 | + int argc, | |
| 1381 | + const char **argv, | |
| 1382 | + int *argl | |
| 1383 | +){ | |
| 1384 | + if( argc!=2 ){ | |
| 1385 | + return Th_WrongNumArgs(interp, "cgiHeaderLine line"); | |
| 1386 | + } | |
| 1387 | + cgi_append_header(argv[1]); | |
| 1388 | + return TH_OK; | |
| 1389 | +} | |
| 1371 | 1390 | |
| 1372 | 1391 | /* |
| 1373 | 1392 | ** TH1 command: unversioned content FILENAME |
| 1374 | 1393 | ** |
| 1375 | 1394 | ** Attempts to locate the specified unversioned file and return its contents. |
| @@ -1982,10 +2001,11 @@ | ||
| 1982 | 2001 | void *pContext; |
| 1983 | 2002 | } aCommand[] = { |
| 1984 | 2003 | {"anoncap", hascapCmd, (void*)&anonFlag}, |
| 1985 | 2004 | {"anycap", anycapCmd, 0}, |
| 1986 | 2005 | {"artifact", artifactCmd, 0}, |
| 2006 | + {"cgiHeaderLine", cgiHeaderLineCmd, 0}, | |
| 1987 | 2007 | {"checkout", checkoutCmd, 0}, |
| 1988 | 2008 | {"combobox", comboboxCmd, 0}, |
| 1989 | 2009 | {"date", dateCmd, 0}, |
| 1990 | 2010 | {"decorate", wikiCmd, (void*)&aFlags[2]}, |
| 1991 | 2011 | {"dir", dirCmd, 0}, |
| 1992 | 2012 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1366,10 +1366,29 @@ | |
| 1366 | }else{ |
| 1367 | Th_SetResult(interp, "repository unavailable", -1); |
| 1368 | return TH_ERROR; |
| 1369 | } |
| 1370 | } |
| 1371 | |
| 1372 | /* |
| 1373 | ** TH1 command: unversioned content FILENAME |
| 1374 | ** |
| 1375 | ** Attempts to locate the specified unversioned file and return its contents. |
| @@ -1982,10 +2001,11 @@ | |
| 1982 | void *pContext; |
| 1983 | } aCommand[] = { |
| 1984 | {"anoncap", hascapCmd, (void*)&anonFlag}, |
| 1985 | {"anycap", anycapCmd, 0}, |
| 1986 | {"artifact", artifactCmd, 0}, |
| 1987 | {"checkout", checkoutCmd, 0}, |
| 1988 | {"combobox", comboboxCmd, 0}, |
| 1989 | {"date", dateCmd, 0}, |
| 1990 | {"decorate", wikiCmd, (void*)&aFlags[2]}, |
| 1991 | {"dir", dirCmd, 0}, |
| 1992 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -1366,10 +1366,29 @@ | |
| 1366 | }else{ |
| 1367 | Th_SetResult(interp, "repository unavailable", -1); |
| 1368 | return TH_ERROR; |
| 1369 | } |
| 1370 | } |
| 1371 | |
| 1372 | /* |
| 1373 | ** TH1 command: cgiHeaderLine line |
| 1374 | ** |
| 1375 | ** Adds the specified line to the CGI header. |
| 1376 | */ |
| 1377 | static int cgiHeaderLineCmd( |
| 1378 | Th_Interp *interp, |
| 1379 | void *p, |
| 1380 | int argc, |
| 1381 | const char **argv, |
| 1382 | int *argl |
| 1383 | ){ |
| 1384 | if( argc!=2 ){ |
| 1385 | return Th_WrongNumArgs(interp, "cgiHeaderLine line"); |
| 1386 | } |
| 1387 | cgi_append_header(argv[1]); |
| 1388 | return TH_OK; |
| 1389 | } |
| 1390 | |
| 1391 | /* |
| 1392 | ** TH1 command: unversioned content FILENAME |
| 1393 | ** |
| 1394 | ** Attempts to locate the specified unversioned file and return its contents. |
| @@ -1982,10 +2001,11 @@ | |
| 2001 | void *pContext; |
| 2002 | } aCommand[] = { |
| 2003 | {"anoncap", hascapCmd, (void*)&anonFlag}, |
| 2004 | {"anycap", anycapCmd, 0}, |
| 2005 | {"artifact", artifactCmd, 0}, |
| 2006 | {"cgiHeaderLine", cgiHeaderLineCmd, 0}, |
| 2007 | {"checkout", checkoutCmd, 0}, |
| 2008 | {"combobox", comboboxCmd, 0}, |
| 2009 | {"date", dateCmd, 0}, |
| 2010 | {"decorate", wikiCmd, (void*)&aFlags[2]}, |
| 2011 | {"dir", dirCmd, 0}, |
| 2012 |
+6
-6
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -1029,17 +1029,17 @@ | ||
| 1029 | 1029 | # |
| 1030 | 1030 | fossil test-th-eval "info commands" |
| 1031 | 1031 | set sorted_result [lsort $RESULT] |
| 1032 | 1032 | protOut "Sorted: $sorted_result" |
| 1033 | 1033 | set base_commands {anoncap anycap array artifact break breakpoint catch\ |
| 1034 | - checkout combobox continue date decorate dir enable_output encode64\ | |
| 1035 | - error expr for getParameter glob_match globalState hascap hasfeature\ | |
| 1036 | - html htmlize http httpize if info insertCsrf lindex linecount list\ | |
| 1037 | - llength lsearch markdown proc puts query randhex redirect regexp\ | |
| 1034 | + cgiHeaderLine checkout combobox continue date decorate dir enable_output \ | |
| 1035 | + encode64 error expr for getParameter glob_match globalState hascap \ | |
| 1036 | + hasfeature html htmlize http httpize if info insertCsrf lindex linecount \ | |
| 1037 | + list llength lsearch markdown proc puts query randhex redirect regexp\ | |
| 1038 | 1038 | reinitialize rename render repository return searchable set\ |
| 1039 | - setParameter setting stime string styleFooter styleHeader tclReady\ | |
| 1040 | - trace unset unversioned uplevel upvar utime verifyCsrf wiki} | |
| 1039 | + setParameter setting stime string styleFooter styleHeader styleScript\ | |
| 1040 | + tclReady trace unset unversioned uplevel upvar utime verifyCsrf wiki} | |
| 1041 | 1041 | set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe} |
| 1042 | 1042 | if {$th1Tcl} { |
| 1043 | 1043 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands $tcl_commands"]} |
| 1044 | 1044 | } else { |
| 1045 | 1045 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands"]} |
| 1046 | 1046 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -1029,17 +1029,17 @@ | |
| 1029 | # |
| 1030 | fossil test-th-eval "info commands" |
| 1031 | set sorted_result [lsort $RESULT] |
| 1032 | protOut "Sorted: $sorted_result" |
| 1033 | set base_commands {anoncap anycap array artifact break breakpoint catch\ |
| 1034 | checkout combobox continue date decorate dir enable_output encode64\ |
| 1035 | error expr for getParameter glob_match globalState hascap hasfeature\ |
| 1036 | html htmlize http httpize if info insertCsrf lindex linecount list\ |
| 1037 | llength lsearch markdown proc puts query randhex redirect regexp\ |
| 1038 | reinitialize rename render repository return searchable set\ |
| 1039 | setParameter setting stime string styleFooter styleHeader tclReady\ |
| 1040 | trace unset unversioned uplevel upvar utime verifyCsrf wiki} |
| 1041 | set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe} |
| 1042 | if {$th1Tcl} { |
| 1043 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands $tcl_commands"]} |
| 1044 | } else { |
| 1045 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands"]} |
| 1046 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -1029,17 +1029,17 @@ | |
| 1029 | # |
| 1030 | fossil test-th-eval "info commands" |
| 1031 | set sorted_result [lsort $RESULT] |
| 1032 | protOut "Sorted: $sorted_result" |
| 1033 | set base_commands {anoncap anycap array artifact break breakpoint catch\ |
| 1034 | cgiHeaderLine checkout combobox continue date decorate dir enable_output \ |
| 1035 | encode64 error expr for getParameter glob_match globalState hascap \ |
| 1036 | hasfeature html htmlize http httpize if info insertCsrf lindex linecount \ |
| 1037 | list llength lsearch markdown proc puts query randhex redirect regexp\ |
| 1038 | reinitialize rename render repository return searchable set\ |
| 1039 | setParameter setting stime string styleFooter styleHeader styleScript\ |
| 1040 | tclReady trace unset unversioned uplevel upvar utime verifyCsrf wiki} |
| 1041 | set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe} |
| 1042 | if {$th1Tcl} { |
| 1043 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands $tcl_commands"]} |
| 1044 | } else { |
| 1045 | test th1-info-commands-1 {$sorted_result eq [lsort "$base_commands"]} |
| 1046 |
+8
| --- www/th1.md | ||
| +++ www/th1.md | ||
| @@ -167,10 +167,11 @@ | ||
| 167 | 167 | features of Fossil. The following is a summary of the extended commands: |
| 168 | 168 | |
| 169 | 169 | * anoncap |
| 170 | 170 | * anycap |
| 171 | 171 | * artifact |
| 172 | + * cgiHeaderLine | |
| 172 | 173 | * checkout |
| 173 | 174 | * combobox |
| 174 | 175 | * date |
| 175 | 176 | * decorate |
| 176 | 177 | * dir |
| @@ -246,10 +247,17 @@ | ||
| 246 | 247 | * artifact ID ?FILENAME? |
| 247 | 248 | |
| 248 | 249 | Attempts to locate the specified artifact and return its contents. An |
| 249 | 250 | error is generated if the repository is not open or the artifact cannot |
| 250 | 251 | be found. |
| 252 | + | |
| 253 | +<a name="cgiHeaderLine"></a>TH1 cgiHeader Command | |
| 254 | +------------------------------------------------- | |
| 255 | + | |
| 256 | + * cgiHeaderLine line | |
| 257 | + | |
| 258 | +Adds the specified line to the CGI header. | |
| 251 | 259 | |
| 252 | 260 | <a name="checkout"></a>TH1 checkout Command |
| 253 | 261 | ------------------------------------------- |
| 254 | 262 | |
| 255 | 263 | * checkout ?BOOLEAN? |
| 256 | 264 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -167,10 +167,11 @@ | |
| 167 | features of Fossil. The following is a summary of the extended commands: |
| 168 | |
| 169 | * anoncap |
| 170 | * anycap |
| 171 | * artifact |
| 172 | * checkout |
| 173 | * combobox |
| 174 | * date |
| 175 | * decorate |
| 176 | * dir |
| @@ -246,10 +247,17 @@ | |
| 246 | * artifact ID ?FILENAME? |
| 247 | |
| 248 | Attempts to locate the specified artifact and return its contents. An |
| 249 | error is generated if the repository is not open or the artifact cannot |
| 250 | be found. |
| 251 | |
| 252 | <a name="checkout"></a>TH1 checkout Command |
| 253 | ------------------------------------------- |
| 254 | |
| 255 | * checkout ?BOOLEAN? |
| 256 |
| --- www/th1.md | |
| +++ www/th1.md | |
| @@ -167,10 +167,11 @@ | |
| 167 | features of Fossil. The following is a summary of the extended commands: |
| 168 | |
| 169 | * anoncap |
| 170 | * anycap |
| 171 | * artifact |
| 172 | * cgiHeaderLine |
| 173 | * checkout |
| 174 | * combobox |
| 175 | * date |
| 176 | * decorate |
| 177 | * dir |
| @@ -246,10 +247,17 @@ | |
| 247 | * artifact ID ?FILENAME? |
| 248 | |
| 249 | Attempts to locate the specified artifact and return its contents. An |
| 250 | error is generated if the repository is not open or the artifact cannot |
| 251 | be found. |
| 252 | |
| 253 | <a name="cgiHeaderLine"></a>TH1 cgiHeader Command |
| 254 | ------------------------------------------------- |
| 255 | |
| 256 | * cgiHeaderLine line |
| 257 | |
| 258 | Adds the specified line to the CGI header. |
| 259 | |
| 260 | <a name="checkout"></a>TH1 checkout Command |
| 261 | ------------------------------------------- |
| 262 | |
| 263 | * checkout ?BOOLEAN? |
| 264 |