Fossil SCM

Add the 'cgiHeaderLine' command to TH1.

mistachkin 2019-01-12 21:35 trunk merge
Commit 32c48809d66cebefbb8a08e1d5b7efb37d2a64fb49813c1e1c1835c2807465ab
--- src/th_main.c
+++ src/th_main.c
@@ -1366,10 +1366,29 @@
13661366
}else{
13671367
Th_SetResult(interp, "repository unavailable", -1);
13681368
return TH_ERROR;
13691369
}
13701370
}
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
+}
13711390
13721391
/*
13731392
** TH1 command: unversioned content FILENAME
13741393
**
13751394
** Attempts to locate the specified unversioned file and return its contents.
@@ -1982,10 +2001,11 @@
19822001
void *pContext;
19832002
} aCommand[] = {
19842003
{"anoncap", hascapCmd, (void*)&anonFlag},
19852004
{"anycap", anycapCmd, 0},
19862005
{"artifact", artifactCmd, 0},
2006
+ {"cgiHeaderLine", cgiHeaderLineCmd, 0},
19872007
{"checkout", checkoutCmd, 0},
19882008
{"combobox", comboboxCmd, 0},
19892009
{"date", dateCmd, 0},
19902010
{"decorate", wikiCmd, (void*)&aFlags[2]},
19912011
{"dir", dirCmd, 0},
19922012
--- 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
+4 -4
--- test/th1.test
+++ test/th1.test
@@ -1029,14 +1029,14 @@
10291029
#
10301030
fossil test-th-eval "info commands"
10311031
set sorted_result [lsort $RESULT]
10321032
protOut "Sorted: $sorted_result"
10331033
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\
10381038
reinitialize rename render repository return searchable set\
10391039
setParameter setting stime string styleFooter styleHeader styleScript\
10401040
tclReady trace unset unversioned uplevel upvar utime verifyCsrf wiki}
10411041
set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe}
10421042
if {$th1Tcl} {
10431043
--- test/th1.test
+++ test/th1.test
@@ -1029,14 +1029,14 @@
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 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.test
+++ test/th1.test
@@ -1029,14 +1029,14 @@
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
+8
--- www/th1.md
+++ www/th1.md
@@ -167,10 +167,11 @@
167167
features of Fossil. The following is a summary of the extended commands:
168168
169169
* anoncap
170170
* anycap
171171
* artifact
172
+ * cgiHeaderLine
172173
* checkout
173174
* combobox
174175
* date
175176
* decorate
176177
* dir
@@ -246,10 +247,17 @@
246247
* artifact ID ?FILENAME?
247248
248249
Attempts to locate the specified artifact and return its contents. An
249250
error is generated if the repository is not open or the artifact cannot
250251
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.
251259
252260
<a name="checkout"></a>TH1 checkout Command
253261
-------------------------------------------
254262
255263
* checkout ?BOOLEAN?
256264
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button