Documentation Source Text

Check-in [c3c40d6711]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rename the output_list proc to hd_list_of_links and move its implementation from capi3ref.in into wrap.tcl, since it is used as common code.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c3c40d671123be5a7d8352ae98353fa613f68d7b
User & Date: drh 2016-09-02 16:57:00
Context
2016-09-02
17:03
Store debugging information in the doc_vardump.txt file after building all documentation. check-in: cb35d7c443 user: drh tags: trunk
16:57
Rename the output_list proc to hd_list_of_links and move its implementation from capi3ref.in into wrap.tcl, since it is used as common code. check-in: c3c40d6711 user: drh tags: trunk
16:30
Remove unnecessary javascript from the header. Improvements to rendering of C APIs. check-in: 4180b2cf6f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/capi3ref.in.

216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
...
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
...
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
...
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
...
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
...
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
  set oldname [string tolower $oldname]
  regsub {^sqlite_} $oldname {c_} oldname
  regsub {^sqlite3_} $oldname {} oldname
  regsub { } $oldname _ name
  return $name.html
}

# Convert the keyword $kw into an appropriate relative URI
#
proc keyword_to_uri {kw} {
  global hd llink glink
  if {[string match {*.html} $kw]} {return $kw}
  if {$hd(enable-main)} {
    set fn $hd(fn-main)
    if {[info exists llink($fn:$kw)]} {
      return $hd(rootpath-main)$llink($fn:$kw)
    }
    if {[info exists glink($kw)]} {
      return $hd(rootpath-main)$glink($kw)
    }
  }
  if {$hd(enable-aux)} {
    if {[info exists glink($kw)]} {
      return $hd(rootpath-aux)$glink($kw)
    }
  }
  return ""
}

