Improved first run

This commit is contained in:
Graham Nelson 2019-03-12 23:32:12 +00:00
parent 8deee1569f
commit a999bfd371
76 changed files with 722 additions and 246 deletions

View file

@ -92,8 +92,15 @@ program: some input, some thinking, a choice of three forms of output.
=
void Main::follow_instructions(inweb_instructions *ins) {
if (ins->inweb_mode == TRANSLATE_MODE) @<Translate a makefile@>
else if (ins->inweb_mode != NO_MODE) @<Analyse, tangle or weave an existing web@>;
web *W = NULL;
if (ins->chosen_web)
W = Reader::load_web(ins->chosen_web, ins->chosen_file,
Modules::make_search_path(ins->import_setting), ins->verbose_switch,
ins->inweb_mode, ins->weave_into_setting);
if (no_inweb_errors == 0) {
if (ins->inweb_mode == TRANSLATE_MODE) @<Translate a makefile@>
else if (ins->inweb_mode != NO_MODE) @<Analyse, tangle or weave an existing web@>;
}
}
@ This is a one-off featurette:
@ -104,22 +111,17 @@ void Main::follow_instructions(inweb_instructions *ins) {
if ((ins->gitignore_setting) && (ins->prototype_setting == NULL))
ins->prototype_setting = Filenames::from_text(I"gitignorescript.txt");
if (ins->makefile_setting)
Makefiles::write(NULL, ins->prototype_setting, ins->makefile_setting);
Makefiles::write(W, ins->prototype_setting, ins->makefile_setting);
else if (ins->gitignore_setting)
Git::write_gitignore(NULL, ins->prototype_setting, ins->gitignore_setting);
Git::write_gitignore(W, ins->prototype_setting, ins->gitignore_setting);
@ But otherwise we read and fully parse a web, and then do something with it:
@ But otherwise we do something with the given web:
@<Analyse, tangle or weave an existing web@> =
web *W = Reader::load_web(ins->chosen_web, ins->chosen_file,
Modules::make_search_path(ins->import_setting), ins->verbose_switch,
ins->inweb_mode, ins->weave_into_setting);
if (no_inweb_errors == 0) {
Reader::print_web_statistics(W);
if (ins->inweb_mode == ANALYSE_MODE) @<Analyse the web@>;
if (ins->inweb_mode == TANGLE_MODE) @<Tangle the web@>;
if (ins->inweb_mode == WEAVE_MODE) @<Weave the web@>;
}
Reader::print_web_statistics(W);
if (ins->inweb_mode == ANALYSE_MODE) @<Analyse the web@>;
if (ins->inweb_mode == TANGLE_MODE) @<Tangle the web@>;
if (ins->inweb_mode == WEAVE_MODE) @<Weave the web@>;
@ "Analysis" invokes any combination of the following diagnostic tools:

View file

@ -103,21 +103,23 @@ void Makefiles::scan_makefile_line(text_stream *line, text_file_position *tfp, v
WRITE("INWEB = "); Makefiles::pathname_slashed(OUT, path_to_inweb); WRITE("/Tangled/inweb\n");
pathname *path_to_intest = Pathnames::subfolder(Pathnames::up(path_to_inweb), I"intest");
WRITE("INTEST = "); Makefiles::pathname_slashed(OUT, path_to_intest); WRITE("/Tangled/intest\n");
WRITE("MYNAME = %S\n", Pathnames::directory_name(MS->for_web->path_to_web));
WRITE("ME = "); Makefiles::pathname_slashed(OUT, MS->for_web->path_to_web);
WRITE("\n");
module *MW = MS->for_web->as_module;
module *X = FIRST_IN_LINKED_LIST(module, MW->dependencies);
if (X) {
WRITE("# which depends on:\n");
int N = 1;
LOOP_OVER_LINKED_LIST(X, module, MW->dependencies) {
WRITE("MODULE%d = ", N++);
Makefiles::pathname_slashed(OUT, X->module_location);
WRITE("\n");
if (MS->for_web) {
WRITE("MYNAME = %S\n", Pathnames::directory_name(MS->for_web->path_to_web));
WRITE("ME = "); Makefiles::pathname_slashed(OUT, MS->for_web->path_to_web);
WRITE("\n");
module *MW = MS->for_web->as_module;
module *X = FIRST_IN_LINKED_LIST(module, MW->dependencies);
if (X) {
WRITE("# which depends on:\n");
int N = 1;
LOOP_OVER_LINKED_LIST(X, module, MW->dependencies) {
WRITE("MODULE%d = ", N++);
Makefiles::pathname_slashed(OUT, X->module_location);
WRITE("\n");
}
}
MS->last_line_was_blank = FALSE;
}
MS->last_line_was_blank = FALSE;
Regexp::dispose_of(&mr);
return;

View file

@ -1 +1,52 @@
# Inweb
# Inweb version 7 'Escape to Danger'
## About Inweb
Inweb offers a modern approach to literate programming, a methodology created
by Donald Knuth in the late 1970s. A literate program, or "web", is constructed
in a narrative way, and is intended to be readable by humans as well as by
other programs. For example, the human-readable (or "woven") form of Inweb
itself is [here](docs/webs.html).
A comprehensive Inweb manual can be [read here](docs/inweb/P-iti.html).
Inweb is intentionally self-sufficient, with no dependencies on any other
software: it cam be built on any platform supporting the gcc or clang C
compilers. Its main use since 2004 has been to build the Inform compiler and
its associated tools (see [ganelson/inform](https://github.com/ganelson/inform)),
including another general-purpose tool, [ganelson/intest](https://github.com/ganelson/intest).
## Build Instructions
Inweb is itself a literate program. There is clearly a circularity here: to
compile Inweb, you must first run Inweb to "tangle" it, that is, to prepare
it for compilation. But if you already had Inweb, you wouldn't need to compile it.
Because of that, and because of the need to run cross-platform, the initial
setup takes a few minutes:
* Create a directory to work in, called, say, "work". Change the current directory to this.
* Clone Inweb as "work/inweb".
* Run **one of the following commands**. Unix is for any generic version of Unix,
non-Linux, non-MacOS: Solaris, for example. Android support is currently disabled
(though only because its build settings are currently missing from the inweb
distribution). The older macos32 platform won't build with the MacOS SDK from
10.14 onwards, and in any case 32-bit executables won't run from 10.15 onwards:
so use the default macos unless you need to build for an old version of MacOS.
* "make -f inweb/inweb.mk macos"
* "make -f inweb/inweb.mk macos32"
* "make -f inweb/inweb.mk linux"
* "make -f inweb/inweb.mk windows"
* "make -f inweb/inweb.mk unix"
* "make -f inweb/inweb.mk android"
* You should see some typical make chatter, ending in a reply such as "===
Platform set to 64-bit MacOS. Now: make -f inweb/inweb.mk initial ===".
(All that happened, in fact, was that a platform-specific file of make settings —
what compilers to use, what options, and so on — was copied over to become the
file inweb/platform-settings.mk.)
* Now run the command:
* "make -f inweb/inweb.mk initial"
* You should now have a working copy of Inweb. For a simple test, try
"inweb/Tangled/inweb -help". To build Inweb again, no need to use "initial",
and simply:
* "make -f inweb/inweb.mk"

View file

@ -2601,7 +2601,7 @@ int SoundFiles__get_MIDI_information(FILE *pFile, unsigned int *pType, unsigne
int main(int argc, char **argv) ;
#line 94 "inweb/Chapter 1/Program Control.w"
void Main__follow_instructions(inweb_instructions *ins) ;
#line 283 "inweb/Chapter 1/Program Control.w"
#line 285 "inweb/Chapter 1/Program Control.w"
void Main__error_in_web(text_stream *message, source_line *sl) ;
#line 47 "inweb/Chapter 1/Configuration.w"
inweb_instructions Configuration__read(int argc, char **argv) ;
@ -3221,9 +3221,9 @@ int RunningTeX__substitute_post_processing_data(text_stream *to, weave_target *
void Makefiles__write(web *W, filename *prototype, filename *F) ;
#line 37 "inweb/Chapter 6/Makefiles.w"
void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, void *X) ;
#line 194 "inweb/Chapter 6/Makefiles.w"
#line 196 "inweb/Chapter 6/Makefiles.w"
void Makefiles__pathname_slashed(OUTPUT_STREAM, pathname *P) ;
#line 208 "inweb/Chapter 6/Makefiles.w"
#line 210 "inweb/Chapter 6/Makefiles.w"
void Makefiles__repeat(OUTPUT_STREAM, text_stream *prefix, int every_time, text_stream *matter, int as_lines, text_stream *suffix, text_file_position *tfp, makefile_state *MS) ;
#line 15 "inweb/Chapter 6/Git Support.w"
void Git__write_gitignore(web *W, filename *prototype, filename *F) ;
@ -10936,32 +10936,34 @@ int main(int argc, char **argv) {
#line 94 "inweb/Chapter 1/Program Control.w"
void Main__follow_instructions(inweb_instructions *ins) {
if (ins->inweb_mode == TRANSLATE_MODE)
web *W = NULL;
if (ins->chosen_web)
W = Reader__load_web(ins->chosen_web, ins->chosen_file,
Modules__make_search_path(ins->import_setting), ins->verbose_switch,
ins->inweb_mode, ins->weave_into_setting);
if (no_inweb_errors == 0) {
if (ins->inweb_mode == TRANSLATE_MODE)
{
#line 102 "inweb/Chapter 1/Program Control.w"
#line 109 "inweb/Chapter 1/Program Control.w"
if ((ins->makefile_setting) && (ins->prototype_setting == NULL))
ins->prototype_setting = Filenames__from_text(TL_IS_22);
if ((ins->gitignore_setting) && (ins->prototype_setting == NULL))
ins->prototype_setting = Filenames__from_text(TL_IS_23);
if (ins->makefile_setting)
Makefiles__write(NULL, ins->prototype_setting, ins->makefile_setting);
Makefiles__write(W, ins->prototype_setting, ins->makefile_setting);
else if (ins->gitignore_setting)
Git__write_gitignore(NULL, ins->prototype_setting, ins->gitignore_setting);
Git__write_gitignore(W, ins->prototype_setting, ins->gitignore_setting);
}
#line 95 "inweb/Chapter 1/Program Control.w"
#line 101 "inweb/Chapter 1/Program Control.w"
else if (ins->inweb_mode != NO_MODE)
else if (ins->inweb_mode != NO_MODE)
{
#line 114 "inweb/Chapter 1/Program Control.w"
web *W = Reader__load_web(ins->chosen_web, ins->chosen_file,
Modules__make_search_path(ins->import_setting), ins->verbose_switch,
ins->inweb_mode, ins->weave_into_setting);
if (no_inweb_errors == 0) {
Reader__print_web_statistics(W);
if (ins->inweb_mode == ANALYSE_MODE)
#line 121 "inweb/Chapter 1/Program Control.w"
Reader__print_web_statistics(W);
if (ins->inweb_mode == ANALYSE_MODE)
{
#line 127 "inweb/Chapter 1/Program Control.w"
#line 129 "inweb/Chapter 1/Program Control.w"
if (ins->swarm_mode != SWARM_OFF_SWM)
Errors__fatal("only specific parts of the web can be analysed");
if (ins->catalogue_switch)
@ -10978,17 +10980,17 @@ void Main__follow_instructions(inweb_instructions *ins) {
Analyser__scan_line_categories(W, ins->chosen_range);
}
#line 119 "inweb/Chapter 1/Program Control.w"
#line 122 "inweb/Chapter 1/Program Control.w"
;
if (ins->inweb_mode == TANGLE_MODE)
if (ins->inweb_mode == TANGLE_MODE)
{
#line 157 "inweb/Chapter 1/Program Control.w"
#line 159 "inweb/Chapter 1/Program Control.w"
TEMPORARY_TEXT(tangle_leaf);
tangle_target *tn = NULL;
if (Str__eq_wide_string(ins->chosen_range, L"0")) {
{
#line 182 "inweb/Chapter 1/Program Control.w"
#line 184 "inweb/Chapter 1/Program Control.w"
tn = NULL;
if (Bibliographic__data_exists(W, TL_IS_24))
Str__copy(tangle_leaf, Bibliographic__get_datum(W, TL_IS_25));
@ -10997,24 +10999,24 @@ void Main__follow_instructions(inweb_instructions *ins) {
Str__concatenate(tangle_leaf, W->main_language->file_extension);
}
#line 160 "inweb/Chapter 1/Program Control.w"
#line 162 "inweb/Chapter 1/Program Control.w"
;
} else if (Reader__get_section_for_range(W, ins->chosen_range)) {
{
#line 192 "inweb/Chapter 1/Program Control.w"
#line 194 "inweb/Chapter 1/Program Control.w"
section *S = Reader__get_section_for_range(W, ins->chosen_range);
tn = S->sect_target;
if (tn == NULL) Errors__fatal("section cannot be independently tangled");
Str__copy(tangle_leaf, Filenames__get_leafname(S->source_file_for_section));
}
#line 162 "inweb/Chapter 1/Program Control.w"
#line 164 "inweb/Chapter 1/Program Control.w"
;
} else {
{
#line 201 "inweb/Chapter 1/Program Control.w"
#line 203 "inweb/Chapter 1/Program Control.w"
chapter *C;
LOOP_OVER(C, chapter)
if (Str__eq(ins->chosen_range, C->ch_range)) {
@ -11033,7 +11035,7 @@ void Main__follow_instructions(inweb_instructions *ins) {
Errors__fatal("only the entire web, or specific sections, can be tangled");
}
#line 164 "inweb/Chapter 1/Program Control.w"
#line 166 "inweb/Chapter 1/Program Control.w"
;
}
if (Str__len(tangle_leaf) == 0) { Errors__fatal("no tangle destination known"); }
@ -11049,15 +11051,15 @@ void Main__follow_instructions(inweb_instructions *ins) {
DISCARD_TEXT(tangle_leaf);
}
#line 120 "inweb/Chapter 1/Program Control.w"
#line 123 "inweb/Chapter 1/Program Control.w"
;
if (ins->inweb_mode == WEAVE_MODE)
if (ins->inweb_mode == WEAVE_MODE)
{
#line 221 "inweb/Chapter 1/Program Control.w"
#line 223 "inweb/Chapter 1/Program Control.w"
Numbering__number_web(W);
if (ins->weave_docs)
{
#line 253 "inweb/Chapter 1/Program Control.w"
#line 255 "inweb/Chapter 1/Program Control.w"
if (ins->weave_into_setting == NULL) {
pathname *docs = Pathnames__subfolder(W->path_to_web, TL_IS_27);
Pathnames__create_in_file_system(docs);
@ -11077,7 +11079,7 @@ void Main__follow_instructions(inweb_instructions *ins) {
ins->weave_pattern = TL_IS_31;
}
#line 222 "inweb/Chapter 1/Program Control.w"
#line 224 "inweb/Chapter 1/Program Control.w"
;
theme_tag *tag = Tags__find_by_name(ins->tag_setting, FALSE);
@ -11092,14 +11094,14 @@ void Main__follow_instructions(inweb_instructions *ins) {
if (r != SWARM_OFF_SWM) ins->swarm_mode = r;
{
#line 272 "inweb/Chapter 1/Program Control.w"
#line 274 "inweb/Chapter 1/Program Control.w"
section *S; int k = 1;
LOOP_OVER(S, section)
if (Reader__range_within(S->range, ins->chosen_range))
S->printed_number = k++;
}
#line 234 "inweb/Chapter 1/Program Control.w"
#line 236 "inweb/Chapter 1/Program Control.w"
;
if (ins->swarm_mode == SWARM_OFF_SWM) {
int shall_we_open = ins->open_pdf_switch;
@ -11116,16 +11118,16 @@ void Main__follow_instructions(inweb_instructions *ins) {
Formats__end_weaving(W, pattern);
}
#line 121 "inweb/Chapter 1/Program Control.w"
#line 124 "inweb/Chapter 1/Program Control.w"
;
}
#line 102 "inweb/Chapter 1/Program Control.w"
;
}
}
#line 96 "inweb/Chapter 1/Program Control.w"
;
}
#line 283 "inweb/Chapter 1/Program Control.w"
#line 285 "inweb/Chapter 1/Program Control.w"
void Main__error_in_web(text_stream *message, source_line *sl) {
if (sl) {
Errors__in_text_file_S(message, &(sl->source));
@ -19860,21 +19862,23 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v
WRITE("INWEB = "); Makefiles__pathname_slashed(OUT, path_to_inweb); WRITE("/Tangled/inweb\n");
pathname *path_to_intest = Pathnames__subfolder(Pathnames__up(path_to_inweb), TL_IS_298);
WRITE("INTEST = "); Makefiles__pathname_slashed(OUT, path_to_intest); WRITE("/Tangled/intest\n");
WRITE("MYNAME = %S\n", Pathnames__directory_name(MS->for_web->path_to_web));
WRITE("ME = "); Makefiles__pathname_slashed(OUT, MS->for_web->path_to_web);
WRITE("\n");
module *MW = MS->for_web->as_module;
module *X = FIRST_IN_LINKED_LIST(module, MW->dependencies);
if (X) {
WRITE("# which depends on:\n");
int N = 1;
LOOP_OVER_LINKED_LIST(X, module, MW->dependencies) {
WRITE("MODULE%d = ", N++);
Makefiles__pathname_slashed(OUT, X->module_location);
WRITE("\n");
if (MS->for_web) {
WRITE("MYNAME = %S\n", Pathnames__directory_name(MS->for_web->path_to_web));
WRITE("ME = "); Makefiles__pathname_slashed(OUT, MS->for_web->path_to_web);
WRITE("\n");
module *MW = MS->for_web->as_module;
module *X = FIRST_IN_LINKED_LIST(module, MW->dependencies);
if (X) {
WRITE("# which depends on:\n");
int N = 1;
LOOP_OVER_LINKED_LIST(X, module, MW->dependencies) {
WRITE("MODULE%d = ", N++);
Makefiles__pathname_slashed(OUT, X->module_location);
WRITE("\n");
}
}
MS->last_line_was_blank = FALSE;
}
MS->last_line_was_blank = FALSE;
Regexp__dispose_of(&mr);
return;
@ -19898,7 +19902,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v
if (Regexp__match(&mr, line, L" *{tool} *(%C+) (%C+) (%c+) *"))
{
#line 125 "inweb/Chapter 6/Makefiles.w"
#line 127 "inweb/Chapter 6/Makefiles.w"
Modules__new(mr.exp[0], Pathnames__from_text(mr.exp[2]), MAKEFILE_TOOL_MOM);
WRITE("%SWEB = %S\n", mr.exp[0], mr.exp[2]);
WRITE("%SMAKER = $(%SWEB)/%S.mk\n", mr.exp[0], mr.exp[0], mr.exp[1]);
@ -19912,7 +19916,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v
;
if (Regexp__match(&mr, line, L" *{module} *(%C+) (%C+) (%c+) *"))
{
#line 134 "inweb/Chapter 6/Makefiles.w"
#line 136 "inweb/Chapter 6/Makefiles.w"
Modules__new(mr.exp[0], Pathnames__from_text(mr.exp[2]), MAKEFILE_MODULE_MOM);
WRITE("%SWEB = %S\n", mr.exp[0], mr.exp[2]);
MS->last_line_was_blank = FALSE;
@ -19924,7 +19928,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v
;
if (Regexp__match(&mr, line, L" *{dep} *(%C+) on (%C+) *"))
{
#line 141 "inweb/Chapter 6/Makefiles.w"
#line 143 "inweb/Chapter 6/Makefiles.w"
module *MA = Modules__find_loaded_by_name(tfp, mr.exp[0]);
module *MB = Modules__find_loaded_by_name(tfp, mr.exp[1]);
if ((MA) && (MB)) Modules__dependency(MA, MB);
@ -19937,7 +19941,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v
if (Regexp__match(&mr, line, L"(%c*?) *{dependent-files} *"))
{
#line 148 "inweb/Chapter 6/Makefiles.w"
#line 150 "inweb/Chapter 6/Makefiles.w"
WRITE("%S", mr.exp[0]);
if ((MS->for_web) && (MS->for_web->chaptered == FALSE))
WRITE(" $(ME)/Contents.w $(ME)/Sections/*.w");
@ -19962,7 +19966,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v
;
if (Regexp__match(&mr, line, L"(%c*?) *{dependent-files-for} *(%C+)"))
{
#line 168 "inweb/Chapter 6/Makefiles.w"
#line 170 "inweb/Chapter 6/Makefiles.w"
WRITE("%S", mr.exp[0]);
module *MW = Modules__find_loaded_by_name(tfp, mr.exp[1]);
if (MW) {
@ -19987,7 +19991,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v
{
#line 185 "inweb/Chapter 6/Makefiles.w"
#line 187 "inweb/Chapter 6/Makefiles.w"
if (Str__len(line) == 0) {
if (MS->last_line_was_blank == FALSE) WRITE("\n");
MS->last_line_was_blank = TRUE;
@ -20001,7 +20005,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v
;
}
#line 194 "inweb/Chapter 6/Makefiles.w"
#line 196 "inweb/Chapter 6/Makefiles.w"
void Makefiles__pathname_slashed(OUTPUT_STREAM, pathname *P) {
TEMPORARY_TEXT(PT)
WRITE_TO(PT, "%p", P);
@ -20013,7 +20017,7 @@ void Makefiles__pathname_slashed(OUTPUT_STREAM, pathname *P) {
DISCARD_TEXT(PT)
}
#line 208 "inweb/Chapter 6/Makefiles.w"
#line 210 "inweb/Chapter 6/Makefiles.w"
void Makefiles__repeat(OUTPUT_STREAM, text_stream *prefix, int every_time, text_stream *matter,
int as_lines, text_stream *suffix, text_file_position *tfp, makefile_state *MS) {
module *M;

View file

@ -272,7 +272,9 @@ safety problems.
<p class="endnote">The function Foundation::end appears nowhere else.</p>
<!--End of weave: 171 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 1: Setting Up.)</i></li><li><a href="1-pp.html">Continue with 'POSIX Platforms'</a></li></ul><hr class="tocbar">
<!--End of weave: 171 lines from a web of 9333-->
</body>
</html>

View file

@ -11,7 +11,7 @@
<!--Weave of '1/pp' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">&#9733;</a></li><li><a href="index.html">foundation</a></li><li><a href="index.html#1">Chapter 1: Setting Up</a></li><li><b>POSIX Platforms</b></li></ul><p class="purpose">A version of our operating system interface suitable for POSIX-compliant operating systems.</p>
<ul class="toc"><li><a href="#SP3">&#167;3. Mac OS X</a></li><li><a href="#SP4">&#167;4. Generic Unix</a></li><li><a href="#SP5">&#167;5. Linux</a></li><li><a href="#SP6">&#167;6. Android</a></li><li><a href="#SP7">&#167;7. Locale</a></li><li><a href="#SP8">&#167;8. Environment variables</a></li><li><a href="#SP9">&#167;9. Executable location</a></li><li><a href="#SP10">&#167;10. Shell commands</a></li><li><a href="#SP11">&#167;11. Directory handling</a></li><li><a href="#SP12">&#167;12. Sleep</a></li><li><a href="#SP13">&#167;13. Notifications</a></li><li><a href="#SP15">&#167;15. Concurrency</a></li><li><a href="#SP17">&#167;17. Mutexes</a></li></ul><hr class="tocbar">
<ul class="toc"><li><a href="#SP3">&#167;3. Mac OS X</a></li><li><a href="#SP4">&#167;4. Generic Unix</a></li><li><a href="#SP5">&#167;5. Linux</a></li><li><a href="#SP6">&#167;6. Android</a></li><li><a href="#SP7">&#167;7. Locale</a></li><li><a href="#SP8">&#167;8. Environment variables</a></li><li><a href="#SP9">&#167;9. Executable location</a></li><li><a href="#SP10">&#167;10. Shell commands</a></li><li><a href="#SP12">&#167;12. Directory handling</a></li><li><a href="#SP13">&#167;13. Sleep</a></li><li><a href="#SP14">&#167;14. Notifications</a></li><li><a href="#SP16">&#167;16. Concurrency</a></li><li><a href="#SP18">&#167;18. Mutexes</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. </b>The C standard library leaves many questions unanswered about how to deal
with the host operating system: for example, it knows very little about
@ -323,11 +323,60 @@ string.
<p class="inwebparagraph"></p>
<p class="endnote">This paragraph is used only if PLATFORM_POSIX is defined.</p>
<p class="endnote">This paragraph is used only if PLATFORM_POSIX is defined and if PLATFORM_MACOS is undefined.</p>
<p class="endnote">The function Platform::system is used in 1/wp (<a href="1-wp.html#SP6">&#167;6</a>), 3/shl (<a href="3-shl.html#SP5">&#167;5</a>).</p>
<p class="endnote">The function Platform::system is used in <a href="#SP11">&#167;11</a>, 1/wp (<a href="1-wp.html#SP6">&#167;6</a>), 3/shl (<a href="3-shl.html#SP5">&#167;5</a>).</p>
<p class="inwebparagraph"><a id="SP11"></a><b>&#167;11. Directory handling. </b></p>
<p class="inwebparagraph"><a id="SP11"></a><b>&#167;11. </b>In MacOS 10.5, a new implementation of the C standard library
crippled performance of <code class="display"><span class="extract">system()</span></code> by placing it behind a global mutex, so
that it was impossible for two cores to be calling the function at the same
time. The net effect of this is that the Inform test suite, executing in
Intest, ran in 1/16th speed. This issue didn't come to light until 2019,
however, because the build setting <code class="display"><span class="extract">-mmacosx-version-min=10.4</span></code> turned out
to force use of the (perfectly good) pre-10.5 library, where <code class="display"><span class="extract">system()</span></code>
continued to run in a multi-threaded way, just as it does on Linux and
most all other Unixes. The old library was eventually withdrawn by Apple
in 2018, and in any case would stop working at some point in 2019-20 due
to the final removal of 32-bit binary support from MacOS.
</p>
<p class="inwebparagraph">It took several days to find a pthread-safe way to reimplement <code class="display"><span class="extract">system()</span></code>.
The obvious way, using <code class="display"><span class="extract">fork()</span></code> and then running <code class="display"><span class="extract">execve()</span></code> on the child
process &mdash; essentially the standard way to implement <code class="display"><span class="extract">system()</span></code>, if you forget
about signal-handling &mdash; led to obscure and unrepeatable memory corruption
bugs in Intest, with the worker threads apparently writing on each other's
memory space. Using <code class="display"><span class="extract">posix_spawn()</span></code> instead appears to work better.
</p>
<pre class="display">
<span class="plain">#</span><span class="identifier">include</span><span class="plain"> &lt;</span><span class="identifier">spawn</span><span class="plain">.</span><span class="identifier">h</span><span class="plain">&gt;</span>
<span class="plain">#</span><span class="identifier">include</span><span class="plain"> &lt;</span><span class="identifier">sys</span><span class="plain">/</span><span class="identifier">wait</span><span class="plain">.</span><span class="identifier">h</span><span class="plain">&gt;</span>
<span class="reserved">extern</span><span class="plain"> </span><span class="reserved">char</span><span class="plain"> **</span><span class="identifier">environ</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="functiontext">Platform::system</span><span class="plain">(</span><span class="reserved">const</span><span class="plain"> </span><span class="reserved">char</span><span class="plain"> *</span><span class="identifier">cmd</span><span class="plain">) {</span>
<span class="reserved">char</span><span class="plain"> *</span><span class="identifier">argv</span><span class="plain">[] = {</span><span class="string">"sh"</span><span class="plain">, </span><span class="string">"-c"</span><span class="plain">, (</span><span class="reserved">char</span><span class="plain"> *) </span><span class="identifier">cmd</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">};</span>
<span class="identifier">pid_t</span><span class="plain"> </span><span class="identifier">pid</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">status</span><span class="plain"> = </span><span class="identifier">posix_spawn</span><span class="plain">(&amp;</span><span class="identifier">pid</span><span class="plain">, </span><span class="string">"/bin/sh"</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">argv</span><span class="plain">, </span><span class="identifier">environ</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">status</span><span class="plain"> == 0) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">waitpid</span><span class="plain">(</span><span class="identifier">pid</span><span class="plain">, &amp;</span><span class="identifier">status</span><span class="plain">, 0) != -1) </span><span class="reserved">return</span><span class="plain"> </span><span class="identifier">status</span><span class="plain">;</span>
<span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"waitpid failed"</span><span class="plain">);</span>
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="constant">STDERR</span><span class="plain">, </span><span class="string">"posix_spawn: %s\</span><span class="plain">n</span><span class="string">"</span><span class="plain">, </span><span class="identifier">strerror</span><span class="plain">(</span><span class="identifier">status</span><span class="plain">));</span>
<span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"posix_spawn failed"</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="reserved">return</span><span class="plain"> -1;</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This paragraph is used only if PLATFORM_MACOS and PLATFORM_POSIX are defined.</p>
<p class="endnote">The function Platform::system is used in <a href="#SP10">&#167;10</a>, 1/wp (<a href="1-wp.html#SP6">&#167;6</a>), 3/shl (<a href="3-shl.html#SP5">&#167;5</a>).</p>
<p class="inwebparagraph"><a id="SP12"></a><b>&#167;12. Directory handling. </b></p>
<pre class="display">
@ -377,7 +426,7 @@ string.
<p class="endnote">The function Platform::closedir is used in 1/wp (<a href="1-wp.html#SP7">&#167;7</a>), 3/drc (<a href="3-drc.html#SP2">&#167;2</a>).</p>
<p class="inwebparagraph"><a id="SP12"></a><b>&#167;12. Sleep. </b></p>
<p class="inwebparagraph"><a id="SP13"></a><b>&#167;13. Sleep. </b></p>
<pre class="display">
@ -392,7 +441,7 @@ string.
<p class="endnote">The function Platform::sleep is used in 1/wp (<a href="1-wp.html#SP8">&#167;8</a>).</p>
<p class="inwebparagraph"><a id="SP13"></a><b>&#167;13. Notifications. </b>The "submarine" sound is a gloomy thunk; the "bell" is the three-tone rising
<p class="inwebparagraph"><a id="SP14"></a><b>&#167;14. Notifications. </b>The "submarine" sound is a gloomy thunk; the "bell" is the three-tone rising
alert noise which iPhones make when they receive texts, but which hackers of a
certain age will remember as the "I have ripped your music CD now" alert from
SoundJam, the program which Apple bought and rebranded as iTunes. Apple now
@ -421,9 +470,9 @@ actually running a one-line AppleScript here.
<p class="endnote">This paragraph is used only if PLATFORM_MACOS and PLATFORM_POSIX are defined.</p>
<p class="endnote">The function Platform::notification is used in <a href="#SP14">&#167;14</a>, 1/wp (<a href="1-wp.html#SP9">&#167;9</a>).</p>
<p class="endnote">The function Platform::notification is used in <a href="#SP15">&#167;15</a>, 1/wp (<a href="1-wp.html#SP9">&#167;9</a>).</p>
<p class="inwebparagraph"><a id="SP14"></a><b>&#167;14. </b></p>
<p class="inwebparagraph"><a id="SP15"></a><b>&#167;15. </b></p>
<pre class="display">
@ -435,9 +484,9 @@ actually running a one-line AppleScript here.
<p class="endnote">This paragraph is used only if PLATFORM_POSIX is defined and if PLATFORM_MACOS is undefined.</p>
<p class="endnote">The function Platform::notification is used in <a href="#SP13">&#167;13</a>, 1/wp (<a href="1-wp.html#SP9">&#167;9</a>).</p>
<p class="endnote">The function Platform::notification is used in <a href="#SP14">&#167;14</a>, 1/wp (<a href="1-wp.html#SP9">&#167;9</a>).</p>
<p class="inwebparagraph"><a id="SP15"></a><b>&#167;15. Concurrency. </b></p>
<p class="inwebparagraph"><a id="SP16"></a><b>&#167;16. Concurrency. </b></p>
<pre class="display">
@ -449,7 +498,7 @@ actually running a one-line AppleScript here.
<p class="endnote">This paragraph is used only if PLATFORM_POSIX is defined.</p>
<p class="inwebparagraph"><a id="SP16"></a><b>&#167;16. </b></p>
<p class="inwebparagraph"><a id="SP17"></a><b>&#167;17. </b></p>
<pre class="display">
@ -486,7 +535,7 @@ actually running a one-line AppleScript here.
<p class="endnote">The function Platform::get_thread_stack_size is used in 1/wp (<a href="1-wp.html#SP11">&#167;11</a>).</p>
<p class="inwebparagraph"><a id="SP17"></a><b>&#167;17. Mutexes. </b></p>
<p class="inwebparagraph"><a id="SP18"></a><b>&#167;18. Mutexes. </b></p>
<pre class="definitions">
@ -497,7 +546,9 @@ actually running a one-line AppleScript here.
</pre>
<p class="endnote">This paragraph is used only if PLATFORM_POSIX is defined.</p>
<!--End of weave: 284 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="1-fnd.html">Back to 'Foundation'</a></li><li><a href="1-wp.html">Continue with 'Windows Platform'</a></li></ul><hr class="tocbar">
<!--End of weave: 324 lines from a web of 9333-->
</body>
</html>

View file

@ -189,7 +189,7 @@ just that installation and use of Foundation-built tools is less convenient.)
<p class="endnote">The function GetExitCodeProcess appears nowhere else.</p>
<p class="endnote">The function Platform::system is used in 1/pp (<a href="1-pp.html#SP10">&#167;10</a>), 3/shl (<a href="3-shl.html#SP5">&#167;5</a>).</p>
<p class="endnote">The function Platform::system is used in 1/pp (<a href="1-pp.html#SP10">&#167;10</a>, <a href="1-pp.html#SP11">&#167;11</a>), 3/shl (<a href="3-shl.html#SP5">&#167;5</a>).</p>
<p class="inwebparagraph"><a id="SP7"></a><b>&#167;7. Directory handling. </b></p>
@ -235,13 +235,13 @@ just that installation and use of Foundation-built tools is less convenient.)
<p class="endnote">This paragraph is used only if PLATFORM_WINDOWS is defined.</p>
<p class="endnote">The function Platform::mkdir is used in 1/pp (<a href="1-pp.html#SP11">&#167;11</a>), 3/pth (<a href="3-pth.html#SP8">&#167;8</a>).</p>
<p class="endnote">The function Platform::mkdir is used in 1/pp (<a href="1-pp.html#SP12">&#167;12</a>), 3/pth (<a href="3-pth.html#SP8">&#167;8</a>).</p>
<p class="endnote">The function Platform::opendir is used in 1/pp (<a href="1-pp.html#SP11">&#167;11</a>), 3/drc (<a href="3-drc.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function Platform::opendir is used in 1/pp (<a href="1-pp.html#SP12">&#167;12</a>), 3/drc (<a href="3-drc.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function Platform::readdir is used in 1/pp (<a href="1-pp.html#SP11">&#167;11</a>), 3/drc (<a href="3-drc.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function Platform::readdir is used in 1/pp (<a href="1-pp.html#SP12">&#167;12</a>), 3/drc (<a href="3-drc.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function Platform::closedir is used in 1/pp (<a href="1-pp.html#SP11">&#167;11</a>), 3/drc (<a href="3-drc.html#SP2">&#167;2</a>).</p>
<p class="endnote">The function Platform::closedir is used in 1/pp (<a href="1-pp.html#SP12">&#167;12</a>), 3/drc (<a href="3-drc.html#SP2">&#167;2</a>).</p>
<p class="inwebparagraph"><a id="SP8"></a><b>&#167;8. Sleep. </b>The Windows <code class="display"><span class="extract">Sleep</span></code> call measures time in milliseconds, whereas
POSIX <code class="display"><span class="extract">sleep</span></code> is for seconds.
@ -259,7 +259,7 @@ POSIX <code class="display"><span class="extract">sleep</span></code> is for sec
<p class="endnote">This paragraph is used only if PLATFORM_WINDOWS is defined.</p>
<p class="endnote">The function Platform::sleep is used in 1/pp (<a href="1-pp.html#SP12">&#167;12</a>).</p>
<p class="endnote">The function Platform::sleep is used in 1/pp (<a href="1-pp.html#SP13">&#167;13</a>).</p>
<p class="inwebparagraph"><a id="SP9"></a><b>&#167;9. Notifications. </b></p>
@ -273,7 +273,7 @@ POSIX <code class="display"><span class="extract">sleep</span></code> is for sec
<p class="endnote">This paragraph is used only if PLATFORM_WINDOWS is defined.</p>
<p class="endnote">The function Platform::notification is used in 1/pp (<a href="1-pp.html#SP13">&#167;13</a>, <a href="1-pp.html#SP14">&#167;14</a>).</p>
<p class="endnote">The function Platform::notification is used in 1/pp (<a href="1-pp.html#SP14">&#167;14</a>, <a href="1-pp.html#SP15">&#167;15</a>).</p>
<p class="inwebparagraph"><a id="SP10"></a><b>&#167;10. Concurrency. </b>The following predeclarations come from the Windows SDK.
</p>
@ -340,13 +340,13 @@ POSIX <code class="display"><span class="extract">sleep</span></code> is for sec
<p class="endnote">The function Platform::Win32_Thread_Func appears nowhere else.</p>
<p class="endnote">The function Platform::create_thread is used in 1/pp (<a href="1-pp.html#SP16">&#167;16</a>).</p>
<p class="endnote">The function Platform::create_thread is used in 1/pp (<a href="1-pp.html#SP17">&#167;17</a>).</p>
<p class="endnote">The function Platform::join_thread is used in 1/pp (<a href="1-pp.html#SP16">&#167;16</a>).</p>
<p class="endnote">The function Platform::join_thread is used in 1/pp (<a href="1-pp.html#SP17">&#167;17</a>).</p>
<p class="endnote">The function Platform::init_thread is used in 1/pp (<a href="1-pp.html#SP16">&#167;16</a>).</p>
<p class="endnote">The function Platform::init_thread is used in 1/pp (<a href="1-pp.html#SP17">&#167;17</a>).</p>
<p class="endnote">The function Platform::get_thread_stack_size is used in 1/pp (<a href="1-pp.html#SP16">&#167;16</a>).</p>
<p class="endnote">The function Platform::get_thread_stack_size is used in 1/pp (<a href="1-pp.html#SP17">&#167;17</a>).</p>
<p class="inwebparagraph"><a id="SP12"></a><b>&#167;12. Mutexes. </b></p>
@ -369,7 +369,9 @@ POSIX <code class="display"><span class="extract">sleep</span></code> is for sec
<p class="endnote">This paragraph is used only if PLATFORM_WINDOWS is defined.</p>
<!--End of weave: 236 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="1-pp.html">Back to 'POSIX Platforms'</a></li><li><i>(This section ends Chapter 1: Setting Up.)</i></li></ul><hr class="tocbar">
<!--End of weave: 236 lines from a web of 9333-->
</body>
</html>

View file

@ -443,7 +443,9 @@ and free the memory when done:
<p class="endnote">The function Dictionaries::dispose_of appears nowhere else.</p>
<!--End of weave: 288 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-llas.html">Back to 'Linked Lists and Stacks'</a></li><li><i>(This section ends Chapter 2: Memory, Streams and Collections.)</i></li></ul><hr class="tocbar">
<!--End of weave: 288 lines from a web of 9333-->
</body>
</html>

View file

@ -399,7 +399,9 @@ but weren't.
<p class="endnote">The function Log::show_debugging_contents is used in <a href="#SP5">&#167;5</a>.</p>
<!--End of weave: 284 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 2: Memory, Streams and Collections.)</i></li><li><a href="2-mmr.html">Continue with 'Memory'</a></li></ul><hr class="tocbar">
<!--End of weave: 284 lines from a web of 9333-->
</body>
</html>

View file

@ -276,7 +276,9 @@ preprocessor:
<span class="definitionkeyword">define</span> <span class="identifier">LOOP_DOWN_LIFO_STACK</span><span class="plain">(</span><span class="identifier">P</span><span class="plain">, </span><span class="identifier">T</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">)</span>
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">P</span><span class="plain">, </span><span class="identifier">T</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">)</span>
</pre>
<!--End of weave: 217 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-mth.html">Back to 'Methods'</a></li><li><a href="2-dct.html">Continue with 'Dictionaries'</a></li></ul><hr class="tocbar">
<!--End of weave: 217 lines from a web of 9333-->
</body>
</html>

View file

@ -159,7 +159,7 @@ a way to create new small objects of any given type.
or an array of small objects.
</li><li>(1) Allocating and freeing a few dozen large blocks of contiguous memory.
</li></ul>
<p class="inwebparagraph"><a id="SP7"></a><b>&#167;7. Level 1: memory blocks. </b>Memory is allocated in blocks of 100K, within which objects are allocated as
<p class="inwebparagraph"><a id="SP7"></a><b>&#167;7. Level 1: memory blocks. </b>Memory is allocated in blocks within which objects are allocated as
needed. The "safety margin" is the number of spare bytes left blank at the
end of each object: this is done because we want to be paranoid about
compilers on different architectures aligning structures to different
@ -172,10 +172,10 @@ the debugging log.
<pre class="definitions">
<span class="definitionkeyword">define</span> <span class="constant">SAFETY_MARGIN</span><span class="plain"> 64</span>
<span class="definitionkeyword">define</span> <span class="constant">BLANK_END_SIZE</span><span class="plain"> 128</span>
<span class="definitionkeyword">define</span> <span class="constant">SAFETY_MARGIN</span><span class="plain"> 128</span>
<span class="definitionkeyword">define</span> <span class="constant">BLANK_END_SIZE</span><span class="plain"> 256</span>
</pre>
<p class="inwebparagraph"><a id="SP8"></a><b>&#167;8. </b>At present <code class="display"><span class="extract">MEMORY_GRANULARITY</span></code> is 100K. This is the quantity of memory
<p class="inwebparagraph"><a id="SP8"></a><b>&#167;8. </b>At present <code class="display"><span class="extract">MEMORY_GRANULARITY</span></code> is 800K. This is the quantity of memory
allocated by each individual <code class="display"><span class="extract">malloc</span></code> call.
</p>
@ -190,7 +190,7 @@ unable to get the GUI responsive enough to kill the process.)
<pre class="definitions">
<span class="definitionkeyword">define</span> <span class="constant">MAX_BLOCKS_ALLOWED</span><span class="plain"> 15000</span>
<span class="definitionkeyword">define</span> <span class="constant">MEMORY_GRANULARITY</span><span class="plain"> 100*1024*4 </span> <span class="comment">which must be divisible by 1024</span>
<span class="definitionkeyword">define</span> <span class="constant">MEMORY_GRANULARITY</span><span class="plain"> 100*1024*8 </span> <span class="comment">which must be divisible by 1024</span>
</pre>
<pre class="display">
@ -619,6 +619,8 @@ double-quotes.
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">new_obj</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">void</span><span class="plain"> </span><span class="identifier">copy_</span><span class="plain">##</span><span class="identifier">type_name</span><span class="plain">(</span><span class="identifier">type_name</span><span class="plain"> *</span><span class="identifier">to</span><span class="plain">, </span><span class="identifier">type_name</span><span class="plain"> *</span><span class="identifier">from</span><span class="plain">) {</span>
<span class="identifier">CREATE_MUTEX</span><span class="plain">(</span><span class="identifier">mutex</span><span class="plain">);</span>
<span class="identifier">LOCK_MUTEX</span><span class="plain">(</span><span class="identifier">mutex</span><span class="plain">);</span>
<span class="identifier">type_name</span><span class="plain"> *</span><span class="identifier">prev_obj</span><span class="plain"> = </span><span class="identifier">to</span><span class="plain">-&gt;</span><span class="identifier">prev_structure</span><span class="plain">;</span>
<span class="identifier">type_name</span><span class="plain"> *</span><span class="identifier">next_obj</span><span class="plain"> = </span><span class="identifier">to</span><span class="plain">-&gt;</span><span class="identifier">next_structure</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">aid</span><span class="plain"> = </span><span class="identifier">to</span><span class="plain">-</span><span class="element">&gt;allocation_id</span><span class="plain">;</span>
@ -626,6 +628,7 @@ double-quotes.
<span class="identifier">to</span><span class="plain">-</span><span class="element">&gt;allocation_id</span><span class="plain"> = </span><span class="identifier">aid</span><span class="plain">;</span>
<span class="identifier">to</span><span class="plain">-&gt;</span><span class="identifier">next_structure</span><span class="plain"> = </span><span class="identifier">next_obj</span><span class="plain">;</span>
<span class="identifier">to</span><span class="plain">-&gt;</span><span class="identifier">prev_structure</span><span class="plain"> = </span><span class="identifier">prev_obj</span><span class="plain">;</span>
<span class="identifier">UNLOCK_MUTEX</span><span class="plain">(</span><span class="identifier">mutex</span><span class="plain">);</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"><a id="SP20"></a><b>&#167;20. </b><code class="display"><span class="extract">ALLOCATE_IN_ARRAYS</span></code> is still more obfuscated. When we
@ -965,6 +968,8 @@ to write to the result.
<pre class="display">
<span class="reserved">char</span><span class="plain"> *</span><span class="functiontext">Memory::new_string</span><span class="plain">(</span><span class="reserved">char</span><span class="plain"> *</span><span class="identifier">from</span><span class="plain">) {</span>
<span class="identifier">CREATE_MUTEX</span><span class="plain">(</span><span class="identifier">mutex</span><span class="plain">);</span>
<span class="identifier">LOCK_MUTEX</span><span class="plain">(</span><span class="identifier">mutex</span><span class="plain">);</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">length_needed</span><span class="plain"> = (</span><span class="reserved">int</span><span class="plain">) </span><span class="identifier">strlen</span><span class="plain">(</span><span class="identifier">from</span><span class="plain">) + 1;</span>
<span class="reserved">if</span><span class="plain"> (!((</span><span class="identifier">current_ssa</span><span class="plain">) &amp;&amp;</span>
<span class="plain">(</span><span class="identifier">current_ssa</span><span class="plain">-</span><span class="element">&gt;first_free_byte</span><span class="plain"> + </span><span class="identifier">length_needed</span><span class="plain"> &lt; </span><span class="constant">SSA_CAPACITY</span><span class="plain">))) {</span>
@ -975,6 +980,7 @@ to write to the result.
<span class="reserved">char</span><span class="plain"> *</span><span class="identifier">rp</span><span class="plain"> = </span><span class="identifier">current_ssa</span><span class="plain">-</span><span class="element">&gt;storage_at</span><span class="plain"> + </span><span class="identifier">current_ssa</span><span class="plain">-</span><span class="element">&gt;first_free_byte</span><span class="plain">;</span>
<span class="identifier">current_ssa</span><span class="plain">-</span><span class="element">&gt;first_free_byte</span><span class="plain"> += </span><span class="identifier">length_needed</span><span class="plain">;</span>
<span class="identifier">strcpy</span><span class="plain">(</span><span class="identifier">rp</span><span class="plain">, </span><span class="identifier">from</span><span class="plain">);</span>
<span class="identifier">UNLOCK_MUTEX</span><span class="plain">(</span><span class="identifier">mutex</span><span class="plain">);</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">rp</span><span class="plain">;</span>
<span class="plain">}</span>
</pre>
@ -1299,7 +1305,9 @@ allocated objects above; so that leaves only humble <code class="display"><span
<p class="inwebparagraph"></p>
<!--End of weave: 926 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-dl.html">Back to 'Debugging Log'</a></li><li><a href="2-str.html">Continue with 'Streams'</a></li></ul><hr class="tocbar">
<!--End of weave: 932 lines from a web of 9333-->
</body>
</html>

View file

@ -209,7 +209,9 @@ to a structure which has <code class="display"><span class="extract">METHOD_CALL
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">M</span><span class="plain">-</span><span class="element">&gt;method_id</span><span class="plain"> == </span><span class="identifier">id</span><span class="plain">)</span>
<span class="plain">(*((</span><span class="identifier">id</span><span class="plain">##</span><span class="identifier">_type</span><span class="plain">) (</span><span class="identifier">M</span><span class="plain">-</span><span class="element">&gt;method_function</span><span class="plain">)))(</span><span class="identifier">upon</span><span class="plain">);</span>
</pre>
<!--End of weave: 153 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-wal.html">Back to 'Writers and Loggers'</a></li><li><a href="2-llas.html">Continue with 'Linked Lists and Stacks'</a></li></ul><hr class="tocbar">
<!--End of weave: 153 lines from a web of 9333-->
</body>
</html>

View file

@ -1304,7 +1304,9 @@ to open similar ones again).
<p class="endnote">The function Streams::writer is used in 1/fnd (<a href="1-fnd.html#SP8_1">&#167;8.1</a>).</p>
<!--End of weave: 947 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-mmr.html">Back to 'Memory'</a></li><li><a href="2-wal.html">Continue with 'Writers and Loggers'</a></li></ul><hr class="tocbar">
<!--End of weave: 947 lines from a web of 9333-->
</body>
</html>

View file

@ -354,7 +354,9 @@ file encodings, but expanding <code class="display"><span class="extract">%s</sp
<p class="endnote">This code is used in <a href="#SP6_1">&#167;6.1</a>.</p>
<!--End of weave: 268 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-str.html">Back to 'Streams'</a></li><li><a href="2-mth.html">Continue with 'Methods'</a></li></ul><hr class="tocbar">
<!--End of weave: 268 lines from a web of 9333-->
</body>
</html>

View file

@ -370,7 +370,9 @@ and in any case the code above contains much larger buffers than needed.)
<p class="endnote">The function CIFilingSystem::fopen is used in <a href="#SP3">&#167;3</a>, 3/fln (<a href="3-fln.html#SP10">&#167;10</a>).</p>
<!--End of weave: 236 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-fln.html">Back to 'Filenames'</a></li><li><a href="3-shl.html">Continue with 'Shell'</a></li></ul><hr class="tocbar">
<!--End of weave: 236 lines from a web of 9333-->
</body>
</html>

View file

@ -349,9 +349,17 @@ all other switches are delegated to the client's callback function <code class="
<span class="reserved">switch</span><span class="plain"> (</span><span class="identifier">cls</span><span class="plain">-</span><span class="element">&gt;switch_id</span><span class="plain">) {</span>
<span class="reserved">case</span><span class="plain"> </span><span class="constant">CRASH_CLSW</span><span class="plain">: </span><span class="functiontext">Errors::enter_debugger_mode</span><span class="plain">(); </span><span class="identifier">innocuous</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">; </span><span class="reserved">break</span><span class="plain">;</span>
<span class="reserved">case</span><span class="plain"> </span><span class="constant">LOG_CLSW</span><span class="plain">: </span>&lt;<span class="cwebmacro">Parse debugging log inclusion</span> <span class="cwebmacronumber">8.1.1</span>&gt;<span class="plain">; </span><span class="identifier">innocuous</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">; </span><span class="reserved">break</span><span class="plain">;</span>
<span class="reserved">case</span><span class="plain"> </span><span class="constant">VERSION_CLSW</span><span class="plain">:</span>
<span class="identifier">PRINT</span><span class="plain">(</span><span class="string">"%s [[Version Number]] '[[Version Name]]' (build [[Build Number]] on [[Build Date]])\</span><span class="plain">n</span><span class="string">"</span><span class="plain">, </span><span class="identifier">INTOOL_NAME</span><span class="plain">);</span>
<span class="reserved">case</span><span class="plain"> </span><span class="constant">VERSION_CLSW</span><span class="plain">: {</span>
<span class="reserved">char</span><span class="plain"> *</span><span class="identifier">bn</span><span class="plain"> = </span><span class="string">"[[Build Number]]"</span><span class="plain">;</span>
<span class="reserved">char</span><span class="plain"> *</span><span class="identifier">vn</span><span class="plain"> = </span><span class="string">"[[Version Number]]"</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">vn</span><span class="plain">[0] == 0) </span><span class="identifier">vn</span><span class="plain"> = </span><span class="string">"1"</span><span class="plain">;</span>
<span class="reserved">char</span><span class="plain"> *</span><span class="identifier">vname</span><span class="plain"> = </span><span class="string">"[[Version Name]]"</span><span class="plain">;</span>
<span class="identifier">PRINT</span><span class="plain">(</span><span class="string">"[[Title]] %s"</span><span class="plain">, </span><span class="identifier">vn</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">vname</span><span class="plain">[0]) </span><span class="identifier">PRINT</span><span class="plain">(</span><span class="string">" '%s'"</span><span class="plain">, </span><span class="identifier">vname</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">bn</span><span class="plain">[0]) </span><span class="identifier">PRINT</span><span class="plain">(</span><span class="string">" (build %s)"</span><span class="plain">, </span><span class="identifier">bn</span><span class="plain">);</span>
<span class="identifier">PRINT</span><span class="plain">(</span><span class="string">"\</span><span class="plain">n</span><span class="string">"</span><span class="plain">);</span>
<span class="identifier">innocuous</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">; </span><span class="reserved">break</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="reserved">case</span><span class="plain"> </span><span class="constant">HELP_CLSW</span><span class="plain">: </span><span class="functiontext">CommandLine::write_help</span><span class="plain">(</span><span class="constant">STDOUT</span><span class="plain">); </span><span class="identifier">innocuous</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">; </span><span class="reserved">break</span><span class="plain">;</span>
<span class="reserved">case</span><span class="plain"> </span><span class="constant">FIXTIME_CLSW</span><span class="plain">: </span><span class="functiontext">Time::fix</span><span class="plain">(); </span><span class="reserved">break</span><span class="plain">;</span>
<span class="reserved">case</span><span class="plain"> </span><span class="constant">AT_CLSW</span><span class="plain">: </span><span class="functiontext">Pathnames::set_installation_path</span><span class="plain">(</span><span class="functiontext">Pathnames::from_text</span><span class="plain">(</span><span class="identifier">arg</span><span class="plain">)); </span><span class="reserved">break</span><span class="plain">;</span>
@ -481,7 +489,9 @@ name and purpose.
<p class="endnote">The function CommandLine::compare_names is used in <a href="#SP9">&#167;9</a>.</p>
<!--End of weave: 346 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-em.html">Back to 'Error Messages'</a></li><li><a href="3-pth.html">Continue with 'Pathnames'</a></li></ul><hr class="tocbar">
<!--End of weave: 354 lines from a web of 9333-->
</body>
</html>

View file

@ -70,7 +70,9 @@ transcoded the other way.
<p class="endnote">The function Directories::close appears nowhere else.</p>
<!--End of weave: 45 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-shl.html">Back to 'Shell'</a></li><li><a href="3-tm.html">Continue with 'Time'</a></li></ul><hr class="tocbar">
<!--End of weave: 45 lines from a web of 9333-->
</body>
</html>

View file

@ -257,7 +257,9 @@ specify this at three levels of abstraction:
<p class="endnote">The function Errors::with_text appears nowhere else.</p>
<!--End of weave: 178 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 3: The Operating System.)</i></li><li><a href="3-cla.html">Continue with 'Command Line Arguments'</a></li></ul><hr class="tocbar">
<!--End of weave: 178 lines from a web of 9333-->
</body>
</html>

View file

@ -352,7 +352,9 @@ when printed out.
<p class="endnote">The function Filenames::eq appears nowhere else.</p>
<!--End of weave: 264 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-pth.html">Back to 'Pathnames'</a></li><li><a href="3-cf.html">Continue with 'Case-Insensitive Filenames'</a></li></ul><hr class="tocbar">
<!--End of weave: 264 lines from a web of 9333-->
</body>
</html>

View file

@ -323,7 +323,9 @@ on the file system with that path.
<p class="endnote">The function Pathnames::create_in_file_system is used in 5/ee (<a href="5-ee.html#SP6">&#167;6</a>, <a href="5-ee.html#SP6_2">&#167;6.2</a>).</p>
<!--End of weave: 215 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-cla.html">Back to 'Command Line Arguments'</a></li><li><a href="3-fln.html">Continue with 'Filenames'</a></li></ul><hr class="tocbar">
<!--End of weave: 215 lines from a web of 9333-->
</body>
</html>

View file

@ -182,9 +182,11 @@ all transcoded to UTF-8 in the most unlucky way imaginable.
<p class="endnote">The function Shell::verbose appears nowhere else.</p>
<p class="endnote">The function Shell::run is used in <a href="#SP2">&#167;2</a>, <a href="#SP3">&#167;3</a>, 1/pp (<a href="1-pp.html#SP13">&#167;13</a>), 5/ee (<a href="5-ee.html#SP7_4_1">&#167;7.4.1</a>, <a href="5-ee.html#SP7_4_2">&#167;7.4.2</a>).</p>
<p class="endnote">The function Shell::run is used in <a href="#SP2">&#167;2</a>, <a href="#SP3">&#167;3</a>, 1/pp (<a href="1-pp.html#SP14">&#167;14</a>), 5/ee (<a href="5-ee.html#SP7_4_1">&#167;7.4.1</a>, <a href="5-ee.html#SP7_4_2">&#167;7.4.2</a>).</p>
<!--End of weave: 126 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-cf.html">Back to 'Case-Insensitive Filenames'</a></li><li><a href="3-drc.html">Continue with 'Directories'</a></li></ul><hr class="tocbar">
<!--End of weave: 126 lines from a web of 9333-->
</body>
</html>

View file

@ -147,7 +147,9 @@ fairly low numbers, and this we now do.
<p class="endnote">The function Time::feast appears nowhere else.</p>
<!--End of weave: 112 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-drc.html">Back to 'Directories'</a></li><li><i>(This section ends Chapter 3: The Operating System.)</i></li></ul><hr class="tocbar">
<!--End of weave: 112 lines from a web of 9333-->
</body>
</html>

View file

@ -215,7 +215,9 @@ the more obvious accents from it.
<p class="endnote">The function Characters::remove_accent is used in <a href="#SP5">&#167;5</a>.</p>
<!--End of weave: 152 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 4: Text Handling.)</i></li><li><a href="4-cst.html">Continue with 'C Strings'</a></li></ul><hr class="tocbar">
<!--End of weave: 152 lines from a web of 9333-->
</body>
</html>

View file

@ -183,7 +183,9 @@ hand. This I think makes for opaque code. So:
<p class="endnote">The function CStrings::truncated_strcpy is used in 2/dl (<a href="2-dl.html#SP6">&#167;6</a>).</p>
<!--End of weave: 111 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-chr.html">Back to 'Characters'</a></li><li><a href="4-ws.html">Continue with 'Wide Strings.w'</a></li></ul><hr class="tocbar">
<!--End of weave: 111 lines from a web of 9333-->
</body>
</html>

View file

@ -632,7 +632,9 @@ For example,
<p class="endnote">This code is used in <a href="#SP14">&#167;14</a> (twice).</p>
<!--End of weave: 437 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-taa.html">Back to 'Tries and Avinues'</a></li><li><i>(This section ends Chapter 4: Text Handling.)</i></li></ul><hr class="tocbar">
<!--End of weave: 437 lines from a web of 9333-->
</body>
</html>

View file

@ -876,7 +876,9 @@ is run just once per I-literal in the source code, when the program starts up.
<p class="endnote">This code is used in <a href="#SP26">&#167;26</a>.</p>
<!--End of weave: 605 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-ws.html">Back to 'Wide Strings.w'</a></li><li><a href="4-tf.html">Continue with 'Text Files'</a></li></ul><hr class="tocbar">
<!--End of weave: 605 lines from a web of 9333-->
</body>
</html>

View file

@ -521,7 +521,9 @@ trie in turn until one matches (if it does).
<p class="endnote">The function Tries::log appears nowhere else.</p>
<!--End of weave: 375 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-tf.html">Back to 'Text Files'</a></li><li><a href="4-pm.html">Continue with 'Pattern Matching'</a></li></ul><hr class="tocbar">
<!--End of weave: 375 lines from a web of 9333-->
</body>
</html>

View file

@ -468,7 +468,9 @@ hyphens into em-rules when they are flanked by spaces, and so on.
<p class="endnote">This code is used in <a href="#SP8">&#167;8</a>.</p>
<!--End of weave: 305 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-sm.html">Back to 'String Manipulation'</a></li><li><a href="4-taa.html">Continue with 'Tries and Avinues'</a></li></ul><hr class="tocbar">
<!--End of weave: 305 lines from a web of 9333-->
</body>
</html>

View file

@ -59,7 +59,9 @@ wrappers simply abstract the standard C library's handling.
<p class="endnote">The function Wide::atoi appears nowhere else.</p>
<!--End of weave: 30 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-cst.html">Back to 'C Strings'</a></li><li><a href="4-sm.html">Continue with 'String Manipulation'</a></li></ul><hr class="tocbar">
<!--End of weave: 30 lines from a web of 9333-->
</body>
</html>

View file

@ -906,7 +906,9 @@ impaired people.
<p class="endnote">This code is used in <a href="#SP7_4">&#167;7.4</a>.</p>
<!--End of weave: 598 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="5-htm.html">Back to 'HTML'</a></li><li><i>(This section ends Chapter 5: Generating Websites.)</i></li></ul><hr class="tocbar">
<!--End of weave: 598 lines from a web of 9333-->
</body>
</html>

View file

@ -393,8 +393,8 @@ of which are variadic and have to be written out the old-fashioned way:
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTML::begin_body</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">char</span><span class="plain"> *</span><span class="identifier">class</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">class</span><span class="plain">) </span><span class="identifier">HTML_OPEN_WITH</span><span class="plain">(</span><span class="string">"body"</span><span class="plain">, </span><span class="string">"class=\</span><span class="plain">"</span><span class="string">%s\</span><span class="plain">"</span><span class="string">"</span><span class="plain">, </span><span class="identifier">class</span><span class="plain">)</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTML::begin_body</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">class</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">class</span><span class="plain">) </span><span class="identifier">HTML_OPEN_WITH</span><span class="plain">(</span><span class="string">"body"</span><span class="plain">, </span><span class="string">"class=\</span><span class="plain">"</span><span class="string">%S\</span><span class="plain">"</span><span class="string">"</span><span class="plain">, </span><span class="identifier">class</span><span class="plain">)</span>
<span class="reserved">else</span><span class="plain"> </span><span class="identifier">HTML_OPEN</span><span class="plain">(</span><span class="string">"body"</span><span class="plain">);</span>
<span class="plain">}</span>
@ -1002,7 +1002,9 @@ need to run quickly.
<p class="endnote">The function HTML::end_colour appears nowhere else.</p>
<!--End of weave: 757 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 5: Generating Websites.)</i></li><li><a href="5-ee.html">Continue with 'Epub Ebooks'</a></li></ul><hr class="tocbar">
<!--End of weave: 757 lines from a web of 9333-->
</body>
</html>

View file

@ -324,7 +324,9 @@ or to system APIs.
<p class="endnote">The function BinaryFiles::copy appears nowhere else.</p>
<!--End of weave: 241 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 6: Media.)</i></li><li><a href="6-id.html">Continue with 'Image Dimensions'</a></li></ul><hr class="tocbar">
<!--End of weave: 241 lines from a web of 9333-->
</body>
</html>

View file

@ -119,7 +119,9 @@ first two words (section 11.2.2).
<p class="endnote">The function ImageFiles::get_PNG_dimensions appears nowhere else.</p>
<!--End of weave: 97 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="6-bf.html">Back to 'Binary Files'</a></li><li><a href="6-sd.html">Continue with 'Sound Durations'</a></li></ul><hr class="tocbar">
<!--End of weave: 97 lines from a web of 9333-->
</body>
</html>

View file

@ -364,7 +364,9 @@ officially support MIDI, which makes the question moot.
<p class="endnote">The function SoundFiles::get_MIDI_information appears nowhere else.</p>
<!--End of weave: 337 lines from a web of 9279-->
<hr class="tocbar">
<ul class="toc"><li><a href="6-id.html">Back to 'Image Dimensions'</a></li><li><i>(This section ends Chapter 6: Media.)</i></li></ul><hr class="tocbar">
<!--End of weave: 337 lines from a web of 9333-->
</body>
</html>

View file

@ -77,7 +77,9 @@
<p class="endnote">The function Main::ignore appears nowhere else.</p>
<!--End of weave: 57 lines from a web of 9551-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Sections.)</i></li><li><a href="S-ut.html">Continue with 'Unit Tests'</a></li></ul><hr class="tocbar">
<!--End of weave: 57 lines from a web of 9605-->
</body>
</html>

View file

@ -274,7 +274,9 @@
<p class="endnote">The function Unit::test_stacks is used in S/pc (<a href="S-pc.html#SP1">&#167;1</a>).</p>
<!--End of weave: 215 lines from a web of 9551-->
<hr class="tocbar">
<ul class="toc"><li><a href="S-pc.html">Back to 'Program Control'</a></li><li><i>(This section ends Sections.)</i></li></ul><hr class="tocbar">
<!--End of weave: 215 lines from a web of 9605-->
</body>
</html>

View file

@ -95,7 +95,9 @@ types.
<p class="inwebparagraph"></p>
<!--End of weave: 79 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 1: Top Level.)</i></li><li><a href="1-pc.html">Continue with 'Program Control'</a></li></ul><hr class="tocbar">
<!--End of weave: 79 lines from a web of 21004-->
</body>
</html>

View file

@ -366,7 +366,9 @@ Otherwise, a range is a chapter number/letter, or a section range.
<p class="endnote">The function Configuration::set_fundamental_mode is used in <a href="#SP3">&#167;3</a>.</p>
<!--End of weave: 299 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="1-pc.html">Back to 'Program Control'</a></li><li><a href="1-ptt.html">Continue with 'Patterns'</a></li></ul><hr class="tocbar">
<!--End of weave: 299 lines from a web of 21004-->
</body>
</html>

View file

@ -157,8 +157,15 @@ program: some input, some thinking, a choice of three forms of output.
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Main::follow_instructions</span><span class="plain">(</span><span class="reserved">inweb_instructions</span><span class="plain"> *</span><span class="identifier">ins</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> == </span><span class="constant">TRANSLATE_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Translate a makefile</span> <span class="cwebmacronumber">7.1</span>&gt;
<span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> != </span><span class="constant">NO_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Analyse, tangle or weave an existing web</span> <span class="cwebmacronumber">7.2</span>&gt;<span class="plain">;</span>
<span class="reserved">web</span><span class="plain"> *</span><span class="identifier">W</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;chosen_web</span><span class="plain">)</span>
<span class="identifier">W</span><span class="plain"> = </span><span class="functiontext">Reader::load_web</span><span class="plain">(</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;chosen_web</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;chosen_file</span><span class="plain">,</span>
<span class="functiontext">Modules::make_search_path</span><span class="plain">(</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;import_setting</span><span class="plain">), </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;verbose_switch</span><span class="plain">,</span>
<span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;weave_into_setting</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">no_inweb_errors</span><span class="plain"> == 0) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> == </span><span class="constant">TRANSLATE_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Translate a makefile</span> <span class="cwebmacronumber">7.1</span>&gt;
<span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> != </span><span class="constant">NO_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Analyse, tangle or weave an existing web</span> <span class="cwebmacronumber">7.2</span>&gt;<span class="plain">;</span>
<span class="plain">}</span>
<span class="plain">}</span>
</pre>
@ -181,16 +188,16 @@ program: some input, some thinking, a choice of three forms of output.
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;gitignore_setting</span><span class="plain">) &amp;&amp; (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;prototype_setting</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">))</span>
<span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;prototype_setting</span><span class="plain"> = </span><span class="functiontext">Filenames::from_text</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"gitignorescript.txt"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;makefile_setting</span><span class="plain">)</span>
<span class="functiontext">Makefiles::write</span><span class="plain">(</span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;prototype_setting</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;makefile_setting</span><span class="plain">);</span>
<span class="functiontext">Makefiles::write</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;prototype_setting</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;makefile_setting</span><span class="plain">);</span>
<span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;gitignore_setting</span><span class="plain">)</span>
<span class="functiontext">Git::write_gitignore</span><span class="plain">(</span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;prototype_setting</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;gitignore_setting</span><span class="plain">);</span>
<span class="functiontext">Git::write_gitignore</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;prototype_setting</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;gitignore_setting</span><span class="plain">);</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">This code is used in <a href="#SP7">&#167;7</a>.</p>
<p class="inwebparagraph"><a id="SP7_2"></a><b>&#167;7.2. </b>But otherwise we read and fully parse a web, and then do something with it:
<p class="inwebparagraph"><a id="SP7_2"></a><b>&#167;7.2. </b>But otherwise we do something with the given web:
</p>
@ -200,15 +207,10 @@ program: some input, some thinking, a choice of three forms of output.
<pre class="displaydefn">
<span class="reserved">web</span><span class="plain"> *</span><span class="identifier">W</span><span class="plain"> = </span><span class="functiontext">Reader::load_web</span><span class="plain">(</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;chosen_web</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;chosen_file</span><span class="plain">,</span>
<span class="functiontext">Modules::make_search_path</span><span class="plain">(</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;import_setting</span><span class="plain">), </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;verbose_switch</span><span class="plain">,</span>
<span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain">, </span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;weave_into_setting</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">no_inweb_errors</span><span class="plain"> == 0) {</span>
<span class="functiontext">Reader::print_web_statistics</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> == </span><span class="constant">ANALYSE_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Analyse the web</span> <span class="cwebmacronumber">7.2.1</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> == </span><span class="constant">TANGLE_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Tangle the web</span> <span class="cwebmacronumber">7.2.2</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> == </span><span class="constant">WEAVE_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Weave the web</span> <span class="cwebmacronumber">7.2.3</span>&gt;<span class="plain">;</span>
<span class="plain">}</span>
<span class="functiontext">Reader::print_web_statistics</span><span class="plain">(</span><span class="identifier">W</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> == </span><span class="constant">ANALYSE_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Analyse the web</span> <span class="cwebmacronumber">7.2.1</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> == </span><span class="constant">TANGLE_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Tangle the web</span> <span class="cwebmacronumber">7.2.2</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">ins</span><span class="plain">-</span><span class="element">&gt;inweb_mode</span><span class="plain"> == </span><span class="constant">WEAVE_MODE</span><span class="plain">) </span>&lt;<span class="cwebmacro">Weave the web</span> <span class="cwebmacronumber">7.2.3</span>&gt;<span class="plain">;</span>
</pre>
<p class="inwebparagraph"></p>
@ -485,7 +487,9 @@ source:
<p class="endnote">The function Main::error_in_web is used in 1/cnf (<a href="1-cnf.html#SP5">&#167;5</a>), 2/tp (<a href="2-tp.html#SP1_1_6_3">&#167;1.1.6.3</a>, <a href="2-tp.html#SP1_1_6_4">&#167;1.1.6.4</a>, <a href="2-tp.html#SP1_1_6_6">&#167;1.1.6.6</a>, <a href="2-tp.html#SP1_1_6_5_1">&#167;1.1.6.5.1</a>, <a href="2-tp.html#SP1_1_6_5_1_1">&#167;1.1.6.5.1.1</a>, <a href="2-tp.html#SP1_1_6_5_1_2">&#167;1.1.6.5.1.2</a>, <a href="2-tp.html#SP1_1_6_5_1_3">&#167;1.1.6.5.1.3</a>, <a href="2-tp.html#SP1_1_6_5_1_4">&#167;1.1.6.5.1.4</a>, <a href="2-tp.html#SP1_1_6_5_1_7">&#167;1.1.6.5.1.7</a>, <a href="2-tp.html#SP3">&#167;3</a>), 2/ec (<a href="2-ec.html#SP3_1">&#167;3.1</a>, <a href="2-ec.html#SP3_2">&#167;3.2</a>, <a href="2-ec.html#SP3_3">&#167;3.3</a>), 3/ta (<a href="3-ta.html#SP4_1">&#167;4.1</a>), 3/tt (<a href="3-tt.html#SP3_1">&#167;3.1</a>), 4/pl (<a href="4-pl.html#SP10">&#167;10</a>), 4/cl (<a href="4-cl.html#SP3">&#167;3</a>, <a href="4-cl.html#SP3_1">&#167;3.1</a>, <a href="4-cl.html#SP3_4_2_1">&#167;3.4.2.1</a>, <a href="4-cl.html#SP3_4_2_5">&#167;3.4.2.5</a>, <a href="4-cl.html#SP22">&#167;22</a>).</p>
<!--End of weave: 295 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="1-bsc.html">Back to 'Basics'</a></li><li><a href="1-cnf.html">Continue with 'Configuration'</a></li></ul><hr class="tocbar">
<!--End of weave: 297 lines from a web of 21004-->
</body>
</html>

View file

@ -279,7 +279,7 @@ from each other then this routine will lock up into an infinite loop.
<p class="inwebparagraph"></p>
<p class="endnote">The function Patterns::obtain_filename is used in <a href="#SP6">&#167;6</a>, 3/ts (<a href="3-ts.html#SP3">&#167;3</a>), 3/ti (<a href="3-ti.html#SP1">&#167;1</a>, <a href="3-ti.html#SP2">&#167;2</a>, <a href="3-ti.html#SP2_1_2">&#167;2.1.2</a>, <a href="3-ti.html#SP4_1">&#167;4.1</a>), 5/tf (<a href="5-tf.html#SP3_1">&#167;3.1</a>), 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP26">&#167;26</a>).</p>
<p class="endnote">The function Patterns::obtain_filename is used in <a href="#SP6">&#167;6</a>, 3/ts (<a href="3-ts.html#SP3">&#167;3</a>), 3/ti (<a href="3-ti.html#SP1">&#167;1</a>, <a href="3-ti.html#SP2">&#167;2</a>, <a href="3-ti.html#SP2_1_2">&#167;2.1.2</a>, <a href="3-ti.html#SP4_1">&#167;4.1</a>), 5/tf (<a href="5-tf.html#SP3_1">&#167;3.1</a>), 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP27">&#167;27</a>).</p>
<p class="inwebparagraph"><a id="SP6"></a><b>&#167;6. </b>When we eventually want to deal with the <code class="display"><span class="extract">use P</span></code> commands, which call
for payloads to be copied into weave, we make good use of the above:
@ -319,7 +319,9 @@ for payloads to be copied into weave, we make good use of the above:
<p class="endnote">The function Patterns::copy_file_into_weave is used in <a href="#SP6">&#167;6</a>, 5/hf (<a href="5-hf.html#SP6">&#167;6</a>, <a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP15">&#167;15</a>).</p>
<!--End of weave: 196 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="1-cnf.html">Back to 'Configuration'</a></li><li><i>(This section ends Chapter 1: Top Level.)</i></li></ul><hr class="tocbar">
<!--End of weave: 196 lines from a web of 21004-->
</body>
</html>

View file

@ -156,7 +156,7 @@ to check that all the mandatory declarations have indeed been made:
<p class="inwebparagraph"></p>
<p class="endnote">The function Bibliographic::get_datum is used in 1/pc (<a href="1-pc.html#SP7_2_2_1">&#167;7.2.2.1</a>, <a href="1-pc.html#SP7_2_3_1">&#167;7.2.3.1</a>), 2/tr (<a href="2-tr.html#SP4">&#167;4</a>, <a href="2-tr.html#SP9_3_1">&#167;9.3.1</a>, <a href="2-tr.html#SP9_3_3_2_1">&#167;9.3.3.2.1</a>, <a href="2-tr.html#SP9_2_2_3_1">&#167;9.2.2.3.1</a>), 3/ti (<a href="3-ti.html#SP2_1_3">&#167;2.1.3</a>, <a href="3-ti.html#SP4_1_8_1">&#167;4.1.8.1</a>), 3/tw (<a href="3-tw.html#SP1_3_3_1_10_4">&#167;1.3.3.1.10.4</a>), 3/tt (<a href="3-tt.html#SP3_2">&#167;3.2</a>), 4/cl (<a href="4-cl.html#SP22">&#167;22</a>), 4/is (<a href="4-is.html#SP13">&#167;13</a>), 5/hf (<a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP26">&#167;26</a>).</p>
<p class="endnote">The function Bibliographic::get_datum is used in 1/pc (<a href="1-pc.html#SP7_2_2_1">&#167;7.2.2.1</a>, <a href="1-pc.html#SP7_2_3_1">&#167;7.2.3.1</a>), 2/tr (<a href="2-tr.html#SP4">&#167;4</a>, <a href="2-tr.html#SP9_3_1">&#167;9.3.1</a>, <a href="2-tr.html#SP9_3_3_2_1">&#167;9.3.3.2.1</a>, <a href="2-tr.html#SP9_2_2_3_1">&#167;9.2.2.3.1</a>), 3/ti (<a href="3-ti.html#SP2_1_3">&#167;2.1.3</a>, <a href="3-ti.html#SP4_1_8_1">&#167;4.1.8.1</a>), 3/tw (<a href="3-tw.html#SP1_3_3_1_10_4">&#167;1.3.3.1.10.4</a>), 3/tt (<a href="3-tt.html#SP3_2">&#167;3.2</a>), 4/cl (<a href="4-cl.html#SP22">&#167;22</a>), 4/is (<a href="4-is.html#SP13">&#167;13</a>), 5/hf (<a href="5-hf.html#SP9">&#167;9</a>, <a href="5-hf.html#SP27">&#167;27</a>).</p>
<p class="endnote">The function Bibliographic::data_exists is used in 1/pc (<a href="1-pc.html#SP7_2_2_1">&#167;7.2.2.1</a>, <a href="1-pc.html#SP7_2_3_1">&#167;7.2.3.1</a>), 1/ptt (<a href="1-ptt.html#SP3_2">&#167;3.2</a>), 3/ts (<a href="3-ts.html#SP3">&#167;3</a>), 3/ti (<a href="3-ti.html#SP2_1">&#167;2.1</a>, <a href="3-ti.html#SP4_1_8">&#167;4.1.8</a>), 3/tw (<a href="3-tw.html#SP1_2">&#167;1.2</a>, <a href="3-tw.html#SP1_4">&#167;1.4</a>), 4/is (<a href="4-is.html#SP13">&#167;13</a>).</p>
@ -226,7 +226,9 @@ want to typeset the title in full caps to do so.)
<p class="endnote">This code is used in <a href="#SP7">&#167;7</a>.</p>
<!--End of weave: 151 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 2: Parsing a Web.)</i></li><li><a href="2-tr.html">Continue with 'The Reader'</a></li></ul><hr class="tocbar">
<!--End of weave: 151 lines from a web of 21004-->
</body>
</html>

View file

@ -180,7 +180,9 @@ the code at the last line on which an <code class="display"><span class="extract
<p class="endnote">The function Enumerations::define_extents is used in 3/tt (<a href="3-tt.html#SP1_1_1">&#167;1.1.1</a>).</p>
<!--End of weave: 114 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-tgs.html">Back to 'Tags'</a></li><li><a href="2-pn.html">Continue with 'Paragraph Numbering'</a></li></ul><hr class="tocbar">
<!--End of weave: 114 lines from a web of 21004-->
</body>
</html>

View file

@ -173,7 +173,9 @@ some of these fell into disuse in version 2 syntax.
<span class="definitionkeyword">enum</span> <span class="constant">FIGURE_CMD</span>
<span class="definitionkeyword">enum</span> <span class="constant">TAG_CMD</span>
</pre>
<!--End of weave: 141 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-mdl.html">Back to 'Modules'</a></li><li><a href="2-tp.html">Continue with 'The Parser'</a></li></ul><hr class="tocbar">
<!--End of weave: 141 lines from a web of 21004-->
</body>
</html>

View file

@ -128,7 +128,7 @@ program generated by A.
<p class="inwebparagraph"></p>
<p class="endnote">The function Modules::make_search_path is used in 1/pc (<a href="1-pc.html#SP7_2">&#167;7.2</a>).</p>
<p class="endnote">The function Modules::make_search_path is used in 1/pc (<a href="1-pc.html#SP7">&#167;7</a>).</p>
<p class="inwebparagraph"><a id="SP7"></a><b>&#167;7. </b>When a web's contents page says to <code class="display"><span class="extract">import Blah</span></code>, how do we find the module
called <code class="display"><span class="extract">Blah</span></code> on disc? We try four possibilities in sequence:
@ -140,7 +140,7 @@ called <code class="display"><span class="extract">Blah</span></code> on disc? W
<span class="reserved">pathname</span><span class="plain"> *</span><span class="identifier">tries</span><span class="plain">[4];</span>
<span class="identifier">tries</span><span class="plain">[0] = </span><span class="identifier">W</span><span class="plain">?(</span><span class="identifier">W</span><span class="plain">-</span><span class="element">&gt;path_to_web</span><span class="plain">):</span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">tries</span><span class="plain">[1] = </span><span class="functiontext">Pathnames::up</span><span class="plain">(</span><span class="identifier">tries</span><span class="plain">[0]);</span>
<span class="identifier">tries</span><span class="plain">[2] = </span><span class="functiontext">Pathnames::from_text</span><span class="plain">(</span><span class="identifier">I</span><span class="string">"inweb"</span><span class="plain">);</span>
<span class="identifier">tries</span><span class="plain">[2] = </span><span class="identifier">path_to_inweb</span><span class="plain">;</span>
<span class="identifier">tries</span><span class="plain">[3] = </span><span class="identifier">ms</span><span class="plain">-</span><span class="element">&gt;path_to_search</span><span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">N</span><span class="plain"> = 4;</span>
<span class="reserved">for</span><span class="plain"> (</span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">i</span><span class="plain">=0; </span><span class="identifier">i</span><span class="plain">&lt;</span><span class="identifier">N</span><span class="plain">; </span><span class="identifier">i</span><span class="plain">++) {</span>
@ -215,7 +215,9 @@ module by name.
<p class="endnote">The function Modules::find_loaded_by_name is used in 6/mkf (<a href="6-mkf.html#SP2_9">&#167;2.9</a>, <a href="6-mkf.html#SP2_11">&#167;2.11</a>).</p>
<!--End of weave: 131 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-tr.html">Back to 'The Reader'</a></li><li><a href="2-lc.html">Continue with 'Line Categories'</a></li></ul><hr class="tocbar">
<!--End of weave: 131 lines from a web of 21004-->
</body>
</html>

View file

@ -74,7 +74,9 @@ much faster.
<p class="endnote">The function Macros::find_by_name is used in 2/pn (<a href="2-pn.html#SP1_1">&#167;1.1</a>), 3/tw (<a href="3-tw.html#SP1_3_3_1_9_6">&#167;1.3.3.1.9.6</a>), 3/tt (<a href="3-tt.html#SP3_1">&#167;3.1</a>).</p>
<!--End of weave: 45 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-tp.html">Back to 'The Parser'</a></li><li><a href="2-tgs.html">Continue with 'Tags'</a></li></ul><hr class="tocbar">
<!--End of weave: 45 lines from a web of 21004-->
</body>
</html>

View file

@ -270,7 +270,9 @@ chosen by the author, so 2 it is.
<p class="endnote">The function Numbering::settle_paragraph_number is used in <a href="#SP1_2_5">&#167;1.2.5</a>.</p>
<!--End of weave: 161 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-ec.html">Back to 'Enumerated Constants'</a></li><li><i>(This section ends Chapter 2: Parsing a Web.)</i></li></ul><hr class="tocbar">
<!--End of weave: 161 lines from a web of 21004-->
</body>
</html>

View file

@ -241,7 +241,9 @@ doesn't specify a tag.)
<p class="endnote">This code is used in <a href="#SP7">&#167;7</a> (twice).</p>
<!--End of weave: 171 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-pm.html">Back to 'Paragraph Macros'</a></li><li><a href="2-ec.html">Continue with 'Enumerated Constants'</a></li></ul><hr class="tocbar">
<!--End of weave: 171 lines from a web of 21004-->
</body>
</html>

View file

@ -1087,7 +1087,9 @@ when it comes to Inweb's exit code, so they will halt a make.
<p class="endnote">The function Parser::wrong_version is used in <a href="#SP1_1_1">&#167;1.1.1</a>, <a href="#SP1_1_5">&#167;1.1.5</a>, <a href="#SP1_1_6">&#167;1.1.6</a>, <a href="#SP1_1_6_3">&#167;1.1.6.3</a>, <a href="#SP1_1_6_5_1">&#167;1.1.6.5.1</a>, <a href="#SP1_1_6_5_1_1">&#167;1.1.6.5.1.1</a>, <a href="#SP1_1_6_5_1_2">&#167;1.1.6.5.1.2</a>, <a href="#SP1_1_6_5_1_3">&#167;1.1.6.5.1.3</a>, <a href="#SP1_1_6_5_1_4">&#167;1.1.6.5.1.4</a>, <a href="#SP1_1_6_5_1_5">&#167;1.1.6.5.1.5</a>, 3/tw (<a href="3-tw.html#SP1_3_3_1_2_1">&#167;1.3.3.1.2.1</a>).</p>
<!--End of weave: 702 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-lc.html">Back to 'Line Categories'</a></li><li><a href="2-pm.html">Continue with 'Paragraph Macros'</a></li></ul><hr class="tocbar">
<!--End of weave: 702 lines from a web of 21004-->
</body>
</html>

View file

@ -102,7 +102,7 @@ multi-chapter web.
<p class="inwebparagraph"></p>
<p class="endnote">The function Reader::load_web is used in 1/pc (<a href="1-pc.html#SP7_2">&#167;7.2</a>).</p>
<p class="endnote">The function Reader::load_web is used in 1/pc (<a href="1-pc.html#SP7">&#167;7</a>).</p>
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b>We abstract these in order to be able to respond well to their not existing:
</p>
@ -125,7 +125,7 @@ multi-chapter web.
<p class="inwebparagraph"></p>
<p class="endnote">The function Reader::woven_folder is used in 1/ptt (<a href="1-ptt.html#SP7">&#167;7</a>), 3/ts (<a href="3-ts.html#SP2_2">&#167;2.2</a>), 3/ti (<a href="3-ti.html#SP4_4">&#167;4.4</a>), 5/hf (<a href="5-hf.html#SP26">&#167;26</a>).</p>
<p class="endnote">The function Reader::woven_folder is used in 1/ptt (<a href="1-ptt.html#SP7">&#167;7</a>), 3/ts (<a href="3-ts.html#SP2_2">&#167;2.2</a>), 3/ti (<a href="3-ti.html#SP4_4">&#167;4.4</a>), 5/hf (<a href="5-hf.html#SP27">&#167;27</a>).</p>
<p class="endnote">The function Reader::tangled_folder is used in 1/pc (<a href="1-pc.html#SP7_2_2">&#167;7.2.2</a>), 3/tt (<a href="3-tt.html#SP1_2">&#167;1.2</a>), 4/is (<a href="4-is.html#SP13">&#167;13</a>).</p>
@ -1171,7 +1171,9 @@ get around the lack of some POSIX facilities on Windows.)
<p class="endnote">The function Reader::add_imported_header is used in <a href="#SP9_3_3_2">&#167;9.3.3.2</a>.</p>
<!--End of weave: 807 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="2-bd.html">Back to 'Bibliographic Data'</a></li><li><a href="2-mdl.html">Continue with 'Modules'</a></li></ul><hr class="tocbar">
<!--End of weave: 807 lines from a web of 21004-->
</body>
</html>

View file

@ -516,7 +516,9 @@ folder: failing that, we fall back on a default script belonging to Inweb.
<p class="endnote">The function Analyser::write_gitignore is used in 1/pc (<a href="1-pc.html#SP7_2_1">&#167;7.2.1</a>).</p>
<!--End of weave: 366 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 3: Outputs.)</i></li><li><a href="3-ts.html">Continue with 'The Swarm'</a></li></ul><hr class="tocbar">
<!--End of weave: 366 lines from a web of 21004-->
</body>
</html>

View file

@ -797,7 +797,9 @@ its square-bracketed parts.
<p class="endnote">The function Indexer::copy_CSS appears nowhere else.</p>
<!--End of weave: 522 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-ts.html">Back to 'The Swarm'</a></li><li><a href="3-tw.html">Continue with 'The Weaver'</a></li></ul><hr class="tocbar">
<!--End of weave: 522 lines from a web of 21004-->
</body>
</html>

View file

@ -255,7 +255,9 @@ generic <code class="display"><span class="extract">index.html</span></code> if
<p class="endnote">The function Swarm::weave_index_templates is used in <a href="#SP1">&#167;1</a>.</p>
<!--End of weave: 177 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-ta.html">Back to 'The Analyser'</a></li><li><a href="3-ti.html">Continue with 'The Indexer'</a></li></ul><hr class="tocbar">
<!--End of weave: 177 lines from a web of 21004-->
</body>
</html>

View file

@ -359,7 +359,9 @@ passes straight through. So <code class="display"><span class="extract">[[water]
<p class="endnote">The function Tangler::primary_target is used in 1/pc (<a href="1-pc.html#SP7_2_2">&#167;7.2.2</a>), 2/tr (<a href="2-tr.html#SP9_2">&#167;9.2</a>, <a href="2-tr.html#SP9_3_1">&#167;9.3.1</a>, <a href="2-tr.html#SP9_3_3_2">&#167;9.3.3.2</a>), 3/ta (<a href="3-ta.html#SP4">&#167;4</a>, <a href="3-ta.html#SP4_1">&#167;4.1</a>), 4/cl (<a href="4-cl.html#SP3">&#167;3</a>, <a href="4-cl.html#SP3_2">&#167;3.2</a>, <a href="4-cl.html#SP9_1">&#167;9.1</a>, <a href="4-cl.html#SP9_4">&#167;9.4</a>), 4/is (<a href="4-is.html#SP3">&#167;3</a>, <a href="4-is.html#SP6">&#167;6</a>, <a href="4-is.html#SP7">&#167;7</a>).</p>
<!--End of weave: 235 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-tw.html">Back to 'The Weaver'</a></li><li><i>(This section ends Chapter 3: Outputs.)</i></li></ul><hr class="tocbar">
<!--End of weave: 235 lines from a web of 21004-->
</body>
</html>

View file

@ -35,6 +35,7 @@ where to put the result: and so we arrive at the front door of the routine
<span class="reserved">if</span><span class="plain"> ((</span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-</span><span class="element">&gt;cover_sheet_to_use</span><span class="plain">) &gt; 0) &amp;&amp; (</span><span class="identifier">W</span><span class="plain">-</span><span class="element">&gt;no_sections</span><span class="plain"> &gt; 1))</span>
&lt;<span class="cwebmacro">Weave head of the cover sheet, if any</span> <span class="cwebmacronumber">1.2</span>&gt;<span class="plain">;</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">lines_woven</span><span class="plain"> = 0;</span>
<span class="reserved">section</span><span class="plain"> *</span><span class="identifier">latest_section</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
&lt;<span class="cwebmacro">Weave the body of the material</span> <span class="cwebmacronumber">1.3</span>&gt;<span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> ((</span><span class="functiontext">Str::len</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-</span><span class="element">&gt;cover_sheet_to_use</span><span class="plain">) &gt; 0) &amp;&amp; (</span><span class="identifier">W</span><span class="plain">-</span><span class="element">&gt;no_sections</span><span class="plain"> &gt; 1))</span>
&lt;<span class="cwebmacro">Weave tail of the cover sheet, if any</span> <span class="cwebmacronumber">1.4</span>&gt;<span class="plain">;</span>
@ -95,6 +96,7 @@ where to put the result: and so we arrive at the front door of the routine
<span class="functiontext">Str::clear</span><span class="plain">(</span><span class="identifier">state</span><span class="plain">-</span><span class="element">&gt;chaptermark</span><span class="plain">);</span>
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">, </span><span class="reserved">section</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">-</span><span class="element">&gt;sections</span><span class="plain">)</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Reader::range_within</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">-</span><span class="element">&gt;range</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-</span><span class="element">&gt;weave_range</span><span class="plain">)) {</span>
<span class="identifier">latest_section</span><span class="plain"> = </span><span class="identifier">S</span><span class="plain">;</span>
<span class="functiontext">Languages::begin_weave</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">);</span>
<span class="functiontext">Str::clear</span><span class="plain">(</span><span class="identifier">state</span><span class="plain">-</span><span class="element">&gt;sectionmark</span><span class="plain">);</span>
&lt;<span class="cwebmacro">Weave this section</span> <span class="cwebmacronumber">1.3.3</span>&gt;<span class="plain">;</span>
@ -129,7 +131,7 @@ where to put the result: and so we arrive at the front door of the routine
<pre class="displaydefn">
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">rennab</span><span class="plain">);</span>
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">rennab</span><span class="plain">, </span><span class="string">"End of weave: %d lines from a web of %d"</span><span class="plain">, </span><span class="identifier">lines_woven</span><span class="plain">, </span><span class="identifier">W</span><span class="plain">-</span><span class="element">&gt;no_lines</span><span class="plain">);</span>
<span class="functiontext">Formats::tail</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">rennab</span><span class="plain">);</span>
<span class="functiontext">Formats::tail</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">rennab</span><span class="plain">, </span><span class="identifier">latest_section</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">rennab</span><span class="plain">);</span>
</pre>
@ -1292,7 +1294,9 @@ marked as <code class="display"><span class="extract">@h</span></code> headings.
<p class="endnote">The function Weaver::weave_table_of_contents is used in <a href="#SP1_3_3_1_3">&#167;1.3.3.1.3</a>, <a href="#SP1_3_3_1_4">&#167;1.3.3.1.4</a>.</p>
<!--End of weave: 822 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="3-ti.html">Back to 'The Indexer'</a></li><li><a href="3-tt.html">Continue with 'The Tangler'</a></li></ul><hr class="tocbar">
<!--End of weave: 824 lines from a web of 21004-->
</body>
</html>

View file

@ -1522,7 +1522,9 @@ bibliographic variable, but don't do that.
<p class="endnote">The function CLike::post_analysis is used in <a href="#SP2">&#167;2</a>.</p>
<!--End of weave: 1014 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-pl.html">Back to 'Programming Languages'</a></li><li><a href="4-is.html">Continue with 'InC Support'</a></li></ul><hr class="tocbar">
<!--End of weave: 1014 lines from a web of 21004-->
</body>
</html>

View file

@ -1534,7 +1534,9 @@ exists. We watch for it here:
<p class="endnote">The function InCSupport::share_element is used in <a href="#SP1">&#167;1</a>.</p>
<!--End of weave: 993 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-cl.html">Back to 'C-Like Languages'</a></li><li><a href="4-ps.html">Continue with 'Perl Support'</a></li></ul><hr class="tocbar">
<!--End of weave: 993 lines from a web of 21004-->
</body>
</html>

View file

@ -87,7 +87,9 @@ a spurious comment betraying Inweb's involvement in the process.
<p class="endnote">The function InformSupport::suppress_disclaimer is used in <a href="#SP2">&#167;2</a>.</p>
<!--End of weave: 51 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-ps.html">Back to 'Perl Support'</a></li><li><i>(This section ends Chapter 4: Languages.)</i></li></ul><hr class="tocbar">
<!--End of weave: 51 lines from a web of 21004-->
</body>
</html>

View file

@ -803,7 +803,9 @@ special treatment, and this method decides which.
<p class="endnote">The function Languages::share_element is used in 4/cl (<a href="4-cl.html#SP3_2_3_6">&#167;3.2.3.6</a>).</p>
<!--End of weave: 510 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 4: Languages.)</i></li><li><a href="4-cl.html">Continue with 'C-Like Languages'</a></li></ul><hr class="tocbar">
<!--End of weave: 510 lines from a web of 21004-->
</body>
</html>

View file

@ -144,7 +144,9 @@ principle overloading its comment notation <code class="display"><span class="ex
<p class="endnote">The function PerlSupport::parse_comment is used in <a href="#SP1">&#167;1</a>.</p>
<!--End of weave: 94 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="4-is.html">Back to 'InC Support'</a></li><li><a href="4-is2.html">Continue with 'Inform Support'</a></li></ul><hr class="tocbar">
<!--End of weave: 94 lines from a web of 21004-->
</body>
</html>

View file

@ -11,7 +11,7 @@
<!--Weave of '5/hf' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">&#9733;</a></li><li><a href="index.html">inweb 7</a></li><li><a href="index.html#5">Chapter 5: Formats</a></li><li><b>HTML Formats</b></li></ul><p class="purpose">To provide for weaving into HTML and into EPUB books.</p>
<ul class="toc"><li><a href="#SP2">&#167;2. Current state</a></li><li><a href="#SP6">&#167;6. Methods</a></li><li><a href="#SP26">&#167;26. EPUB-only methods</a></li></ul><hr class="tocbar">
<ul class="toc"><li><a href="#SP2">&#167;2. Current state</a></li><li><a href="#SP6">&#167;6. Methods</a></li><li><a href="#SP27">&#167;27. EPUB-only methods</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. </b></p>
@ -813,8 +813,44 @@ the page, and this drops one.
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::tail</span><span class="reserved">(weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">this_S</span><span class="plain">) {</span>
<span class="functiontext">HTMLFormat::exit_current_paragraph</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">wv</span><span class="plain">-</span><span class="element">&gt;docs_mode</span><span class="plain">) {</span>
<span class="reserved">chapter</span><span class="plain"> *</span><span class="identifier">C</span><span class="plain"> = </span><span class="identifier">this_S</span><span class="plain">-</span><span class="element">&gt;owning_chapter</span><span class="plain">;</span>
<span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">, *</span><span class="identifier">last_S</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">, *</span><span class="identifier">prev_S</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">, *</span><span class="identifier">next_S</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">S</span><span class="plain">, </span><span class="reserved">section</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">-</span><span class="element">&gt;sections</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">S</span><span class="plain"> == </span><span class="identifier">this_S</span><span class="plain">) </span><span class="identifier">prev_S</span><span class="plain"> = </span><span class="identifier">last_S</span><span class="plain">;</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">last_S</span><span class="plain"> == </span><span class="identifier">this_S</span><span class="plain">) </span><span class="identifier">next_S</span><span class="plain"> = </span><span class="identifier">S</span><span class="plain">;</span>
<span class="identifier">last_S</span><span class="plain"> = </span><span class="identifier">S</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="functiontext">HTML::hr</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="string">"tocbar"</span><span class="plain">);</span>
<span class="identifier">HTML_OPEN_WITH</span><span class="plain">(</span><span class="string">"ul"</span><span class="plain">, </span><span class="string">"class=\</span><span class="plain">"</span><span class="string">toc\</span><span class="plain">"</span><span class="string">"</span><span class="plain">);</span>
<span class="identifier">HTML_OPEN</span><span class="plain">(</span><span class="string">"li"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">prev_S</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"&lt;i&gt;(This section begins %S.)&lt;/i&gt;"</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">-</span><span class="element">&gt;ch_title</span><span class="plain">);</span>
<span class="reserved">else</span><span class="plain"> {</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">);</span>
<span class="functiontext">HTMLFormat::sref</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">prev_S</span><span class="plain">);</span>
<span class="functiontext">HTML::begin_link</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">TEMP</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"Back to '%S'"</span><span class="plain">, </span><span class="identifier">prev_S</span><span class="plain">-</span><span class="element">&gt;sect_title</span><span class="plain">);</span>
<span class="functiontext">HTML::end_link</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="identifier">HTML_CLOSE</span><span class="plain">(</span><span class="string">"li"</span><span class="plain">);</span>
<span class="identifier">HTML_OPEN</span><span class="plain">(</span><span class="string">"li"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">next_S</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"&lt;i&gt;(This section ends %S.)&lt;/i&gt;"</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">-</span><span class="element">&gt;ch_title</span><span class="plain">);</span>
<span class="reserved">else</span><span class="plain"> {</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">);</span>
<span class="functiontext">HTMLFormat::sref</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">next_S</span><span class="plain">);</span>
<span class="functiontext">HTML::begin_link</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">TEMP</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"Continue with '%S'"</span><span class="plain">, </span><span class="identifier">next_S</span><span class="plain">-</span><span class="element">&gt;sect_title</span><span class="plain">);</span>
<span class="functiontext">HTML::end_link</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">);</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="identifier">HTML_CLOSE</span><span class="plain">(</span><span class="string">"li"</span><span class="plain">);</span>
<span class="identifier">HTML_CLOSE</span><span class="plain">(</span><span class="string">"ul"</span><span class="plain">);</span>
<span class="functiontext">HTML::hr</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="string">"tocbar"</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="functiontext">HTML::comment</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">comment</span><span class="plain">);</span>
<span class="functiontext">HTML::completed</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">);</span>
<span class="functiontext">Bibliographic::set_datum</span><span class="plain">(</span><span class="identifier">wv</span><span class="plain">-</span><span class="element">&gt;weave_web</span><span class="plain">, </span><span class="identifier">I</span><span class="string">"Booklet Title"</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-</span><span class="element">&gt;booklet_title</span><span class="plain">);</span>
@ -826,7 +862,26 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::tail is used in <a href="#SP1_1_1">&#167;1.1.1</a>.</p>
<p class="inwebparagraph"><a id="SP26"></a><b>&#167;26. EPUB-only methods. </b></p>
<p class="inwebparagraph"><a id="SP26"></a><b>&#167;26. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::sref</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">) {</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">S</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"unwoven section"</span><span class="plain">);</span>
<span class="identifier">LOOP_THROUGH_TEXT</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">-</span><span class="element">&gt;range</span><span class="plain">)</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext">Str::get</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">) == </span><span class="character">'/'</span><span class="plain">)</span>
<span class="identifier">PUT</span><span class="plain">(</span><span class="character">'-'</span><span class="plain">);</span>
<span class="reserved">else</span>
<span class="identifier">PUT</span><span class="plain">(</span><span class="functiontext">Str::get</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">));</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">".html"</span><span class="plain">);</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function HTMLFormat::sref is used in <a href="#SP25">&#167;25</a>.</p>
<p class="inwebparagraph"><a id="SP27"></a><b>&#167;27. EPUB-only methods. </b></p>
<pre class="display">
@ -856,7 +911,9 @@ the page, and this drops one.
<p class="endnote">The function HTMLFormat::end_weaving_EPUB is used in <a href="#SP1_2">&#167;1.2</a>.</p>
<!--End of weave: 620 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="5-tf.html">Back to 'TeX Format'</a></li><li><a href="5-rtt.html">Continue with 'Running Through TeX'</a></li></ul><hr class="tocbar">
<!--End of weave: 668 lines from a web of 21004-->
</body>
</html>

View file

@ -274,7 +274,7 @@
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">PlainText::tail</span><span class="reserved">(weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">) {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"[%S]\</span><span class="plain">n</span><span class="string">"</span><span class="plain">, </span><span class="identifier">comment</span><span class="plain">);</span>
<span class="plain">}</span>
</pre>
@ -283,7 +283,9 @@
<p class="endnote">The function PlainText::tail is used in <a href="#SP1">&#167;1</a>.</p>
<!--End of weave: 165 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="5-wf.html">Back to 'Weave Formats'</a></li><li><a href="5-tf.html">Continue with 'TeX Format'</a></li></ul><hr class="tocbar">
<!--End of weave: 165 lines from a web of 21004-->
</body>
</html>

View file

@ -275,7 +275,9 @@ for the user to find out what those errors were.
<p class="endnote">The function RunningTeX::substitute_post_processing_data is used in 5/tf (<a href="5-tf.html#SP27">&#167;27</a>).</p>
<!--End of weave: 178 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="5-hf.html">Back to 'HTML Formats'</a></li><li><i>(This section ends Chapter 5: Formats.)</i></li></ul><hr class="tocbar">
<!--End of weave: 178 lines from a web of 21004-->
</body>
</html>

View file

@ -667,7 +667,7 @@ or DVI, only the middle one is.
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">TeX::tail</span><span class="reserved">(weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">) {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"%% %S\</span><span class="plain">n</span><span class="string">"</span><span class="plain">, </span><span class="identifier">comment</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"\</span><span class="plain">\</span><span class="string">end\</span><span class="plain">n</span><span class="string">"</span><span class="plain">);</span>
<span class="plain">}</span>
@ -881,7 +881,9 @@ To do this, the weaver calls the following.
<p class="endnote">This code is used in <a href="#SP28">&#167;28</a>.</p>
<!--End of weave: 577 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="5-ptf.html">Back to 'Plain Text Format'</a></li><li><a href="5-hf.html">Continue with 'HTML Formats'</a></li></ul><hr class="tocbar">
<!--End of weave: 577 lines from a web of 21004-->
</body>
</html>

View file

@ -734,10 +734,10 @@ intended for human eyes, and will be some sort of "End of weave" remark.
<pre class="display">
<span class="identifier">VMETHOD_TYPE</span><span class="plain">(</span><span class="constant">TAIL_FOR_MTID</span><span class="plain">,</span><span class="reserved"> weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">)</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Formats::tail</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">) {</span>
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">)</span>
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Formats::tail</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">comment</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">S</span><span class="plain">) {</span>
<span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">wf</span><span class="plain"> = </span><span class="identifier">wv</span><span class="plain">-</span><span class="element">&gt;format</span><span class="plain">;</span>
<span class="identifier">VMETHOD_CALL</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">TAIL_FOR_MTID</span><span class="plain">, </span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">comment</span><span class="plain">);</span>
<span class="identifier">VMETHOD_CALL</span><span class="plain">(</span><span class="identifier">wf</span><span class="plain">, </span><span class="constant">TAIL_FOR_MTID</span><span class="plain">, </span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">comment</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">);</span>
<span class="plain">}</span>
</pre>
@ -837,7 +837,9 @@ text like <code class="display"><span class="extract">[[PDF Size]]</span></code>
<p class="endnote">The function Formats::substitute_post_processing_data is used in 3/ti (<a href="3-ti.html#SP4_1_8_2">&#167;4.1.8.2</a>, <a href="3-ti.html#SP4_1_8_3">&#167;4.1.8.3</a>, <a href="3-ti.html#SP4_1_8_4">&#167;4.1.8.4</a>).</p>
<!--End of weave: 540 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 5: Formats.)</i></li><li><a href="5-ptf.html">Continue with 'Plain Text Format'</a></li></ul><hr class="tocbar">
<!--End of weave: 540 lines from a web of 21004-->
</body>
</html>

View file

@ -103,7 +103,9 @@ file by following a "prototype".
<p class="endnote">This code is used in <a href="#SP2">&#167;2</a>.</p>
<!--End of weave: 62 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="6-mkf.html">Back to 'Makefiles'</a></li><li><i>(This section ends Chapter 6: Extras.)</i></li></ul><hr class="tocbar">
<!--End of weave: 62 lines from a web of 21004-->
</body>
</html>

View file

@ -86,7 +86,7 @@ following a "prototype".
<p class="inwebparagraph"></p>
<p class="endnote">The function Makefiles::scan_makefile_line is used in <a href="#SP1">&#167;1</a>, <a href="#SP2_5">&#167;2.5</a>, <a href="#SP3">&#167;3</a>.</p>
<p class="endnote">The function Makefiles::scan_makefile_line is used in <a href="#SP1">&#167;1</a>, <a href="#SP2_5">&#167;2.5</a>, <a href="#SP4">&#167;4</a>.</p>
<p class="inwebparagraph"><a id="SP2_1"></a><b>&#167;2.1. </b><code class="display">
&lt;<span class="cwebmacrodefn">Begin a repeat block</span> <span class="cwebmacronumber">2.1</span>&gt; =
@ -181,19 +181,26 @@ following a "prototype".
<pre class="displaydefn">
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"MYNAME = %S\</span><span class="plain">n</span><span class="string">"</span><span class="plain">, </span><span class="functiontext">Pathnames::directory_name</span><span class="plain">(</span><span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;for_web</span><span class="plain">-</span><span class="element">&gt;path_to_web</span><span class="plain">));</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"ME = %p\</span><span class="plain">n</span><span class="string">"</span><span class="plain">, </span><span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;for_web</span><span class="plain">-</span><span class="element">&gt;path_to_web</span><span class="plain">);</span>
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">MW</span><span class="plain"> = </span><span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;for_web</span><span class="plain">-</span><span class="element">&gt;as_module</span><span class="plain">;</span>
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">X</span><span class="plain"> = </span><span class="identifier">FIRST_IN_LINKED_LIST</span><span class="plain">(</span><span class="reserved">module</span><span class="plain">, </span><span class="identifier">MW</span><span class="plain">-</span><span class="element">&gt;dependencies</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">X</span><span class="plain">) {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"# which depends on:\</span><span class="plain">n</span><span class="string">"</span><span class="plain">);</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">N</span><span class="plain"> = 1;</span>
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">X</span><span class="plain">, </span><span class="reserved">module</span><span class="plain">, </span><span class="identifier">MW</span><span class="plain">-</span><span class="element">&gt;dependencies</span><span class="plain">) {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"MODULE%d = %p\</span><span class="plain">n</span><span class="string">"</span><span class="plain">, </span><span class="identifier">N</span><span class="plain">, </span><span class="identifier">X</span><span class="plain">-</span><span class="element">&gt;module_location</span><span class="plain">);</span>
<span class="identifier">N</span><span class="plain">++;</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"INWEB = "</span><span class="plain">); </span><span class="functiontext">Makefiles::pathname_slashed</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">path_to_inweb</span><span class="plain">); </span><span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"/Tangled/inweb\</span><span class="plain">n</span><span class="string">"</span><span class="plain">);</span>
<span class="reserved">pathname</span><span class="plain"> *</span><span class="identifier">path_to_intest</span><span class="plain"> = </span><span class="functiontext">Pathnames::subfolder</span><span class="plain">(</span><span class="functiontext">Pathnames::up</span><span class="plain">(</span><span class="identifier">path_to_inweb</span><span class="plain">), </span><span class="identifier">I</span><span class="string">"intest"</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"INTEST = "</span><span class="plain">); </span><span class="functiontext">Makefiles::pathname_slashed</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">path_to_intest</span><span class="plain">); </span><span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"/Tangled/intest\</span><span class="plain">n</span><span class="string">"</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;for_web</span><span class="plain">) {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"MYNAME = %S\</span><span class="plain">n</span><span class="string">"</span><span class="plain">, </span><span class="functiontext">Pathnames::directory_name</span><span class="plain">(</span><span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;for_web</span><span class="plain">-</span><span class="element">&gt;path_to_web</span><span class="plain">));</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"ME = "</span><span class="plain">); </span><span class="functiontext">Makefiles::pathname_slashed</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;for_web</span><span class="plain">-</span><span class="element">&gt;path_to_web</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"\</span><span class="plain">n</span><span class="string">"</span><span class="plain">);</span>
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">MW</span><span class="plain"> = </span><span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;for_web</span><span class="plain">-</span><span class="element">&gt;as_module</span><span class="plain">;</span>
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">X</span><span class="plain"> = </span><span class="identifier">FIRST_IN_LINKED_LIST</span><span class="plain">(</span><span class="reserved">module</span><span class="plain">, </span><span class="identifier">MW</span><span class="plain">-</span><span class="element">&gt;dependencies</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">X</span><span class="plain">) {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"# which depends on:\</span><span class="plain">n</span><span class="string">"</span><span class="plain">);</span>
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">N</span><span class="plain"> = 1;</span>
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">X</span><span class="plain">, </span><span class="reserved">module</span><span class="plain">, </span><span class="identifier">MW</span><span class="plain">-</span><span class="element">&gt;dependencies</span><span class="plain">) {</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"MODULE%d = "</span><span class="plain">, </span><span class="identifier">N</span><span class="plain">++);</span>
<span class="functiontext">Makefiles::pathname_slashed</span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">X</span><span class="plain">-</span><span class="element">&gt;module_location</span><span class="plain">);</span>
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"\</span><span class="plain">n</span><span class="string">"</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="plain">}</span>
<span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;last_line_was_blank</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="plain">}</span>
<span class="identifier">MS</span><span class="plain">-</span><span class="element">&gt;last_line_was_blank</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
<span class="functiontext">Regexp::dispose_of</span><span class="plain">(&amp;</span><span class="identifier">mr</span><span class="plain">);</span>
<span class="reserved">return</span><span class="plain">;</span>
</pre>
@ -331,7 +338,27 @@ following a "prototype".
<p class="endnote">This code is used in <a href="#SP2">&#167;2</a>.</p>
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b>And finally, the following handles repetitions both of blocks and of spans:
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b></p>
<pre class="display">
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Makefiles::pathname_slashed</span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">pathname</span><span class="plain"> *</span><span class="identifier">P</span><span class="plain">) {</span>
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">PT</span><span class="plain">)</span>
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">PT</span><span class="plain">, </span><span class="string">"%p"</span><span class="plain">, </span><span class="identifier">P</span><span class="plain">);</span>
<span class="identifier">LOOP_THROUGH_TEXT</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">, </span><span class="identifier">PT</span><span class="plain">) {</span>
<span class="identifier">wchar_t</span><span class="plain"> </span><span class="identifier">c</span><span class="plain"> = </span><span class="functiontext">Str::get</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">);</span>
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">c</span><span class="plain"> == </span><span class="character">' '</span><span class="plain">) </span><span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"\</span><span class="plain">\</span><span class="string"> "</span><span class="plain">);</span>
<span class="reserved">else</span><span class="plain"> </span><span class="identifier">PUT</span><span class="plain">(</span><span class="identifier">c</span><span class="plain">);</span>
<span class="plain">}</span>
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">PT</span><span class="plain">)</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<p class="endnote">The function Makefiles::pathname_slashed is used in <a href="#SP2_6">&#167;2.6</a>.</p>
<p class="inwebparagraph"><a id="SP4"></a><b>&#167;4. </b>And finally, the following handles repetitions both of blocks and of spans:
</p>
@ -372,7 +399,9 @@ following a "prototype".
<p class="endnote">The function Makefiles::repeat is used in <a href="#SP2_3">&#167;2.3</a>, <a href="#SP2_4">&#167;2.4</a>.</p>
<!--End of weave: 235 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 6: Extras.)</i></li><li><a href="6-gs.html">Continue with 'Git Support'</a></li></ul><hr class="tocbar">
<!--End of weave: 255 lines from a web of 21004-->
</body>
</html>

View file

@ -311,7 +311,9 @@ a repetition, but happens just once, for the named chapter or section.
<p class="inwebparagraph"></p>
<!--End of weave: 198 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="P-tid.html">Back to 'The InC Dialect'</a></li><li><i>(This section ends Preliminaries.)</i></li></ul><hr class="tocbar">
<!--End of weave: 198 lines from a web of 21004-->
</body>
</html>

View file

@ -503,7 +503,9 @@ be rendered in HTML as <code class="display"><span class="extract">x &lt;= y</sp
<p class="inwebparagraph"></p>
<!--End of weave: 312 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="P-wtaw.html">Back to 'Webs, Tangling and Weaving'</a></li><li><a href="P-tid.html">Continue with 'The InC Dialect'</a></li></ul><hr class="tocbar">
<!--End of weave: 312 lines from a web of 21004-->
</body>
</html>

View file

@ -253,7 +253,9 @@ with this breakpoint". We do not recommend this.
<ul class="items"><li>(d) Inweb can be used with much larger programs divided into sections
and, if desired, chapters.
</li></ul>
<!--End of weave: 193 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Preliminaries.)</i></li><li><a href="P-wtaw.html">Continue with 'Webs, Tangling and Weaving'</a></li></ul><hr class="tocbar">
<!--End of weave: 193 lines from a web of 21004-->
</body>
</html>

View file

@ -120,7 +120,9 @@ notation means, but for example:
<p class="inwebparagraph"></p>
<!--End of weave: 70 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="P-htwaw.html">Back to 'How to Write a Web'</a></li><li><a href="P-awwp.html">Continue with 'Advanced Weaving with Patterns'</a></li></ul><hr class="tocbar">
<!--End of weave: 70 lines from a web of 21004-->
</body>
</html>

View file

@ -859,7 +859,9 @@ expect that to be able to link to a <code class="display"><span class="extract">
above them.
</p>
<!--End of weave: 554 lines from a web of 20880-->
<hr class="tocbar">
<ul class="toc"><li><a href="P-iti.html">Back to 'Introduction to Inweb'</a></li><li><a href="P-htwaw.html">Continue with 'How to Write a Web'</a></li></ul><hr class="tocbar">
<!--End of weave: 554 lines from a web of 21004-->
</body>
</html>

View file

@ -1,6 +1,6 @@
<html>
<head>
<title>Inweb &#9733; Webs</title>
<title>Inform &#9733; Webs</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
<link href="inweb/inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
@ -17,23 +17,29 @@ are difficult for new readers to navigate, and are not structured for extended
reading. By contrast, a "web" (the term goes back to Knuth: see
<a href="https://en.wikipedia.org/wiki/Literate_programming">Wikipedia</a>)
is designed to be read by humans in its "woven" form, and to be compiled or
run by computers in its "tangled" form.</p>
<p class="chapter">These pages showcase the woven form, and are for human eyes only:</p>
run by computers in its "tangled" form.
These pages showcase the woven form, and are for human eyes only.</p>
<hr>
<p class="chapter">This repository includes the following webs:</p>
<ul class="sectionlist">
<li>
<p><a href="inweb/index.html"><spon class="sectiontitle">inweb</span></a> -
<span class="purpose">A modern system for literate programming.</span></p>
</li>
<li>
<p><a href="foundation-module/index.html"><spon class="sectiontitle">foundation</span></a> -
<span class="purpose">A module of common code used by all of the Inform tools.</span></p>
</li>
<li>
<p><a href="foundation-test/index.html"><spon class="sectiontitle">foundation-test</span></a> -
<span class="purpose">A stand-along program of unit tests for the Foundation module.</span></p>
</li>
<li>
<p><a href="inweb/index.html"><spon class="sectiontitle">inweb</span></a> -
version 7 'Escape to Danger'
- <span class="purpose">A modern system for literate programming.</span>
Documentation is <a href="inweb/P-iti.html">here</a>.</p>
</li>
<li>
<p><a href="docs/foundation-module/index.html"><spon class="sectiontitle">foundation</span></a> (module) -
<span class="purpose">A library of common code used by all of the Inform tools.</span></p>
</li>
<li>
<p><a href="docs/webs.html"><spon class="sectiontitle">foundation-test</span></a> -
<span class="purpose">For testing the foundation module.</span></p>
</li>
</ul>
<hr>
</body>
</html>

View file

@ -79,6 +79,8 @@ test:
.PHONY: pages
pages:
mkdir -p $(ME)/docs
inform/inpolicy/Tangled/inpolicy -write-me inweb/scripts/READMEscript.txt
mkdir -p $(ME)/docs/inweb
mkdir -p $(ME)/docs/foundation-module
mkdir -p $(ME)/docs/foundation-test

124
scripts/READMEscript.txt Normal file
View file

@ -0,0 +1,124 @@
@-> ../README.md
# Inweb @version(inweb)
## About Inweb
Inweb offers a modern approach to literate programming, a methodology created
by Donald Knuth in the late 1970s. A literate program, or "web", is constructed
in a narrative way, and is intended to be readable by humans as well as by
other programs. For example, the human-readable (or "woven") form of Inweb
itself is [here](docs/webs.html).
A comprehensive Inweb manual can be [read here](docs/inweb/P-iti.html).
Inweb is intentionally self-sufficient, with no dependencies on any other
software: it cam be built on any platform supporting the gcc or clang C
compilers. Its main use since 2004 has been to build the Inform compiler and
its associated tools (see [ganelson/inform](https://github.com/ganelson/inform)),
including another general-purpose tool, [ganelson/intest](https://github.com/ganelson/intest).
## Build Instructions
Inweb is itself a literate program. There is clearly a circularity here: to
compile Inweb, you must first run Inweb to "tangle" it, that is, to prepare
it for compilation. But if you already had Inweb, you wouldn't need to compile it.
Because of that, and because of the need to run cross-platform, the initial
setup takes a few minutes:
* Create a directory to work in, called, say, "work". Change the current directory to this.
* Clone Inweb as "work/inweb".
* Run **one of the following commands**. Unix is for any generic version of Unix,
non-Linux, non-MacOS: Solaris, for example. Android support is currently disabled
(though only because its build settings are currently missing from the inweb
distribution). The older macos32 platform won't build with the MacOS SDK from
10.14 onwards, and in any case 32-bit executables won't run from 10.15 onwards:
so use the default macos unless you need to build for an old version of MacOS.
* "make -f inweb/inweb.mk macos"
* "make -f inweb/inweb.mk macos32"
* "make -f inweb/inweb.mk linux"
* "make -f inweb/inweb.mk windows"
* "make -f inweb/inweb.mk unix"
* "make -f inweb/inweb.mk android"
* You should see some typical make chatter, ending in a reply such as "===
Platform set to 64-bit MacOS. Now: make -f inweb/inweb.mk initial ===".
(All that happened, in fact, was that a platform-specific file of make settings —
what compilers to use, what options, and so on — was copied over to become the
file inweb/platform-settings.mk.)
* Now run the command:
* "make -f inweb/inweb.mk initial"
* You should now have a working copy of Inweb. For a simple test, try
"inweb/Tangled/inweb -help". To build Inweb again, no need to use "initial",
and simply:
* "make -f inweb/inweb.mk"
@-> ../docs/webs.html
@define web(program, manual)
<li>
<p><a href="@program/index.html"><spon class="sectiontitle">@program</span></a> -
@version(@program)
- <span class="purpose">@purpose(@program)</span>
Documentation is <a href="@program/@manual.html">here</a>.</p>
</li>
@end
@define subweb(owner, program)
<li>
<p>↳ <a href="docs/webs.html"><spon class="sectiontitle">@program</span></a> -
<span class="purpose">@purpose(@owner/@program)</span></p>
</li>
@end
@define mod(owner, module)
<li>
<p>↳ <a href="docs/@module-module/index.html"><spon class="sectiontitle">@module</span></a> (module) -
<span class="purpose">@purpose(@owner/@module-module)</span></p>
</li>
@end
@define extweb(program)
<li>
<p><a href="../@program/docs/webs.html"><spon class="sectiontitle">@program</span></a> -
@version(@program)
- <span class="purpose">@purpose(@program)</span>
This has its own repository, with its own &#9733; Webs page.</p>
</li>
@end
@define extsubweb(owner, program)
<li>
<p>↳ <a href="../@owner/docs/webs.html"><spon class="sectiontitle">@program</span></a> -
<span class="purpose">@purpose(@owner/@program)</span></p>
</li>
@end
@define extmod(owner, module)
<li>
<p>↳ <a href="../@owner/docs/@module-module/index.html"><spon class="sectiontitle">@module</span></a> (module) -
<span class="purpose">@purpose(@owner/@module-module)</span></p>
</li>
@end
<html>
<head>
<title>Inform &#9733; Webs</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
<link href="inweb/inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
</head>
<body>
<ul class="crumbs"><li><b>&#9733;</b></li><li><b>Webs</b></li></ul>
<p class="purpose">Human-readable source code.</p>
<hr>
<p class="chapter">
This GitHub project was written as a literate program, powered by a LP tool
called Inweb. While almost all programs at Github are open to inspection, most
are difficult for new readers to navigate, and are not structured for extended
reading. By contrast, a "web" (the term goes back to Knuth: see
<a href="https://en.wikipedia.org/wiki/Literate_programming">Wikipedia</a>)
is designed to be read by humans in its "woven" form, and to be compiled or
run by computers in its "tangled" form.
These pages showcase the woven form, and are for human eyes only.</p>
<hr>
<p class="chapter">This repository includes the following webs:</p>
<ul class="sectionlist">
@web('inweb', 'P-iti')
@mod('inweb', 'foundation')
@subweb('inweb', 'foundation-test')
</ul>
</body>
</html>

View file

@ -99,6 +99,8 @@ test:
.PHONY: pages
pages:
mkdir -p $(ME)/docs
inform/inpolicy/Tangled/inpolicy -write-me inweb/scripts/READMEscript.txt
mkdir -p $(ME)/docs/inweb
mkdir -p $(ME)/docs/foundation-module
mkdir -p $(ME)/docs/foundation-test