From a9686a186e29b8a5fa35b899ec2896dddf50ecd2 Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Sat, 5 Nov 2022 23:44:52 +0000 Subject: [PATCH] Indexing support for IE-0004 --- README.md | 2 +- build.txt | 4 +- docs/index-module/2-iu.html | 2 +- docs/index-module/3-fe.html | 183 ++++++++++++++++-- docs/multimedia-module/2-ef.html | 14 +- docs/runtime-module/2-hrr.html | 8 +- docs/runtime-module/5-mlt.html | 6 +- inform7/Figures/memory-diagnostics.txt | 14 +- inform7/Figures/timings-diagnostics.txt | 62 +++--- .../BasicInformExtrasKit/kit_metadata.json | 2 +- .../Inter/BasicInformKit/kit_metadata.json | 2 +- .../Inter/CommandParserKit/kit_metadata.json | 2 +- .../EnglishLanguageKit/kit_metadata.json | 2 +- .../Inter/WorldModelKit/kit_metadata.json | 2 +- inform7/Internal/Languages/English/Index.txt | 4 + .../Chapter 2/External Files.w | 6 - inform7/runtime-module/Chapter 2/Hierarchy.w | 4 +- inform7/runtime-module/Chapter 5/Multimedia.w | 6 +- .../index-module/Chapter 3/Figures Element.w | 143 +++++++++++++- resources/Imagery/doc_images/data.png | Bin 0 -> 3794 bytes 20 files changed, 377 insertions(+), 91 deletions(-) create mode 100644 resources/Imagery/doc_images/data.png diff --git a/README.md b/README.md index a68062e6b..ab93bcd90 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Inform 7 -[Version](notes/versioning.md): 10.2.0-beta+6V93 'Krypton' (3 November 2022) +[Version](notes/versioning.md): 10.2.0-beta+6V94 'Krypton' (5 November 2022) ## About Inform diff --git a/build.txt b/build.txt index d16d2c8c0..f2e763039 100644 --- a/build.txt +++ b/build.txt @@ -1,3 +1,3 @@ Prerelease: beta -Build Date: 3 November 2022 -Build Number: 6V93 +Build Date: 5 November 2022 +Build Number: 6V94 diff --git a/docs/index-module/2-iu.html b/docs/index-module/2-iu.html index 978242d71..b4195806c 100644 --- a/docs/index-module/2-iu.html +++ b/docs/index-module/2-iu.html @@ -141,7 +141,7 @@ the source text in the application. IndexUtilities::link_to_location(OUT, Lexer::word_location(wn), TRUE); } -void IndexUtilities::link_package(OUTPUT_STREAM, inter_package *pack) { +void IndexUtilities::link_package(OUTPUT_STREAM, inter_package *pack) { int at = (int) Metadata::read_optional_numeric(pack, I"^at"); if (at > 0) IndexUtilities::link(OUT, at); } diff --git a/docs/index-module/3-fe.html b/docs/index-module/3-fe.html index 2a3354c20..2def67f57 100644 --- a/docs/index-module/3-fe.html +++ b/docs/index-module/3-fe.html @@ -59,7 +59,7 @@ function togglePopup(material_id) {

To write the Figures element (Fi) in the index.

-
+

§1. Not only figures but also sounds and external files, a little questionably.

@@ -74,7 +74,8 @@ function togglePopup(material_id) { InterNodeList::array_sort(inv->file_nodes, MakeSynopticModuleStage::module_order); Index the figures1.1; Index the sounds1.2; - Index the files1.3; + Index the internal files1.3; + Index the files1.4; }

§1.1. Figures. Index the figures1.1 = @@ -203,11 +204,11 @@ to match this width, preserving the aspect ratio.