# Generate a Javascript table containing the URL and Label from $lx
#
proc output_list_javascript {lx} {
  set sep {[}
  foreach entry $lx {
    foreach {link label s} $entry break
    set url [keyword_to_uri $link]
    hd_puts "${sep}{\"u\":\"$url\",\"x\":\"$label\",\"s\":$s}"
    set sep ",\n"
  }
  hd_putsnl "\];"
}

# Output HTML/JS that displays the list $lx in multiple columns
# under the assumption that each column is $w pixels wide.
#
# $lx is a list of triples.  Each triple is {KEYWORD LABEL S}.  The
# S determines a suffix added to each list element:
#
#    0:     Add nothing (the default and common case)
#    1:     Add the "(exp)" suffix
#    2:     Strike through the text and do not hyperlink
#    3:     Strike through the text and add &sup1
#    4:     Add &sup2
#    5:     Add &sup3
#
# This routine is used to generate lists in other modules as well:
# lang.in, pragma.in, session.in.
#
proc output_list {title w lx} {
  global listcount hd
  if {![info exists listcount]} {
    set listcount 1
  } else {
    incr listcount
  }
  set tx listtab$listcount
  set vx listitems$listcount
  hd_puts "<style>\n#$tx tr td {vertical-align:top;}\n"
  hd_puts "</style>\n"
  hd_putsnl "<table id='$tx' width='100%'></table>"
  hd_putsnl "<script>"
  hd_puts "var $vx = "
  if {$hd(enable-main) && $hd(enable-aux)} {
    set hd(enable-main) 0
    output_list_javascript $lx
    set hd(enable-main) 1
    set hd(enable-aux) 0
    output_list_javascript $lx
    set hd(enable-aux) 1
  } else {
    output_list_javascript $lx
  }
  hd_putsnl "var j = 0;"
  hd_putsnl "var w = Math.max(document.documentElement.clientWidth, \
             window.innerWidth || 0);"
  hd_putsnl "var nCol = Math.floor(w/$w);"
  hd_putsnl "if(nCol<=0) nCol=1;"
  hd_putsnl "var nRow = Math.ceil(($vx.length+1)/nCol);"
  if {$title!=""} {
    hd_putsnl "var h=\"<tr><td colspan=\"+nCol;"
    hd_putsnl "h += \">$title</td></tr><tr><td><ul class='multicol_list'>\""
  } else {
    hd_putsnl "var h=\"<tr><td><ul class='multicol_list'>\""
  }
  hd_putsnl "var ea"
  hd_putsnl "for(var i=0; i<$vx.length; i++){"
  hd_putsnl "  if( (++j)>nRow ){"
  hd_putsnl "    h += \"</ul></td>\\n<td><ul class='multicol_list'>\\n\";"
  hd_putsnl "    j = 1;"
  hd_putsnl "  }"
  hd_putsnl "  if($vx\[i\].u==\"\" || $vx\[i\].s==2){"
  hd_putsnl "    h += \"<li>\""
  hd_putsnl "    ea = \"\""
  hd_putsnl "  }else{"
  hd_putsnl "    h += \"<li><a href='\";"
  hd_putsnl "    h += $vx\[i\].u;"
  hd_putsnl "    h += \"'>\";"
  hd_putsnl "    ea = \"</a>\""
  hd_putsnl "  }"
  hd_putsnl "  if($vx\[i\].s==2 || $vx\[i\].s==3) h += \"<s>\""
  hd_putsnl "  h += $vx\[i\].x;"
  hd_putsnl "  if($vx\[i\].s==2 || $vx\[i\].s==3) h += \"</s>\""
  hd_putsnl "  h += ea"
  hd_putsnl "  if($vx\[i\].s==1) h += \"<small><i>(exp)</i></small>\\n\";"
  hd_putsnl "  if($vx\[i\].s==3) h += \"&sup1\\n\";"
  hd_putsnl "  if($vx\[i\].s==4) h += \"&sup2\\n\";"
  hd_putsnl "  if($vx\[i\].s==5) h += \"&sup3\\n\";"
  hd_putsnl "}"
  hd_putsnl "document.getElementById(\"$tx\").innerHTML = h;"
  hd_putsnl "</script>"
}

hd_open_aux c3ref/intro.html
hd_header Introduction
hd_enable_main 0
hd_keywords *capi3ref {C-language Interface}
</tcl>

<h1 align="center">
................................................................................
hd_header {List Of SQLite Objects}
hd_enable_main 0
hd_putsnl {<a href="intro.html"><h2>SQLite C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>List Of Objects:</h2>
<tcl>
output_list "" 280 [lsort -nocase $objlist]
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="constlist.html">Constants</a> and
<a href="funclist.html">Functions</a> and
<a href="../rescode.html">Result Codes</a>.}
hd_close_aux
hd_enable_main 1
................................................................................
hd_putsnl {<a href="intro.html"><h2>SQLite C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>List Of Constants:</h2>
<p>Also available: [error codes|list of error codes]</p>
<tcl>
set clist [lsort -index 1 $clist]
output_list "" 400 $clist
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="objlist.html">Objects</a> and
<a href="funclist.html">Functions</a> and
<a href="../rescode.html">Result Codes</a>.</p>}
hd_enable_main 1
hd_close_aux
................................................................................
</tcl>
<h2>List Of Functions:</h2>
<p>Note: Functions marked with "<small><i>(exp)</i></small>"
are [experimental] and functions whose names are
<s>struck through</s> are [deprecated].</p>
<tcl>
set funclist [lsort -index 1 $funclist]
output_list "" 315 $funclist
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="constlist.html">Constants</a> and
<a href="objlist.html">Objects</a> and
<a href="../rescode.html">Result Codes</a></p>}
hd_enable_main 1
hd_close_aux
................................................................................
    hd_puts "</p>\n"
    return
  }
  set flst {}
  foreach x $lx {
    lappend flst [list $x $x 0]
  }
  output_list ${label}s: 350 $flst
  hd_puts "</p>\n"
}


# Output all the records
#
foreach c [lsort $content] {
................................................................................
    hd_resolve {and is subject to change without notice.</p>}
  }
  regsub -all "\n\n+" $body "</p>\n\n<p>" body
  set body <p>$body</p>
  while {[regexp {^(.*?)\[\[([^]]*)\]\](.*)$} $body all fore anchor aft]} {
    hd_resolve $fore
    set anchor [string trim $anchor]
puts stderr "FRAGMENT: [list [hd_fragname $anchor] $anchor]"
    hd_fragment [hd_fragname $anchor] $anchor
    set body $aft
  }
  hd_resolve $body
  show_methods_of_object c:$kw Constructor
  show_methods_of_object d:$kw Destructor
  show_methods_of_object m:$kw Method







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







