Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to recreate the example from the text "Mini-Indexes for Literate Programs," in Don E. Knuth, "Digital Typography," pp. 225--245. gb_graph.hux and gb_save.hux were created by hand from gb_graph.aux and gb_save.aux resulting from 'ctwill gb_graph' and 'ctwill gb_save' on the SGB source modules. ham.bux @i'ncludes these two files. ham.ch adapts ham.w to the CTWILL conventions. system.bux comes from CWEBbin and was slightly amended. Recipe: $> ctwill ham ham # prime the pump $> ctwill ham ham # produce results $> pdftex ham # requires ctwimac.tex from CTWILL/CWEBbin $> refsort < ham.ref > ham.sref $> pdftex ham This should produce a 4-page PDF document for HAM. Note that the CWEB code presented here differs from the code in the book.
- Loading branch information
Showing
5 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@$tip {GB\_\,GRAPH}10 \&{Vertex} ${}{*}{}$@> | ||
@$next {GB\_\,GRAPH}10 \&{Arc} ${}{*}{}$@> | ||
@$arcs {GB\_\,GRAPH}9 \&{Arc} ${}{*}{}$@> | ||
@$name {GB\_\,GRAPH}9 \&{char} ${}{*}{}$@> | ||
@$n {GB\_\,GRAPH}13 \&{long}@> | ||
@$vertices {GB\_\,GRAPH}20 \&{Vertex} ${}{*}{}$@> | ||
@$I {GB\_\,GRAPH}8 \&{long}@> | ||
@$m {GB\_\,GRAPH}13 \&{long}@> | ||
@$V {GB\_\,GRAPH}8 \&{Vertex} ${}{*}{}$@> | ||
@$A {GB\_\,GRAPH}8 \&{Arc} ${}{*}{}$@> | ||
@$w {GB\_\,GRAPH}9 \&{util}@> | ||
|
||
@$util {GB\_\,GRAPH}8 =\&{union}@> | ||
@$Vertex {GB\_\,GRAPH}9 =\&{struct}@> | ||
@$Arc {GB\_\,GRAPH}10 =\&{struct}@> | ||
@$gb_typed_alloc {GB\_\,GRAPH}11 =macro (\,)@> | ||
@$Graph {GB\_\,GRAPH}20 =\&{struct}@> | ||
@$n_1 {GB\_\,GRAPH}22 =macro@> | ||
@$arcs_per_block {GB\_\,GRAPH}29 =\T{102}@> | ||
@$gb_new_graph {GB\_\,GRAPH}31 =macro@> | ||
@$gb_new_arc {GB\_\,GRAPH}31 =macro@> | ||
@$gb_new_edge {GB\_\,GRAPH}31 =macro@> | ||
@$siz_t {GB\_\,GRAPH}34 =\&{unsigned} \&{long}@> | ||
@$string_block_size {GB\_\,GRAPH}35 =\T{1016}@> | ||
@$hash_link {GB\_\,GRAPH}43 =macro@> | ||
@$hash_head {GB\_\,GRAPH}43 =macro@> | ||
@$HASH_MULT {GB\_\,GRAPH}45 =\T{314159}@> | ||
@$HASH_PRIME {GB\_\,GRAPH}45 =\T{516595003}@> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@$restore_graph {GB\_\,SAVE}4 \&{Graph} ${}{*}(\,){}$@> | ||
|
||
@$MAX_SV_STRING {GB\_\,SAVE}1 =\T{4095}@> | ||
@$MAX_SV_ID {GB\_\,SAVE}1 =\T{154}@> | ||
@$panic {GB\_\,SAVE}5 =macro (\,)@> | ||
@$fillin {GB\_\,SAVE}7 =macro (\,)@> | ||
@$buffer {GB\_\,SAVE}13 =macro@> | ||
@$bad_type_code {GB\_\,SAVE}19 =\T{\^1}@> | ||
@$string_too_long {GB\_\,SAVE}19 =\T{\^2}@> | ||
@$addr_not_in_data_area {GB\_\,SAVE}19 =\T{\^4}@> | ||
@$addr_in_mixed_block {GB\_\,SAVE}19 =\T{\^8}@> | ||
@$bad_string_char {GB\_\,SAVE}19 =\T{\^10}@> | ||
@$ignored_data {GB\_\,SAVE}19 =\T{\^20}@> | ||
@$unk {GB\_\,SAVE}21 =\T{0}@> | ||
@$ark {GB\_\,SAVE}21 =\T{1}@> | ||
@$vrt {GB\_\,SAVE}21 =\T{2}@> | ||
@$mxt {GB\_\,SAVE}21 =\T{3}@> | ||
@$block_rep {GB\_\,SAVE}21 =\&{struct}@> | ||
@$lookup {GB\_\,SAVE}25 =macro (\,)@> | ||
@$append_comma {GB\_\,SAVE}37 =macro@> | ||
@$trans {GB\_\,SAVE}39 =macro (\,)@> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@i gb_graph.hux | ||
@i gb_save.hux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@x | ||
\datethis | ||
@y | ||
\def\title{HAM} | ||
@z | ||
|
||
@x | ||
I may learn my lesson. | ||
@y | ||
I may learn my lesson. | ||
@-k@> | ||
@z | ||
|
||
@x | ||
@*Index. | ||
@y | ||
@z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@$memcmp "<string.h>" \zip@> | ||
@$strcat "<string.h>" \zip@> | ||
@$strcmp "<string.h>" \zip@> | ||
@$strcpy "<string.h>" \zip@> | ||
@$strlen "<string.h>" \zip@> | ||
@$strncmp "<string.h>" \zip@> | ||
@$strncpy "<string.h>" \zip@> | ||
|
||
@$BUFSIZ "<stdio.h>" \zip@> | ||
@$fclose "<stdio.h>" \zip@> | ||
@$feof "<stdio.h>" \zip@> | ||
@$fflush "<stdio.h>" \zip@> | ||
@$fopen "<stdio.h>" \zip@> | ||
@$fprintf "<stdio.h>" \zip@> | ||
@$fputs "<stdio.h>" \zip@> | ||
@$fread "<stdio.h>" \zip@> | ||
@$fwrite "<stdio.h>" \zip@> | ||
@$printf "<stdio.h>" \zip@> | ||
@$putc "<stdio.h>" \zip@> | ||
@$putchar "<stdio.h>" \zip@> | ||
@$puts "<stdio.h>" \zip@> | ||
@$rename "<stdio.h>" \zip@> | ||
@$remove "<stdio.h>" \zip@> | ||
@$sprintf "<stdio.h>" \zip@> | ||
@$sscanf "<stdio.h>" \zip@> | ||
@$stdout "<stdio.h>" \zip@> | ||
@$stderr "<stdio.h>" \zip@> | ||
|
||
@$exit "<stdlib.h>" \zip@> | ||
|
||
@$isalpha "<ctype.h>" \zip@> | ||
@$isdigit "<ctype.h>" \zip@> | ||
@$islower "<ctype.h>" \zip@> | ||
@$isspace "<ctype.h>" \zip@> | ||
@$isupper "<ctype.h>" \zip@> | ||
@$isxdigit "<ctype.h>" \zip@> | ||
@$tolower "<ctype.h>" \zip@> | ||
@$toupper "<ctype.h>" \zip@> | ||
|
||
@$gettext "<libintl.h>" \zip@> | ||
@$textdomain "<libintl.h>" \zip@> |