+    HTML_OPEN("p");
+    Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfSounds");
+    HTML_CLOSE("p");
     if (InterNodeList::array_len(inv->sound_nodes) == 0) {
         HTML_OPEN("p");
-        Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfSounds");
-        HTML_CLOSE("p");
-        HTML_OPEN("p");
         Localisation::roman(OUT, LD, I"Index.Elements.Fi.NoSounds");
         HTML_CLOSE("p");
     } else {
@@ -366,26 +367,180 @@ to match this width, preserving the aspect ratio.
     HTML::end_html_row(OUT);
 
-

§1.3. Files. This is more or less perfunctory, but still of some use, if only as a list. -

+

§1.3. Internal files.

-

Index the files1.3 = +

define EXTERNAL_TEXT_FILE_NFSMF 0
+define EXTERNAL_BINARY_FILE_NFSMF 1
+define INTERNAL_TEXT_FILE_NFSMF 2
+define INTERNAL_BINARY_FILE_NFSMF 3
+define INTERNAL_FORM_FILE_NFSMF 4
+
+

Index the internal files1.3 =

+    HTML_OPEN("p");
+    Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfInternalFiles");
+    HTML_CLOSE("p");
+    if (InterNodeList::array_len(inv->internal_file_nodes) == 0) {
+        HTML_OPEN("p");
+        Localisation::roman(OUT, LD, I"Index.Elements.Fi.NoInternalFiles");
+        HTML_CLOSE("p");
+    } else {
+        Tabulate the internal files1.3.1;
+    }
+
+ +

§1.3.1. Tabulate the internal files1.3.1 = +

+ +
+    HTML::begin_html_table(OUT, NULL, TRUE, 0, 0, 0, 0, 0);
+    inter_package *pack;
+    LOOP_OVER_INVENTORY_PACKAGES(pack, i, inv->internal_file_nodes) {
+        inter_ti id = Metadata::read_numeric(pack, I"^resource_id");
+        text_stream *filename_as_text = Metadata::required_textual(pack, I"^filename");
+        filename *F = Filenames::from_text(filename_as_text);
+        inter_ti format = Metadata::read_numeric(pack, I"^internal_file_format");
+        TEMPORARY_TEXT(description)
+        TEMPORARY_TEXT(preview)
+        Find internal file preview1.3.1.1;
+        Render a table row for the internal file1.3.1.2;
+        DISCARD_TEXT(description)
+        DISCARD_TEXT(preview)
+    }
+    HTML::end_html_table(OUT);
+
+ +

§1.3.1.1. Find internal file preview1.3.1.1 = +

+ +
+    FILE *INTERNAL_FILE = Filenames::fopen(F, "rb");
+    if (INTERNAL_FILE) {
+        switch (format) {
+            case INTERNAL_TEXT_FILE_NFSMF:
+                WRITE_TO(description, "%S", filename_as_text);
+                Offer a textual preview1.3.1.1.1;
+                break;
+            case INTERNAL_BINARY_FILE_NFSMF:
+                WRITE_TO(description, "%S", filename_as_text);
+                Offer a binary preview1.3.1.1.2;
+                break;
+            case INTERNAL_FORM_FILE_NFSMF:
+                WRITE_TO(description, "%S", filename_as_text);
+                Offer a binary preview1.3.1.1.2;
+                break;
+        }
+    } else {
+        Localisation::italic(description, LD, I"Index.Elements.Fi.MissingInternalFile");
+    }
+
+ +

§1.3.1.1.1. Offer a textual preview1.3.1.1.1 = +

+ +
+    for (int row = 0; row < 6; ) {
+        int col = 0;
+        unsigned int B, line_ended = FALSE;
+        while (BinaryFiles::read_int8(INTERNAL_FILE, &B)) {
+            if ((B == 10) || (B == 13)) { line_ended = TRUE; break; }
+            if (col++ >= 80) { WRITE_TO(preview, "[...]"); line_ended = TRUE; break; }
+            if ((B >= 0x20) && (B <= 0x7E)) WRITE_TO(preview, "%c", B);
+            else WRITE_TO(preview, "?");
+        }
+        if (line_ended == FALSE) break;
+        if (col > 0) row++;
+        WRITE_TO(preview, "\n");
+    }
+
+ +

§1.3.1.1.2. Offer a binary preview1.3.1.1.2 = +

+ +
+    for (int row = 0; row < 6; row++) {
+        unsigned int bytes[16];
+        for (int col = 0; col < 16; col++) {
+            if (!BinaryFiles::read_int8(INTERNAL_FILE, &(bytes[col]))) {
+                for (; col < 16; col++) bytes[col] = 256;
+                row = 6; break;
+            }
+        }
+        for (int col = 0; col < 16; col++) {
+            if (bytes[col] < 256) WRITE_TO(preview, "%02x ", bytes[col]);
+            else WRITE_TO(preview, ".. ");
+        }
+        for (int col = 0; col < 16; col++) {
+            if ((bytes[col] >= 0x20) && (bytes[col] <= 0x7E)) WRITE_TO(preview, "%c", bytes[col]);
+            else WRITE_TO(preview, ".");
+        }
+        WRITE_TO(preview, "\n");
+    }
+
+ +

§1.3.1.2. Render a table row for the internal file1.3.1.2 = +

+ +
+    HTML::first_html_column(OUT, THUMBNAIL_WIDTH+10);
+    if (Str::len(description) == 0) {
+        HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/image_problem.png\"");
+    } else {
+        HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/data.png\"");
+    }
+    WRITE("&nbsp;");
+    HTML::next_html_column(OUT, 0);
+    HTML_OPEN_WITH("p", "class=\"hang\"");
+    switch (format) {
+        case INTERNAL_TEXT_FILE_NFSMF:   WRITE("(text) "); break;
+        case INTERNAL_BINARY_FILE_NFSMF: WRITE("(binary) "); break;
+        case INTERNAL_FORM_FILE_NFSMF:   WRITE("(form) "); break;
+    }
+    WRITE("%S", Metadata::required_textual(pack, I"^name"));
+    IndexUtilities::link_package(OUT, pack);
+    if (Str::len(description) > 0) {
+        HTML_TAG("br");
+        WRITE("%S", description);
+    }
+    HTML_CLOSE("p");
+    if (Str::len(preview) > 0) {
+        HTML_OPEN("pre");
+        int N = Streams::get_indentation(OUT);
+        Streams::set_indentation(OUT, 0);
+        WRITE("\n%S", preview);
+        Streams::set_indentation(OUT, N);
+        HTML_CLOSE("pre");
+        WRITE("\n");
+    }
+    HTML_OPEN("p");
+    Localisation::roman_ti(description, LD, I"Index.Elements.Fi.Resource",
+        Filenames::get_leafname(F), (int) id);
+    HTML_CLOSE("p");
+    HTML::end_html_row(OUT);
+
+ +