|







 







|







 







|







 







|







 







<







216
217
218
219
220
221
222



















































































































223
224
225
226
227
228
229
...
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
...
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
...
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
...
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
...
565
566
567
568
569
570
571

572
573
574
575
576
577
578
  set oldname [string tolower $oldname]
  regsub {^sqlite_} $oldname {c_} oldname
  regsub {^sqlite3_} $oldname {} oldname
  regsub { } $oldname _ name
  return $name.html
}




















































































































hd_open_aux c3ref/intro.html
hd_header Introduction
hd_enable_main 0
hd_keywords *capi3ref {C-language Interface}
</tcl>

<h1 align="center">
................................................................................
hd_header {List Of SQLite Objects}
hd_enable_main 0
hd_putsnl {<a href="intro.html"><h2>SQLite C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>List Of Objects:</h2>
<tcl>
hd_list_of_links {} 280 [lsort -nocase $objlist]
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="constlist.html">Constants</a> and
<a href="funclist.html">Functions</a> and
<a href="../rescode.html">Result Codes</a>.}
hd_close_aux
hd_enable_main 1
................................................................................
hd_putsnl {<a href="intro.html"><h2>SQLite C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>List Of Constants:</h2>
<p>Also available: [error codes|list of error codes]</p>
<tcl>
set clist [lsort -index 1 $clist]
hd_list_of_links {} 400 $clist
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="objlist.html">Objects</a> and
<a href="funclist.html">Functions</a> and
<a href="../rescode.html">Result Codes</a>.</p>}
hd_enable_main 1
hd_close_aux
................................................................................
</tcl>
<h2>List Of Functions:</h2>
<p>Note: Functions marked with "<small><i>(exp)</i></small>"
are [experimental] and functions whose names are
<s>struck through</s> are [deprecated].</p>
<tcl>
set funclist [lsort -index 1 $funclist]
hd_list_of_links {} 315 $funclist
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="constlist.html">Constants</a> and
<a href="objlist.html">Objects</a> and
<a href="../rescode.html">Result Codes</a></p>}
hd_enable_main 1
hd_close_aux
................................................................................
    hd_puts "</p>\n"
    return
  }
  set flst {}
  foreach x $lx {
    lappend flst [list $x $x 0]
  }
  hd_list_of_links "${label}s:" 350 $flst
  hd_puts "</p>\n"
}


# Output all the records
#
foreach c [lsort $content] {
................................................................................
    hd_resolve {and is subject to change without notice.</p>}
  }
  regsub -all "\n\n+" $body "</p>\n\n<p>" body
  set body <p>$body</p>
  while {[regexp {^(.*?)\[\[([^]]*)\]\](.*)$} $body all fore anchor aft]} {
    hd_resolve $fore
    set anchor [string trim $anchor]

    hd_fragment [hd_fragname $anchor] $anchor
    set body $aft
  }
  hd_resolve $body
  show_methods_of_object c:$kw Constructor
  show_methods_of_object d:$kw Destructor
  show_methods_of_object m:$kw Method

Changes to pages/lang.in.

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
....
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
....
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
....
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
  foreach {section} [lsort -index 0 -dictionary $lang_section_list] {
    foreach {s_title s_tag s_kw} $section {}
    if {$s_kw == ""} {
      set s_kw $s_title
    }
    lappend lx [list $s_kw $s_title 0]
  }
  # The output_list proc is implemented in capi3ref.in.
  output_list {} 340 $lx
</tcl>
</ul></td></tr></table>

<p>^The routines [sqlite3_prepare_v2()], [sqlite3_prepare()],
[sqlite3_prepare16()], [sqlite3_prepare16_v2()], 
[sqlite3_exec()], and [sqlite3_get_table()] accept
an SQL statement list (sql-stmt-list) which is a semicolon-separated
................................................................................
foreach basesyntax [array names corefuncset] {
  foreach {syntax keywords desc} $corefuncset($basesyntax) break
  regexp {^[a-z_]+} $basesyntax fragment
  foreach coresyntax $syntax {
    lappend lx [list $fragment $coresyntax 0]
  }
}
output_list {} 225 [lsort -index 1 $lx]

