Added wiki.test as received from David Vines. This is a snapshot, the test file (usually) runs, but has an issue that I am diagnosing related to the test wiki-30.
check-in: f7513f87 user: rberteig tags: technoteattachcli

# Reads the input file <srcdir>/$template and writes the output file $outfile.
# If $outfile is blank/omitted, $template should end with ".in" which
# is removed to create the output file name.
#
# Each pattern of the form @define@ is replaced the the corresponding
# define, if it exists, or left unchanged if not.
#
# The special value @srcdir@ is subsituted with the relative
# path to the source directory from the directory where the output
# file is created. Use @top_srcdir@ for the absolute path.
#
# Conditional sections may be specified as follows:
## @if name == value
## lines
## @else
## lines
## @endif
................................................................................
}
set outdir [file dirname $out]
# Make sure the directory exists
file mkdir $outdir
# Set up srcdir to be relative to the target dir
define srcdir [relative-path [file join $::autosetup(srcdir) $outdir] $outdir]
set mapping {}
foreach {n v} [array get ::define] {
lappend mapping @$n@ $v
}
set result {}
foreach line [split [readfile $infile] \n] {

# Reads the input file <srcdir>/$template and writes the output file $outfile.
# If $outfile is blank/omitted, $template should end with ".in" which
# is removed to create the output file name.
#
# Each pattern of the form @define@ is replaced the the corresponding
# define, if it exists, or left unchanged if not.
#
# The special value @srcdir@ is substituted with the relative
# path to the source directory from the directory where the output
# file is created, while the special value @top_srcdir@ is substituted# with the relative path to the top level source directory.
#
# Conditional sections may be specified as follows:
## @if name == value
## lines
## @else
## lines
## @endif
................................................................................
}
set outdir [file dirname $out]
# Make sure the directory exists
file mkdir $outdir
# Set up srcdir and top_srcdir to be relative to the target dir
define srcdir [relative-path [file join $::autosetup(srcdir) $outdir] $outdir]
define top_srcdir [relative-path $::autosetup(srcdir) $outdir]
set mapping {}
foreach {n v} [array get ::define] {
lappend mapping @$n@ $v
}
set result {}
foreach line [split [readfile $infile] \n] {

**
** list|ls List the keys and content sizes and other stats for
** all entries currently in the cache
**
** status Show a summary of cache status.
**
** The cache is stored in a file that is distinct from the repository
** but that is held in the same directory as the repository. To cache
** file can be deleted in order to completely disable the cache.
*/
void cache_cmd(void){
const char *zCmd;
int nCmd;
sqlite3 *db;
sqlite3_stmt *pStmt;

|

250
251
252
253
254
255
256
257
258
259
260
261
262
263
264

**
** list|ls List the keys and content sizes and other stats for
** all entries currently in the cache
**
** status Show a summary of cache status.
**
** The cache is stored in a file that is distinct from the repository
** but that is held in the same directory as the repository. The cache
** file can be deleted in order to completely disable the cache.
*/
void cache_cmd(void){
const char *zCmd;
int nCmd;
sqlite3 *db;
sqlite3_stmt *pStmt;

/*
** The root program. All variations call this core.
**
** INPUTS:
** func This is a pointer to a function taking three arguments** 1. A pointer to anything. Same as the "arg" parameter.** 2. A pointer to the list of characters to be output** (Note, this list is NOT null terminated.)** 3. An integer number of characters to be output.** (Note: This number might be zero.)**** arg This is the pointer to anything which will be passed as the** first argument to "func". Use it for whatever you like.
**
** fmt This is the format string, as in the usual print.
**
** ap This is a pointer to a list of arguments. Same as in
** vfprint.
**
** OUTPUTS:

|
<
<
<
<
<
<
<
<

230
231
232
233
234
235
236
237
238
239
240
241
242
243
244

/*
** The root program. All variations call this core.
**
** INPUTS:
** pBlob This is the blob where the output will be built.
**
** fmt This is the format string, as in the usual print.
**
** ap This is a pointer to a list of arguments. Same as in
** vfprint.
**
** OUTPUTS:

const char *zQ = P("q");
int go = P("go")!=0;
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
return;
}
db_begin_transaction();
style_header("Raw SQL Commands");
@ <p><b>Caution:</b> There are no restrictions on the SQL that can be
@ run by this page. You can do serious and irrepairable damage to the
@ repository. Proceed with extreme caution.</p>
@
@ <p>Only the first statement in the entry box will be run.

const char *zQ = P("q");
int go = P("go")!=0;
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
return;
}
add_content_sql_commands(g.db);
db_begin_transaction();
style_header("Raw SQL Commands");
@ <p><b>Caution:</b> There are no restrictions on the SQL that can be
@ run by this page. You can do serious and irrepairable damage to the
@ repository. Proceed with extreme caution.</p>
@
@ <p>Only the first statement in the entry box will be run.