§1.4. Files. This is more or less perfunctory, but still of some use, if only as a list. +

+ +

Index the files1.4 = +

+ +
+    HTML_OPEN("p");
+    Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfFiles");
+    HTML_CLOSE("p");
     if (InterNodeList::array_len(inv->file_nodes) == 0) {
         HTML_OPEN("p");
         Localisation::roman(OUT, LD, I"Index.Elements.Fi.NoFiles");
         HTML_CLOSE("p");
     } else {
-        HTML_OPEN("p");
-        Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfFiles");
-        HTML_CLOSE("p");
-        Tabulate the files1.3.1;
+        Tabulate the files1.4.1;
     }
 
-

§1.3.1. Tabulate the files1.3.1 = +

§1.4.1. Tabulate the files1.4.1 =

@@ -423,7 +578,7 @@ to match this width, preserving the aspect ratio.
     }
     HTML::end_html_table(OUT);
 
- + diff --git a/docs/multimedia-module/2-ef.html b/docs/multimedia-module/2-ef.html index e1332fdf6..26c1f46d9 100644 --- a/docs/multimedia-module/2-ef.html +++ b/docs/multimedia-module/2-ef.html @@ -120,12 +120,6 @@ function togglePopup(material_id) {

§3. And this is the Preform grammar needed for the subject phrase:

-
define EXTERNAL_TEXT_FILE_NFSMF 0
-define EXTERNAL_BINARY_FILE_NFSMF 1
-define INTERNAL_TEXT_FILE_NFSMF 2
-define INTERNAL_BINARY_FILE_NFSMF 3
-define INTERNAL_FORM_FILE_NFSMF 4
-
 <external-file-sentence-subject> ::=
     <definite-article> <external-file-sentence-subject> |  ==> { pass 2 }
@@ -214,7 +208,7 @@ has been found to create a file:
     switch (format) {
         case EXTERNAL_TEXT_FILE_NFSMF:
         case EXTERNAL_BINARY_FILE_NFSMF: {
-            if (format == EXTERNAL_BINARY_FILE_NFSMF) binary = TRUE;
+            if (format == EXTERNAL_BINARY_FILE_NFSMF) binary = TRUE;
             TEMPORARY_TEXT(ifid_of_file)
             Determine the ownership5.2;
             ExternalFiles::files_create(W, binary, ownership, ifid_of_file, FN);
@@ -247,9 +241,9 @@ has been found to create a file:
         }
         if (i>24) bad_filename = TRUE;
         if ((isalpha(p[i])) || (Characters::isdigit(p[i]))) continue;
-        if ((format == INTERNAL_TEXT_FILE_NFSMF) ||
-            (format == INTERNAL_BINARY_FILE_NFSMF) ||
-            (format == INTERNAL_FORM_FILE_NFSMF))
+        if ((format == INTERNAL_TEXT_FILE_NFSMF) ||
+            (format == INTERNAL_BINARY_FILE_NFSMF) ||
+            (format == INTERNAL_FORM_FILE_NFSMF))
             if ((p[i] == '.') || (p[i] == '_') || (p[i] == ' ')) continue;
         LOG("Objected to character %c\n", p[i]);
         bad_filename = TRUE;
diff --git a/docs/runtime-module/2-hrr.html b/docs/runtime-module/2-hrr.html
index 4b10deaba..7f245577f 100644
--- a/docs/runtime-module/2-hrr.html
+++ b/docs/runtime-module/2-hrr.html
@@ -1021,6 +1021,7 @@ and The Standard Kits (
 enum INSTANCE_IS_INF_MD_HL
 enum INSTANCE_FILE_VALUE_MD_HL
 enum INSTANCE_INTERNAL_FILE_FORMAT_MD_HL
+enum INSTANCE_INTERNAL_FILE_ID_MD_HL
 enum INSTANCE_FILE_IS_BINARY_MD_HL
 enum INSTANCE_FILE_OWNED_MD_HL
 enum INSTANCE_FILE_OWNED_BY_OTHER_MD_HL
@@ -1164,8 +1165,9 @@ and The Standard Kits (
             H_C_U(INSTANCE_FILE_OWNED_BY_OTHER_MD_HL,       I"^file_owned_by_other")
             H_C_U(INSTANCE_FILE_OWNER_MD_HL,                I"^file_owner")
             H_C_U(INSTANCE_INTERNAL_FILE_FORMAT_MD_HL,      I"^internal_file_format")
+            H_C_U(INSTANCE_INTERNAL_FILE_ID_MD_HL,          I"^resource_id")
             H_C_U(INSTANCE_FILE_IS_BINARY_MD_HL,            I"^is_binary")
-            H_C_U(INSTANCE_LEAFNAME_MD_HL,                  I"^leafname")
+            H_C_U(INSTANCE_LEAFNAME_MD_HL,                  I"^filename")
             H_C_U(INSTANCE_IS_FIGURE_MD_HL,                 I"^is_figure")
             H_C_U(INSTANCE_FIGURE_FILENAME_MD_HL,           I"^filename")
             H_C_U(INSTANCE_FIGURE_ID_MD_HL,                 I"^resource_id")
@@ -2559,14 +2561,14 @@ point system, and for those:
     DISCARD_TEXT(ANT)
 }
 
-void Hierarchy::apply_metadata_from_raw_wording(package_request *P, int id, wording W) {
+void Hierarchy::apply_metadata_from_raw_wording(package_request *P, int id, wording W) {
     TEMPORARY_TEXT(ANT)
     WRITE_TO(ANT, "%+W", W);
     Hierarchy::apply_metadata(P, id, ANT);
     DISCARD_TEXT(ANT)
 }
 
-void Hierarchy::apply_metadata_from_filename(package_request *P, int id, filename *F) {
+void Hierarchy::apply_metadata_from_filename(package_request *P, int id, filename *F) {
     TEMPORARY_TEXT(as_text)
     WRITE_TO(as_text, "%f", F);
     Hierarchy::apply_metadata(P, id, as_text);
diff --git a/docs/runtime-module/5-mlt.html b/docs/runtime-module/5-mlt.html
index 1591e0437..5c2239cdc 100644
--- a/docs/runtime-module/5-mlt.html
+++ b/docs/runtime-module/5-mlt.html
@@ -204,10 +204,12 @@ function togglePopup(material_id) {
 
     package_request *pack = RTInstances::package(inf->as_instance);
     Hierarchy::apply_metadata_from_iname(pack, INSTANCE_FILE_VALUE_MD_HL, inf_iname);
-    Hierarchy::apply_metadata_from_raw_wording(pack, INSTANCE_LEAFNAME_MD_HL,
-        Wordings::one_word(inf->unextended_filename));
+    Hierarchy::apply_metadata_from_filename(pack, INSTANCE_LEAFNAME_MD_HL,
+        inf->local_filename);
     Hierarchy::apply_metadata_from_number(pack, INSTANCE_INTERNAL_FILE_FORMAT_MD_HL,
         (inter_ti) inf->file_format);
+    Hierarchy::apply_metadata_from_number(pack, INSTANCE_INTERNAL_FILE_ID_MD_HL,
+        (inter_ti) inf->resource_id);
 

§3.2. Make the internal file metadata array3.2 = diff --git a/inform7/Figures/memory-diagnostics.txt b/inform7/Figures/memory-diagnostics.txt index a45c6cb06..b6ab410c8 100644 --- a/inform7/Figures/memory-diagnostics.txt +++ b/inform7/Figures/memory-diagnostics.txt @@ -1,9 +1,9 @@ -Total memory consumption was 123398K = 121 MB +Total memory consumption was 123401K = 121 MB - ---- was used for 2055375 objects, in 366318 frames in 0 x 800K = 0K = 0 MB: + ---- was used for 2055476 objects, in 366320 frames in 0 x 800K = 0K = 0 MB: 33.0% inter_tree_node_array 58 x 8192 = 475136 objects, 41813824 bytes - 20.6% text_stream_array 4637 x 100 = 463700 objects, 26115584 bytes + 20.6% text_stream_array 4638 x 100 = 463800 objects, 26121216 bytes 19.5% linked_list 44083 objects, 24686480 bytes 11.2% inter_symbol_array 133 x 1024 = 136192 objects, 14168224 bytes 10.4% inter_error_stash_array 101 x 1024 = 103424 objects, 13241504 bytes @@ -44,7 +44,7 @@ Total memory consumption was 123398K = 121 MB 0.2% inter_annotation_array 2 x 8192 = 16384 objects, 262208 bytes 0.1% vanilla_function 3703 objects, 236992 bytes 0.1% binary_predicate 326 objects, 172128 bytes - 0.1% hierarchy_location 1171 objects, 168624 bytes + 0.1% hierarchy_location 1172 objects, 168768 bytes 0.1% linguistic_stock_item 3329 objects, 159792 bytes 0.1% rule_family_data 401 objects, 147568 bytes 0.1% nonterminal 773 objects, 142232 bytes @@ -56,7 +56,7 @@ Total memory consumption was 123398K = 121 MB ---- anl_entry_array 2 x 1000 = 2000 objects, 96064 bytes ---- preposition 274 objects, 87680 bytes ---- inter_schema 1524 objects, 85344 bytes - ---- inter_tree 6 objects, 81696 bytes + ---- inter_tree 6 objects, 81744 bytes ---- lexical_cluster 2526 objects, 80832 bytes ---- pcalc_term_array 2 x 1000 = 2000 objects, 80064 bytes ---- kind_variable_declaration 1655 objects, 79440 bytes @@ -247,7 +247,7 @@ Total memory consumption was 123398K = 121 MB 100.0% was used for memory not allocated for objects: - 57.6% text stream storage 72805768 bytes in 481244 claims + 57.6% text stream storage 72808420 bytes in 481254 claims 4.2% dictionary storage 5311488 bytes in 7618 claims ---- sorting 1568 bytes in 159 claims 5.6% source text 7200000 bytes in 3 claims @@ -265,5 +265,5 @@ Total memory consumption was 123398K = 121 MB ---- code generation workspace for objects 3480 bytes in 19 claims 0.2% emitter array storage 280544 bytes in 2001 claims --147.-7% was overhead - -186754840 bytes = -182377K = -178 MB +-147.-7% was overhead - -186760664 bytes = -182383K = -178 MB diff --git a/inform7/Figures/timings-diagnostics.txt b/inform7/Figures/timings-diagnostics.txt index 8ed7f8c6e..03010d281 100644 --- a/inform7/Figures/timings-diagnostics.txt +++ b/inform7/Figures/timings-diagnostics.txt @@ -1,33 +1,33 @@ 100.0% in inform7 run - 70.9% in compilation to Inter - 49.6% in //Sequence::undertake_queued_tasks// - 4.8% in //MajorNodes::pre_pass// + 71.3% in compilation to Inter + 50.7% in //Sequence::undertake_queued_tasks// + 5.0% in //MajorNodes::pre_pass// 3.4% in //MajorNodes::pass_1// - 2.0% in //RTPhrasebook::compile_entries// - 1.8% in //ImperativeDefinitions::assess_all// - 1.4% in //RTKindConstructors::compile// - 1.2% in //Sequence::lint_inter// - 0.6% in //MajorNodes::pass_2// - 0.6% in //Sequence::undertake_queued_tasks// - 0.6% in //World::stage_V// - 0.4% in //ImperativeDefinitions::compile_first_block// - 0.4% in //Sequence::undertake_queued_tasks// - 0.2% in //CompletionModule::compile// - 0.2% in //InferenceSubjects::emit_all// - 0.2% in //RTKindConstructors::compile_permissions// - 0.2% in //Task::make_built_in_kind_constructors// - 0.2% in //World::stages_II_and_III// - 2.8% not specifically accounted for - 25.9% in running Inter pipeline - 9.9% in step 14/15: generate inform6 -> auto.inf - 5.6% in step 5/15: load-binary-kits - 5.4% in step 6/15: make-synoptic-module - 1.8% in step 9/15: make-identifiers-unique - 0.4% in step 12/15: eliminate-redundant-operations - 0.4% in step 4/15: compile-splats - 0.4% in step 7/15: shorten-wiring - 0.2% in step 11/15: eliminate-redundant-labels - 0.2% in step 8/15: detect-indirect-calls - 1.4% not specifically accounted for - 2.6% in supervisor - 0.5% not specifically accounted for + 1.9% in //RTPhrasebook::compile_entries// + 1.7% in //ImperativeDefinitions::assess_all// + 1.5% in //RTKindConstructors::compile// + 0.9% in //Sequence::lint_inter// + 0.5% in //MajorNodes::pass_2// + 0.5% in //Sequence::undertake_queued_tasks// + 0.5% in //Sequence::undertake_queued_tasks// + 0.5% in //World::stage_V// + 0.3% in //ImperativeDefinitions::compile_first_block// + 0.1% in //CompletionModule::compile// + 0.1% in //InferenceSubjects::emit_all// + 0.1% in //RTKindConstructors::compile_permissions// + 0.1% in //Task::make_built_in_kind_constructors// + 0.1% in //World::stages_II_and_III// + 2.3% not specifically accounted for + 25.5% in running Inter pipeline + 10.1% in step 14/15: generate inform6 -> auto.inf + 5.5% in step 5/15: load-binary-kits + 5.1% in step 6/15: make-synoptic-module + 1.7% in step 9/15: make-identifiers-unique + 0.3% in step 12/15: eliminate-redundant-operations + 0.3% in step 4/15: compile-splats + 0.3% in step 7/15: shorten-wiring + 0.3% in step 8/15: detect-indirect-calls + 0.1% in step 11/15: eliminate-redundant-labels + 1.1% not specifically accounted for + 2.5% in supervisor + 0.6% not specifically accounted for diff --git a/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json b/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json index badb00ecd..a5a448489 100644 --- a/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json +++ b/inform7/Internal/Inter/BasicInformExtrasKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "BasicInformExtrasKit", - "version": "10.2.0-beta+6V93" + "version": "10.2.0-beta+6V94" }, "kit-details": { "has-priority": 1 diff --git a/inform7/Internal/Inter/BasicInformKit/kit_metadata.json b/inform7/Internal/Inter/BasicInformKit/kit_metadata.json index 6d20b9768..d76dc9972 100644 --- a/inform7/Internal/Inter/BasicInformKit/kit_metadata.json +++ b/inform7/Internal/Inter/BasicInformKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "BasicInformKit", - "version": "10.2.0-beta+6V93" + "version": "10.2.0-beta+6V94" }, "needs": [ { "unless": { diff --git a/inform7/Internal/Inter/CommandParserKit/kit_metadata.json b/inform7/Internal/Inter/CommandParserKit/kit_metadata.json index c4e481152..6a7a22372 100644 --- a/inform7/Internal/Inter/CommandParserKit/kit_metadata.json +++ b/inform7/Internal/Inter/CommandParserKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "CommandParserKit", - "version": "10.2.0-beta+6V93" + "version": "10.2.0-beta+6V94" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json b/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json index abf32de91..feff86afb 100644 --- a/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json +++ b/inform7/Internal/Inter/EnglishLanguageKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "EnglishLanguageKit", - "version": "10.2.0-beta+6V93" + "version": "10.2.0-beta+6V94" }, "needs": [ { "need": { diff --git a/inform7/Internal/Inter/WorldModelKit/kit_metadata.json b/inform7/Internal/Inter/WorldModelKit/kit_metadata.json index 45cf5ab29..39d0a4f77 100644 --- a/inform7/Internal/Inter/WorldModelKit/kit_metadata.json +++ b/inform7/Internal/Inter/WorldModelKit/kit_metadata.json @@ -2,7 +2,7 @@ "is": { "type": "kit", "title": "WorldModelKit", - "version": "10.2.0-beta+6V93" + "version": "10.2.0-beta+6V94" }, "needs": [ { "need": { diff --git a/inform7/Internal/Languages/English/Index.txt b/inform7/Internal/Languages/English/Index.txt index 6c5327ae3..666d57598 100644 --- a/inform7/Internal/Languages/English/Index.txt +++ b/inform7/Internal/Languages/English/Index.txt @@ -47,8 +47,10 @@ %Index.Elements.Fi.NoFigures = There are no figures, or illustrations, in this project. %Index.Elements.Fi.NoSounds = There are no sound effects in this project. %Index.Elements.Fi.NoFiles = This project doesn't read or write external files. +%Index.Elements.Fi.NoInternalFiles = This project doesn't read internal files. %Index.Elements.Fi.ListOfFigures = List of Figures %Index.Elements.Fi.ListOfSounds = List of Sounds +%Index.Elements.Fi.ListOfInternalFiles = List of Internal Files %Index.Elements.Fi.ListOfFiles = List of External Files %Index.Elements.Fi.Format = Format *1 @@ -71,6 +73,8 @@ %Index.Elements.Fi.Stereo = Stereo %Index.Elements.Fi.BitRate = *1 kilobits/sec +%Index.Elements.Fi.MissingInternalFile = Missing from the Data folder + %Index.Elements.Fi.BinaryFile = Binary file "*1" %Index.Elements.Fi.TextFile = File "*1" %Index.Elements.Fi.FileOwnedByThis = owned by this project diff --git a/inform7/multimedia-module/Chapter 2/External Files.w b/inform7/multimedia-module/Chapter 2/External Files.w index cc2709511..3b1b67840 100644 --- a/inform7/multimedia-module/Chapter 2/External Files.w +++ b/inform7/multimedia-module/Chapter 2/External Files.w @@ -56,12 +56,6 @@ int ExternalFiles::new_file_SMF(int task, parse_node *V, wording *NPs) { @ And this is the Preform grammar needed for the subject phrase: -@d EXTERNAL_TEXT_FILE_NFSMF 0 -@d EXTERNAL_BINARY_FILE_NFSMF 1 -@d INTERNAL_TEXT_FILE_NFSMF 2 -@d INTERNAL_BINARY_FILE_NFSMF 3 -@d INTERNAL_FORM_FILE_NFSMF 4 - = ::= | ==> { pass 2 } diff --git a/inform7/runtime-module/Chapter 2/Hierarchy.w b/inform7/runtime-module/Chapter 2/Hierarchy.w index fce43211a..b5b54abee 100644 --- a/inform7/runtime-module/Chapter 2/Hierarchy.w +++ b/inform7/runtime-module/Chapter 2/Hierarchy.w @@ -900,6 +900,7 @@ void Hierarchy::establish(void) { @e INSTANCE_IS_INF_MD_HL @e INSTANCE_FILE_VALUE_MD_HL @e INSTANCE_INTERNAL_FILE_FORMAT_MD_HL +@e INSTANCE_INTERNAL_FILE_ID_MD_HL @e INSTANCE_FILE_IS_BINARY_MD_HL @e INSTANCE_FILE_OWNED_MD_HL @e INSTANCE_FILE_OWNED_BY_OTHER_MD_HL @@ -1040,8 +1041,9 @@ void Hierarchy::establish(void) { H_C_U(INSTANCE_FILE_OWNED_BY_OTHER_MD_HL, I"^file_owned_by_other") H_C_U(INSTANCE_FILE_OWNER_MD_HL, I"^file_owner") H_C_U(INSTANCE_INTERNAL_FILE_FORMAT_MD_HL, I"^internal_file_format") + H_C_U(INSTANCE_INTERNAL_FILE_ID_MD_HL, I"^resource_id") H_C_U(INSTANCE_FILE_IS_BINARY_MD_HL, I"^is_binary") - H_C_U(INSTANCE_LEAFNAME_MD_HL, I"^leafname") + H_C_U(INSTANCE_LEAFNAME_MD_HL, I"^filename") H_C_U(INSTANCE_IS_FIGURE_MD_HL, I"^is_figure") H_C_U(INSTANCE_FIGURE_FILENAME_MD_HL, I"^filename") H_C_U(INSTANCE_FIGURE_ID_MD_HL, I"^resource_id") diff --git a/inform7/runtime-module/Chapter 5/Multimedia.w b/inform7/runtime-module/Chapter 5/Multimedia.w index 77936db34..b8fb5909a 100644 --- a/inform7/runtime-module/Chapter 5/Multimedia.w +++ b/inform7/runtime-module/Chapter 5/Multimedia.w @@ -130,10 +130,12 @@ void RTMultimedia::internal_compilation_agent(compilation_subtask *t) { @ = package_request *pack = RTInstances::package(inf->as_instance); Hierarchy::apply_metadata_from_iname(pack, INSTANCE_FILE_VALUE_MD_HL, inf_iname); - Hierarchy::apply_metadata_from_raw_wording(pack, INSTANCE_LEAFNAME_MD_HL, - Wordings::one_word(inf->unextended_filename)); + Hierarchy::apply_metadata_from_filename(pack, INSTANCE_LEAFNAME_MD_HL, + inf->local_filename); Hierarchy::apply_metadata_from_number(pack, INSTANCE_INTERNAL_FILE_FORMAT_MD_HL, (inter_ti) inf->file_format); + Hierarchy::apply_metadata_from_number(pack, INSTANCE_INTERNAL_FILE_ID_MD_HL, + (inter_ti) inf->resource_id); @ = packaging_state save = EmitArrays::begin_word(inf_iname, K_value); diff --git a/inter/index-module/Chapter 3/Figures Element.w b/inter/index-module/Chapter 3/Figures Element.w index c22fc9992..bdafcbdbb 100644 --- a/inter/index-module/Chapter 3/Figures Element.w +++ b/inter/index-module/Chapter 3/Figures Element.w @@ -14,6 +14,7 @@ void FiguresElement::render(OUTPUT_STREAM, index_session *session) { InterNodeList::array_sort(inv->file_nodes, MakeSynopticModuleStage::module_order); @; @; + @; @; } @@ -128,10 +129,10 @@ to match this width, preserving the aspect ratio. @h Sounds. @ = + HTML_OPEN("p"); + Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfSounds"); + HTML_CLOSE("p"); if (InterNodeList::array_len(inv->sound_nodes) == 0) { - HTML_OPEN("p"); - Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfSounds"); - HTML_CLOSE("p"); HTML_OPEN("p"); Localisation::roman(OUT, LD, I"Index.Elements.Fi.NoSounds"); HTML_CLOSE("p"); @@ -270,18 +271,148 @@ to match this width, preserving the aspect ratio. Filenames::get_leafname(F), (int) id); HTML::end_html_row(OUT); +@h Internal files. + +@d EXTERNAL_TEXT_FILE_NFSMF 0 +@d EXTERNAL_BINARY_FILE_NFSMF 1 +@d INTERNAL_TEXT_FILE_NFSMF 2 +@d INTERNAL_BINARY_FILE_NFSMF 3 +@d INTERNAL_FORM_FILE_NFSMF 4 + +@ = + HTML_OPEN("p"); + Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfInternalFiles"); + HTML_CLOSE("p"); + if (InterNodeList::array_len(inv->internal_file_nodes) == 0) { + HTML_OPEN("p"); + Localisation::roman(OUT, LD, I"Index.Elements.Fi.NoInternalFiles"); + HTML_CLOSE("p"); + } else { + @; + } + +@ = + HTML::begin_html_table(OUT, NULL, TRUE, 0, 0, 0, 0, 0); + inter_package *pack; + LOOP_OVER_INVENTORY_PACKAGES(pack, i, inv->internal_file_nodes) { + inter_ti id = Metadata::read_numeric(pack, I"^resource_id"); + text_stream *filename_as_text = Metadata::required_textual(pack, I"^filename"); + filename *F = Filenames::from_text(filename_as_text); + inter_ti format = Metadata::read_numeric(pack, I"^internal_file_format"); + TEMPORARY_TEXT(description) + TEMPORARY_TEXT(preview) + @; + @; + DISCARD_TEXT(description) + DISCARD_TEXT(preview) + } + HTML::end_html_table(OUT); + +@ = + FILE *INTERNAL_FILE = Filenames::fopen(F, "rb"); + if (INTERNAL_FILE) { + switch (format) { + case INTERNAL_TEXT_FILE_NFSMF: + WRITE_TO(description, "%S", filename_as_text); + @; + break; + case INTERNAL_BINARY_FILE_NFSMF: + WRITE_TO(description, "%S", filename_as_text); + @; + break; + case INTERNAL_FORM_FILE_NFSMF: + WRITE_TO(description, "%S", filename_as_text); + @; + break; + } + } else { + Localisation::italic(description, LD, I"Index.Elements.Fi.MissingInternalFile"); + } + +@ = + for (int row = 0; row < 6; ) { + int col = 0; + unsigned int B, line_ended = FALSE; + while (BinaryFiles::read_int8(INTERNAL_FILE, &B)) { + if ((B == 10) || (B == 13)) { line_ended = TRUE; break; } + if (col++ >= 80) { WRITE_TO(preview, "[...]"); line_ended = TRUE; break; } + if ((B >= 0x20) && (B <= 0x7E)) WRITE_TO(preview, "%c", B); + else WRITE_TO(preview, "?"); + } + if (line_ended == FALSE) break; + if (col > 0) row++; + WRITE_TO(preview, "\n"); + } + +@ = + for (int row = 0; row < 6; row++) { + unsigned int bytes[16]; + for (int col = 0; col < 16; col++) { + if (!BinaryFiles::read_int8(INTERNAL_FILE, &(bytes[col]))) { + for (; col < 16; col++) bytes[col] = 256; + row = 6; break; + } + } + for (int col = 0; col < 16; col++) { + if (bytes[col] < 256) WRITE_TO(preview, "%02x ", bytes[col]); + else WRITE_TO(preview, ".. "); + } + for (int col = 0; col < 16; col++) { + if ((bytes[col] >= 0x20) && (bytes[col] <= 0x7E)) WRITE_TO(preview, "%c", bytes[col]); + else WRITE_TO(preview, "."); + } + WRITE_TO(preview, "\n"); + } + +@ = + HTML::first_html_column(OUT, THUMBNAIL_WIDTH+10); + if (Str::len(description) == 0) { + HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/image_problem.png\""); + } else { + HTML_TAG_WITH("img", "border=\"0\" src=\"inform:/doc_images/data.png\""); + } + WRITE(" "); + HTML::next_html_column(OUT, 0); + HTML_OPEN_WITH("p", "class=\"hang\""); + switch (format) { + case INTERNAL_TEXT_FILE_NFSMF: WRITE("(text) "); break; + case INTERNAL_BINARY_FILE_NFSMF: WRITE("(binary) "); break; + case INTERNAL_FORM_FILE_NFSMF: WRITE("(form) "); break; + } + WRITE("%S", Metadata::required_textual(pack, I"^name")); + IndexUtilities::link_package(OUT, pack); + if (Str::len(description) > 0) { + HTML_TAG("br"); + WRITE("%S", description); + } + HTML_CLOSE("p"); + if (Str::len(preview) > 0) { + HTML_OPEN("pre"); + int N = Streams::get_indentation(OUT); + Streams::set_indentation(OUT, 0); + WRITE("\n%S", preview); + Streams::set_indentation(OUT, N); + HTML_CLOSE("pre"); + WRITE("\n"); + } + HTML_OPEN("p"); + Localisation::roman_ti(description, LD, I"Index.Elements.Fi.Resource", + Filenames::get_leafname(F), (int) id); + HTML_CLOSE("p"); + HTML::end_html_row(OUT); + @h Files. This is more or less perfunctory, but still of some use, if only as a list. @ = + HTML_OPEN("p"); + Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfFiles"); + HTML_CLOSE("p"); if (InterNodeList::array_len(inv->file_nodes) == 0) { HTML_OPEN("p"); Localisation::roman(OUT, LD, I"Index.Elements.Fi.NoFiles"); HTML_CLOSE("p"); } else { - HTML_OPEN("p"); - Localisation::bold(OUT, LD, I"Index.Elements.Fi.ListOfFiles"); - HTML_CLOSE("p"); @; } diff --git a/resources/Imagery/doc_images/data.png b/resources/Imagery/doc_images/data.png new file mode 100644 index 0000000000000000000000000000000000000000..9bec3889989a1594aa5051926ff2c09be26480c5 GIT binary patch literal 3794 zcmV;@4lVJCP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHY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