hd_putsnl "<hr class='xhr'>"
hd_putsnl "<dl>"
foreach basesyntax [lsort [array names corefuncset]] {
  foreach {syntax keywords desc} $corefuncset($basesyntax) break
  regsub -all {\s+} [string trim $syntax] {<br />} syntax
  regsub -all {\(([^*)]+)\)} $syntax {(<i>\1</i>)} syntax
................................................................................
foreach basesyntax [array names corefuncset] {
  foreach {syntax keywords desc} $corefuncset($basesyntax) break
  regexp {^[a-z_]+} $basesyntax fragment
  foreach coresyntax $syntax {
    lappend lx [list $fragment $coresyntax 0]
  }
}
output_list {} 225 [lsort -index 1 $lx]

hd_putsnl "<hr class='xhr'>"
hd_putsnl "<dl>"
foreach basesyntax [lsort [array names corefuncset]] {
  foreach {syntax keywords desc} $corefuncset($basesyntax) break
  regsub -all {\s+} [string trim $syntax] {<br />} syntax
  regsub -all {\(([^*)]+)\)} $syntax {(<i>\1</i>)} syntax
................................................................................
</p>

<tcl>
set lx {}
foreach word $keyword_list {
  lappend lx [list {} $word 0]
}
output_list {} 200 $lx
</tcl>
<blockquote>
<table width="100%"><tr>
<td align="left" valign="top" width="20%">
<tcl>







<
|







 







|







 







|







 







|





61
62
63
64
65
66
67

68
69
70
71
72
73
74
75
....
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
....
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
....
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
  foreach {section} [lsort -index 0 -dictionary $lang_section_list] {
    foreach {s_title s_tag s_kw} $section {}
    if {$s_kw == ""} {
      set s_kw $s_title
    }
    lappend lx [list $s_kw $s_title 0]
  }

  hd_list_of_links {} 340 $lx
</tcl>
</ul></td></tr></table>

<p>^The routines [sqlite3_prepare_v2()], [sqlite3_prepare()],
[sqlite3_prepare16()], [sqlite3_prepare16_v2()], 
[sqlite3_exec()], and [sqlite3_get_table()] accept
an SQL statement list (sql-stmt-list) which is a semicolon-separated
................................................................................
foreach basesyntax [array names corefuncset] {
  foreach {syntax keywords desc} $corefuncset($basesyntax) break
  regexp {^[a-z_]+} $basesyntax fragment
  foreach coresyntax $syntax {
    lappend lx [list $fragment $coresyntax 0]
  }
}
hd_list_of_links {} 225 [lsort -index 1 $lx]

hd_putsnl "<hr class='xhr'>"
hd_putsnl "<dl>"
foreach basesyntax [lsort [array names corefuncset]] {
  foreach {syntax keywords desc} $corefuncset($basesyntax) break
  regsub -all {\s+} [string trim $syntax] {<br />} syntax
  regsub -all {\(([^*)]+)\)} $syntax {(<i>\1</i>)} syntax
................................................................................
foreach basesyntax [array names corefuncset] {
  foreach {syntax keywords desc} $corefuncset($basesyntax) break
  regexp {^[a-z_]+} $basesyntax fragment
  foreach coresyntax $syntax {
    lappend lx [list $fragment $coresyntax 0]
  }
}
hd_list_of_links {} 225 [lsort -index 1 $lx]

hd_putsnl "<hr class='xhr'>"
hd_putsnl "<dl>"
foreach basesyntax [lsort [array names corefuncset]] {
  foreach {syntax keywords desc} $corefuncset($basesyntax) break
  regsub -all {\s+} [string trim $syntax] {<br />} syntax
  regsub -all {\(([^*)]+)\)} $syntax {(<i>\1</i>)} syntax
................................................................................
</p>

<tcl>
set lx {}
foreach word $keyword_list {
  lappend lx [list {} $word 0]
}
hd_list_of_links {} 200 $lx
</tcl>
<blockquote>
<table width="100%"><tr>
<td align="left" valign="top" width="20%">
<tcl>

Changes to pages/pragma.in.

1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
    lappend lx [list "PRAGMA $ref" $prag 4]
  } elseif {[info exists PragmaTest($prag)]} {
    lappend lx [list "PRAGMA $ref" $prag 5]
  } else {
    lappend lx [list "PRAGMA $ref" $prag 0]
  }
}
output_list {} 250 [lsort -index 1 $lx]
</tcl>
<p>Notes:
<ol>
<li>Pragmas whose names are <s>struck through</s>
are deprecated. Do not use them. They exist
for historical compatibility.
<li>These pragmas are used for debugging SQLite and







|







1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
    lappend lx [list "PRAGMA $ref" $prag 4]
  } elseif {[info exists PragmaTest($prag)]} {
    lappend lx [list "PRAGMA $ref" $prag 5]
  } else {
    lappend lx [list "PRAGMA $ref" $prag 0]
  }
}
hd_list_of_links {} 250 [lsort -index 1 $lx]
</tcl>
<p>Notes:
<ol>
<li>Pragmas whose names are <s>struck through</s>
are deprecated. Do not use them. They exist
for historical compatibility.
<li>These pragmas are used for debugging SQLite and

Changes to pages/rescode.in.

739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
...
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
   [result code definitions|defined in sqlite3.h] and are listed in
   alphabetical order below: 
<tcl>
set lx {}
foreach name [lsort [array names prim_rc]] {
  lappend lx [list $name "$name&nbsp;($prim_rc($name))" 0]
}
output_list {} 320 $lx

hd_fragment extrc {extended result code} {extended result codes} \
                  {extended error code} {extended error codes}
</tcl>
<h1>Extended Result Code List</h1>
<p>The $nExtCode extended result codes
  are [extended result code definitions|defined in sqlite3.h] and are
................................................................................
  listed in alphabetical order below:
<tcl>

set lx {}
foreach name [lsort [array names ext_rc]] {
  lappend lx [list $name "$name&nbsp;($ext_rc($name))" 0]
}
output_list {} 450 $lx

</tcl>
<h1>Result Code Meanings</h1>
<p>
The meanings for all $nResCode result code values are shown below,
in numeric order.








|







 







|







739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
...
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
   [result code definitions|defined in sqlite3.h] and are listed in
   alphabetical order below: 
<tcl>
set lx {}
foreach name [lsort [array names prim_rc]] {
  lappend lx [list $name "$name&nbsp;($prim_rc($name))" 0]
}
hd_list_of_links {} 320 $lx

hd_fragment extrc {extended result code} {extended result codes} \
                  {extended error code} {extended error codes}
</tcl>
<h1>Extended Result Code List</h1>
<p>The $nExtCode extended result codes
  are [extended result code definitions|defined in sqlite3.h] and are
................................................................................
  listed in alphabetical order below:
<tcl>

set lx {}
foreach name [lsort [array names ext_rc]] {
  lappend lx [list $name "$name&nbsp;($ext_rc($name))" 0]
}
hd_list_of_links {} 450 $lx

</tcl>
<h1>Result Code Meanings</h1>
<p>
The meanings for all $nResCode result code values are shown below,
in numeric order.

Changes to pages/session.in.

285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
...
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
hd_header {List Of SQLite Objects}
hd_enable_main 0
hd_putsnl {<a href="intro.html"><h2>Session Module C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>Objects:</h2>
<tcl>
output_list {} 300 [lsort $objlist]
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="constlist.html">Constants</a> and
<a href="funclist.html">Functions</a>.}
hd_close_aux
hd_enable_main 1
hd_putsnl {<hr>}
................................................................................
hd_enable_main 0
hd_putsnl {<a href="intro.html"><h2>Session Module C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>Constants:</h2>
<tcl>
set clist [lsort -index 1 $clist]
output_list {} 400 $clist
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="objlist.html">Objects</a> and
<a href="funclist.html">Functions</a>.</p>}
hd_enable_main 1
hd_close_aux
hd_putsnl {<hr>}
................................................................................
hd_enable_main 0
hd_putsnl {<a href="intro.html"><h2>Session Module C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>Functions:</h2>
<tcl>
set funclist [lsort -index 1 $funclist]
output_list {} 300 $funclist
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="constlist.html">Constants</a> and
<a href="objlist.html">Objects</a>.</p>}
hd_enable_main 1
hd_close_aux
hd_putsnl {<hr>}







|







 







|







 







|







285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
...
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
hd_header {List Of SQLite Objects}
hd_enable_main 0
hd_putsnl {<a href="intro.html"><h2>Session Module C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>Objects:</h2>
<tcl>
hd_list_of_links {} 300 [lsort $objlist]
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="constlist.html">Constants</a> and
<a href="funclist.html">Functions</a>.}
hd_close_aux
hd_enable_main 1
hd_putsnl {<hr>}
................................................................................
hd_enable_main 0
hd_putsnl {<a href="intro.html"><h2>Session Module C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>Constants:</h2>
<tcl>
set clist [lsort -index 1 $clist]
hd_list_of_links {} 400 $clist
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="objlist.html">Objects</a> and
<a href="funclist.html">Functions</a>.</p>}
hd_enable_main 1
hd_close_aux
hd_putsnl {<hr>}
................................................................................
hd_enable_main 0
hd_putsnl {<a href="intro.html"><h2>Session Module C Interface</h2></a>}
hd_enable_main 1
</tcl>
<h2>Functions:</h2>
<tcl>
set funclist [lsort -index 1 $funclist]
hd_list_of_links {} 300 $funclist
hd_enable_main 0
hd_putsnl {<p>Other lists:
<a href="constlist.html">Constants</a> and
<a href="objlist.html">Objects</a>.</p>}
hd_enable_main 1
hd_close_aux
hd_putsnl {<hr>}

Changes to pages/syntax.in.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<h1 align="center">List of SQLite Syntax Diagrams</h1>

<tcl>
set lx {}
foreach name [lsort $syntax_order] {
  lappend lx [list syntax/$name.html $name 0]
}
output_list {} 300 $lx

foreach name $syntax_order {
  file mkdir $::DEST/syntax
  hd_open_aux syntax/$name.html
  hd_keywords $name "$name syntax diagram"
  hd_enable_main 0
  hd_header "SQLite Syntax: $name"







|







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<h1 align="center">List of SQLite Syntax Diagrams</h1>

<tcl>
set lx {}
foreach name [lsort $syntax_order] {
  lappend lx [list syntax/$name.html $name 0]
}
hd_list_of_links {} 300 $lx

foreach name $syntax_order {
  file mkdir $::DEST/syntax
  hd_open_aux syntax/$name.html
  hd_keywords $name "$name syntax diagram"
  hd_enable_main 0
  hd_header "SQLite Syntax: $name"

Changes to wrap.tcl.

160
161
162
163
164
165
166



































































































































167
168
169
170
171
172
173
    } else {
      lappend backlink($kw) $hd(fn-aux)
    }
  }
}






































































































































# Record the fact that all keywords given in the argument list should
# cause a jump to the current location in the current file.
#
# If only the main output file is open, then all references to the
# keyword jump to the main output file.  If both main and aux are
# open then references from within the main file jump to the main file







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
    } else {
      lappend backlink($kw) $hd(fn-aux)
    }
  }
}


# Convert the keyword $kw into an appropriate relative URI
# This is a helper routine to hd_list_of_links
#
proc hd_keyword_to_uri {kw} {
  global hd llink glink
  if {[string match {*.html} $kw]} {return $kw}
  if {$hd(enable-main)} {
    set fn $hd(fn-main)
    set res ""
    if {[info exists llink($fn:$kw)]} {
      set res "$hd(rootpath-main)$llink($fn:$kw)"
    } elseif {[info exists glink($kw)]} {
      set res "$hd(rootpath-main)$glink($kw)"
    }
    if {$res!=""} {
      if {$hd(fragment)!=""} {
        lappend backlink($kw) $fn#$hd(fragment)
      } else {
        lappend backlink($kw) $fn
      }
    }
    return $res
  }
  if {$hd(enable-aux)} {
    if {[info exists glink($kw)]} {
      if {$hd(aux-fragment)!=""} {
        lappend backlink($kw) $hd(fn-aux)#$hd(aux-fragment)
      } else {
        lappend backlink($kw) $hd(fn-aux)
      }
      return $hd(rootpath-aux)$glink($kw)
    }
  }
  return ""
}

# Generate a Javascript table containing the URL and Label from $lx
# This is a helper routine for hd_list_of_links.
#
proc hd_list_of_links_javascript {lx} {
  set sep {[}
  foreach entry $lx {
    foreach {link label s} $entry break
    set url [hd_keyword_to_uri $link]
    hd_puts "${sep}{\"u\":\"$url\",\"x\":\"$label\",\"s\":$s}"
    set sep ",\n"
  }
  hd_putsnl "\];"
}

# Output HTML/JS that displays the list $lx in multiple columns
# under the assumption that each column is $w pixels wide.  The
# number of columns automatically adjusts to fill the available
# screen width.
#
# If $title is not an empty string, then it is used as a title for
# the list of links
#
# $lx is a list of triples.  Each triple is {KEYWORD LABEL S}.  The
# S determines a suffix added to each list element:
#
#    0:     Add nothing (the default and common case)
#    1:     Add the "(exp)" suffix
#    2:     Strike through the text and do not hyperlink
#    3:     Strike through the text and add &sup1
#    4:     Add &sup2
#    5:     Add &sup3
#
proc hd_list_of_links {title w lx} {
  global listcount hd
  if {![info exists listcount]} {
    set listcount 1
  } else {
    incr listcount
  }
  set tx listtab$listcount
  set vx listitems$listcount
  hd_puts "<style>\n#$tx tr td {vertical-align:top;}\n"
  hd_puts "</style>\n"
  hd_putsnl "<table id='$tx' width='100%'></table>"
  hd_putsnl "<script>"
  hd_puts "var $vx = "
  if {$hd(enable-main) && $hd(enable-aux)} {
    set hd(enable-main) 0
    hd_list_of_links_javascript $lx
    set hd(enable-main) 1
    set hd(enable-aux) 0
    hd_list_of_links_javascript $lx
    set hd(enable-aux) 1
  } else {
    hd_list_of_links_javascript $lx
  }
  hd_putsnl "var j = 0;"
  hd_putsnl "var w = Math.max(document.documentElement.clientWidth, \
             window.innerWidth || 0);"
  hd_putsnl "var nCol = Math.floor(w/$w);"
  hd_putsnl "if(nCol<=0) nCol=1;"
  hd_putsnl "var nRow = Math.ceil(($vx.length+1)/nCol);"
  if {$title!=""} {
    hd_putsnl "var h=\"<tr><td colspan=\"+nCol;"
    hd_putsnl "h += \">$title</td></tr><tr><td><ul class='multicol_list'>\""
  } else {
    hd_putsnl "var h=\"<tr><td><ul class='multicol_list'>\""
  }
  hd_putsnl "var ea"
  hd_putsnl "for(var i=0; i<$vx.length; i++){"
  hd_putsnl "  if( (++j)>nRow ){"
  hd_putsnl "    h += \"</ul></td>\\n<td><ul class='multicol_list'>\\n\";"
  hd_putsnl "    j = 1;"
  hd_putsnl "  }"
  hd_putsnl "  if($vx\[i\].u==\"\" || $vx\[i\].s==2){"
  hd_putsnl "    h += \"<li>\""
  hd_putsnl "    ea = \"\""
  hd_putsnl "  }else{"
  hd_putsnl "    h += \"<li><a href='\";"
  hd_putsnl "    h += $vx\[i\].u;"
  hd_putsnl "    h += \"'>\";"
  hd_putsnl "    ea = \"</a>\""
  hd_putsnl "  }"
  hd_putsnl "  if($vx\[i\].s==2 || $vx\[i\].s==3) h += \"<s>\""
  hd_putsnl "  h += $vx\[i\].x;"
  hd_putsnl "  if($vx\[i\].s==2 || $vx\[i\].s==3) h += \"</s>\""
  hd_putsnl "  h += ea"
  hd_putsnl "  if($vx\[i\].s==1) h += \"<small><i>(exp)</i></small>\\n\";"
  hd_putsnl "  if($vx\[i\].s==3) h += \"&sup1\\n\";"
  hd_putsnl "  if($vx\[i\].s==4) h += \"&sup2\\n\";"
  hd_putsnl "  if($vx\[i\].s==5) h += \"&sup3\\n\";"
  hd_putsnl "}"
  hd_putsnl "document.getElementById(\"$tx\").innerHTML = h;"
  hd_putsnl "</script>"
}

# Record the fact that all keywords given in the argument list should
# cause a jump to the current location in the current file.
#
# If only the main output file is open, then all references to the
# keyword jump to the main output file.  If both main and aux are
# open then references from within the main file jump to the main file