Paving the way for 7.2.0 release

This commit is contained in:
Graham Nelson 2022-08-20 10:43:06 +01:00
parent cccbbd61dd
commit 79311e5cb2
14 changed files with 183 additions and 94 deletions

View file

@ -5,7 +5,7 @@ Language: InC
Web Syntax Version: 2
Licence: This is a free, open-source program published under the Artistic License 2.0.
Version Name: Escape to Danger
Version Number: 7.1.0
Version Number: 7.1.1
Import: foundation

View file

@ -1,6 +1,6 @@
# Inweb 7.1.0
# Inweb 7.1.1
v7.1.0-beta+1B14 'Escape to Danger' (9 August 2022)
[Version](notes/versioning.md): 7.1.1-beta+1B15 'Escape to Danger' (20 August 2022)
## About Inweb
@ -36,24 +36,27 @@ This is in order that there can be clear ownership.
## Build Instructions
**Caution**: The `main` branch of this repository generally holds "unstable", that is,
unreleased work-in-progress versions of Inform. See [notes/versioning.md](notes/versioning.md).
Inweb is intentionally self-sufficient, with no dependencies on any other
software beyond a modern C compiler. However, it does in a sense depend on
itself: because Inweb is itself a web, you need Inweb to compile Inweb.
Getting around that circularity means that the initial setup takes a few steps.
Make a directory in which to work: let's call this "work". Then:
Make a directory in which to work: let's call this `work`. Then:
* Change the current directory to this: "cd work"
* Clone Inweb: "git clone https://github.com/ganelson/inweb.git"
* Change the current directory to this: `cd work`
* Clone Inweb: `git clone https://github.com/ganelson/inweb.git`
* Run **one of the following commands**.
* "bash inweb/scripts/first.sh linux"
* "bash inweb/scripts/first.sh macos"
* "bash inweb/scripts/first.sh macos32"
* "bash inweb/scripts/first.sh macosarm"
* "bash inweb/scripts/first.sh macosuniv"
* "bash inweb/scripts/first.sh unix"
* "bash inweb/scripts/first.sh windows"
* Test that all is well: "inweb/Tangled/inweb -help"
* `bash inweb/scripts/first.sh linux`
* `bash inweb/scripts/first.sh macos`
* `bash inweb/scripts/first.sh macos32`
* `bash inweb/scripts/first.sh macosarm`
* `bash inweb/scripts/first.sh macosuniv`
* `bash inweb/scripts/first.sh unix`
* `bash inweb/scripts/first.sh windows`
* Test that all is well: `inweb/Tangled/inweb -help`
Some notes on which platform to choose:
* For Intel Macs running MacOS 10.13 ("High Sierra") or earlier, use macos32.
@ -71,13 +74,13 @@ has not yet an opportunity to contribute build settings.
You should now have a working copy of Inweb, with its own makefile tailored
to your platform now in place (at inweb/inweb.mk). To build inweb again, e.g.
after editing inweb's source code, do not run the shell script first.sh again.
Instead, you must use: "make -f inweb/inweb.mk"
Instead, you must use: `make -f inweb/inweb.mk`
If you wish to tweak the makefile, do not edit it directly. Instead,
edit inweb/scripts/inweb.mkscript and inweb/Materials/platforms/PLATFORM.mkscript,
where PLATFORM is your choice as above (e.g., 'macos'). Then run "make -f inweb/inweb.mk makers"
where PLATFORM is your choice as above (e.g., 'macos'). Then run `make -f inweb/inweb.mk makers`
to rebuild all these makefiles with your changes incorporated; and then run
the shell script "inweb/scripts/first.sh" again.
the shell script `inweb/scripts/first.sh` again.
A few features of inweb used when integrating the core Inform software into its
apps rely on having the standard Unix tool "rsync" installed: so on Linux, where
@ -137,7 +140,7 @@ A small executable for running unit tests against Foundation is also included:
## Testing Inweb
If you have also built Intest as "work/intest", then you can try these:
If you have also built Intest as `work/intest`, then you can try these:
* intest/Tangled/intest inweb all
* intest/Tangled/intest inweb/foundation-test all

View file

@ -193,14 +193,30 @@ int Platform__system(const char *cmd) {
or a Unix-like shell. */
int unix = Platform__Win32_is_unix_cmd(cmd);
if (unix) {
/* Some Cygwin commands cannot handle backslashes in paths. */
int forward_slash = 0;
if (strncmp(cmd,"pdftex ",7) == 0)
forward_slash = 1;
/* For a Unix shell command, escape any double quotes and backslashes. */
char *pcl;
const char *pc;
strcpy(cmd_line, "sh -c \"");
for (pc = cmd, pcl = cmd_line+strlen(cmd_line); *pc != 0; ++pc, ++pcl) {
if ((*pc == '\\') || (*pc == '\"'))
if (*pc == '\"') {
*(pcl++) = '\\';
*pcl = *pc;
*pcl = *pc;
}
else if (*pc == '\\') {
if (forward_slash)
*pcl = '/';
else {
*(pcl++) = '\\';
*pcl = *pc;
}
}
else
*pcl = *pc;
}
*(pcl++) = '\"';
*(pcl++) = 0;
@ -239,7 +255,7 @@ int Platform__system(const char *cmd) {
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 362 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 378 "inweb/foundation-module/Chapter 1/Windows Platform.w"
typedef HANDLE foundation_thread;
typedef int foundation_thread_attributes;
@ -247,7 +263,7 @@ struct Win32_Thread_Start { void *(*fn)(void *); void* arg; };
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 463 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 479 "inweb/foundation-module/Chapter 1/Windows Platform.w"
struct Win32_Mutex { INIT_ONCE init; CRITICAL_SECTION crit; };
#endif /* PLATFORM_WINDOWS */
@ -2690,75 +2706,75 @@ int Platform__is_folder_separator(wchar_t c) ;
void Platform__where_am_i(wchar_t *p, size_t length) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 173 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 189 "inweb/foundation-module/Chapter 1/Windows Platform.w"
int Platform__mkdir(char *transcoded_pathname) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 181 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 197 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void * Platform__opendir(char *dir_name) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 186 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 202 "inweb/foundation-module/Chapter 1/Windows Platform.w"
int Platform__readdir(void *D, char *dir_name, char *leafname) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 203 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 219 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__closedir(void *D) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 211 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 227 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__path_add(const char* base, const char* add, char* path) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 221 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 237 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__rsync(char *transcoded_source, char *transcoded_dest) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 300 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 316 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__sleep(int seconds) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 307 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 323 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__notification(text_stream *text, int happy) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 325 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 341 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__Win32_ResetConsole(void) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 334 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 350 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__configure_terminal(void) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 376 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 392 "inweb/foundation-module/Chapter 1/Windows Platform.w"
int Platform__create_thread(foundation_thread *pt, const foundation_thread_attributes *pa, void *(*fn)(void *), void *arg) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 391 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 407 "inweb/foundation-module/Chapter 1/Windows Platform.w"
int Platform__join_thread(foundation_thread pt, void** rv) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 395 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 411 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__init_thread(foundation_thread_attributes* pa, size_t size) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 398 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 414 "inweb/foundation-module/Chapter 1/Windows Platform.w"
size_t Platform__get_thread_stack_size(foundation_thread_attributes* pa) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 408 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 424 "inweb/foundation-module/Chapter 1/Windows Platform.w"
int Platform__get_core_count(void) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 429 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 445 "inweb/foundation-module/Chapter 1/Windows Platform.w"
time_t Platform__never_time(void) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 433 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 449 "inweb/foundation-module/Chapter 1/Windows Platform.w"
time_t Platform__timestamp(char *transcoded_filename) ;
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 439 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 455 "inweb/foundation-module/Chapter 1/Windows Platform.w"
off_t Platform__size(char *transcoded_filename) ;
#endif /* PLATFORM_WINDOWS */
#line 64 "inweb/foundation-module/Chapter 2/Debugging Log.w"
@ -6014,7 +6030,7 @@ void Platform__where_am_i(wchar_t *p, size_t length) {
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 173 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 189 "inweb/foundation-module/Chapter 1/Windows Platform.w"
int Platform__mkdir(char *transcoded_pathname) {
errno = 0;
int rv = mkdir(transcoded_pathname);
@ -6052,15 +6068,15 @@ void Platform__closedir(void *D) {
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 211 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 227 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__path_add(const char* base, const char* add, char* path) {
char last;
char last;
strcpy(path, base);
last = path[strlen(path) - 1];
if ((last != '/') && (last != '\\'))
strcat(path, "\\");
strcat(path, add);
strcpy(path, base);
last = path[strlen(path) - 1];
if ((last != '/') && (last != '\\'))
strcat(path, "\\");
strcat(path, add);
}
void Platform__rsync(char *transcoded_source, char *transcoded_dest) {
@ -6140,20 +6156,20 @@ void Platform__rsync(char *transcoded_source, char *transcoded_dest) {
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 300 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 316 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__sleep(int seconds) {
Sleep((DWORD)(1000*seconds));
}
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 307 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 323 "inweb/foundation-module/Chapter 1/Windows Platform.w"
void Platform__notification(text_stream *text, int happy) {
}
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 318 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 334 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#define WIN32CONS_RESET_MODE 1
#define WIN32CONS_RESET_OUTCP 2
@ -6197,7 +6213,7 @@ void Platform__configure_terminal(void) {
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 369 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 385 "inweb/foundation-module/Chapter 1/Windows Platform.w"
DWORD WINAPI Platform__Win32_Thread_Func(LPVOID param) {
struct Win32_Thread_Start* start = (struct Win32_Thread_Start*)param;
(start->fn)(start->arg);
@ -6233,7 +6249,7 @@ size_t Platform__get_thread_stack_size(foundation_thread_attributes* pa) {
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 408 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 424 "inweb/foundation-module/Chapter 1/Windows Platform.w"
int Platform__get_core_count(void) {
int count = 0;
SYSTEM_INFO sysInfo;
@ -6249,7 +6265,7 @@ int Platform__get_core_count(void) {
#endif /* PLATFORM_WINDOWS */
#ifdef PLATFORM_WINDOWS
#line 429 "inweb/foundation-module/Chapter 1/Windows Platform.w"
#line 445 "inweb/foundation-module/Chapter 1/Windows Platform.w"
time_t Platform__never_time(void) {
return (time_t) 0;
}
@ -8990,11 +9006,11 @@ int CommandLine__read_pair_p(text_stream *opt, text_stream *opt_val, int N,
; innocuous = TRUE; break;
case VERSION_CLSW: {
PRINT("inweb");
char *svn = "7.1.0-beta+1B13";
char *svn = "7.1.1-beta+1B14";
if (svn[0]) PRINT(" version %s", svn);
char *vname = "Escape to Danger";
if (vname[0]) PRINT(" '%s'", vname);
char *d = "28 July 2022";
char *d = "9 August 2022";
if (d[0]) PRINT(" (%s)", d);
PRINT("\n");
innocuous = TRUE; break;
@ -20359,7 +20375,7 @@ web *Reader__load_web(pathname *P, filename *alt_F, module_search *I,
{
#line 134 "inweb/Chapter 2/The Reader.w"
TEMPORARY_TEXT(IB)
WRITE_TO(IB, "7.1.0");
WRITE_TO(IB, "7.1.1");
web_bibliographic_datum *bd = Bibliographic__set_datum(W->md, TL_IS_205, IB);
bd->declaration_permitted = FALSE;
DISCARD_TEXT(IB)
@ -33253,7 +33269,7 @@ void Ctags__write(web *W, filename *F) {
WRITE("!_TAG_FILE_SORTED\t0\t/0=unsorted, 1=sorted, 2=foldcase/\n");
WRITE("!_TAG_PROGRAM_AUTHOR\tGraham Nelson\t/graham.nelson@mod-langs.ox.ac.uk/\n");
WRITE("!_TAG_PROGRAM_NAME\tinweb\t//\n");
WRITE("!_TAG_PROGRAM_VERSION\t7.1.0-beta+1B13\t/built 28 July 2022/\n");
WRITE("!_TAG_PROGRAM_VERSION\t7.1.1-beta+1B14\t/built 9 August 2022/\n");
}
#line 47 "inweb/Chapter 6/Ctags Support.w"

View file

@ -1,3 +1,3 @@
Prerelease: beta
Build Date: 9 August 2022
Build Number: 1B14
Build Date: 20 August 2022
Build Number: 1B15

View file

@ -184,14 +184,30 @@ just that installation and use of Foundation-built tools is less convenient.)
<span class="plain-syntax"> </span><span class="identifier-syntax">or</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">Unix</span><span class="plain-syntax">-</span><span class="identifier-syntax">like</span><span class="plain-syntax"> </span><span class="identifier-syntax">shell</span><span class="plain-syntax">. */</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">unix</span><span class="plain-syntax"> = </span><a href="1-wp.html#SP7" class="function-link"><span class="function-syntax">Platform::Win32_is_unix_cmd</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cmd</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">unix</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="comment-syntax"> Some Cygwin commands cannot handle backslashes in paths.</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">forward_slash</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">strncmp</span><span class="plain-syntax">(</span><span class="identifier-syntax">cmd</span><span class="plain-syntax">,</span><span class="string-syntax">"pdftex "</span><span class="plain-syntax">,7) == </span><span class="constant-syntax">0</span><span class="plain-syntax">)</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">forward_slash</span><span class="plain-syntax"> = </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="comment-syntax"> For a Unix shell command, escape any double quotes and backslashes.</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pcl</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pc</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">strcpy</span><span class="plain-syntax">(</span><span class="identifier-syntax">cmd_line</span><span class="plain-syntax">, </span><span class="string-syntax">"sh -c \""</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pc</span><span class="plain-syntax"> = </span><span class="identifier-syntax">cmd</span><span class="plain-syntax">, </span><span class="identifier-syntax">pcl</span><span class="plain-syntax"> = </span><span class="identifier-syntax">cmd_line</span><span class="plain-syntax">+</span><span class="identifier-syntax">strlen</span><span class="plain-syntax">(</span><span class="identifier-syntax">cmd_line</span><span class="plain-syntax">); *</span><span class="identifier-syntax">pc</span><span class="plain-syntax"> != </span><span class="constant-syntax">0</span><span class="plain-syntax">; ++</span><span class="identifier-syntax">pc</span><span class="plain-syntax">, ++</span><span class="identifier-syntax">pcl</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((*</span><span class="identifier-syntax">pc</span><span class="plain-syntax"> == </span><span class="character-syntax">'\\'</span><span class="plain-syntax">) || (*</span><span class="identifier-syntax">pc</span><span class="plain-syntax"> == </span><span class="character-syntax">'\"'</span><span class="plain-syntax">))</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">pc</span><span class="plain-syntax"> == </span><span class="character-syntax">'\"'</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> *(</span><span class="identifier-syntax">pcl</span><span class="plain-syntax">++) = </span><span class="character-syntax">'\\'</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> *</span><span class="identifier-syntax">pcl</span><span class="plain-syntax"> = *</span><span class="identifier-syntax">pc</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> *</span><span class="identifier-syntax">pcl</span><span class="plain-syntax"> = *</span><span class="identifier-syntax">pc</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (*</span><span class="identifier-syntax">pc</span><span class="plain-syntax"> == </span><span class="character-syntax">'\\'</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">forward_slash</span><span class="plain-syntax">)</span>
<span class="plain-syntax"> *</span><span class="identifier-syntax">pcl</span><span class="plain-syntax"> = </span><span class="character-syntax">'/'</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax"> *(</span><span class="identifier-syntax">pcl</span><span class="plain-syntax">++) = </span><span class="character-syntax">'\\'</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> *</span><span class="identifier-syntax">pcl</span><span class="plain-syntax"> = *</span><span class="identifier-syntax">pc</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">else</span>
<span class="plain-syntax"> *</span><span class="identifier-syntax">pcl</span><span class="plain-syntax"> = *</span><span class="identifier-syntax">pc</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> *(</span><span class="identifier-syntax">pcl</span><span class="plain-syntax">++) = </span><span class="character-syntax">'\"'</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> *(</span><span class="identifier-syntax">pcl</span><span class="plain-syntax">++) = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
@ -272,13 +288,13 @@ just that installation and use of Foundation-built tools is less convenient.)
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Platform::path_add</span><span class="plain-syntax">(</span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">char</span><span class="plain-syntax">* </span><span class="identifier-syntax">base</span><span class="plain-syntax">, </span><span class="reserved-syntax">const</span><span class="plain-syntax"> </span><span class="reserved-syntax">char</span><span class="plain-syntax">* </span><span class="identifier-syntax">add</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax">* </span><span class="identifier-syntax">path</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">char</span><span class="plain-syntax"> </span><span class="identifier-syntax">last</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">char</span><span class="plain-syntax"> </span><span class="identifier-syntax">last</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">strcpy</span><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">, </span><span class="identifier-syntax">base</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">last</span><span class="plain-syntax"> = </span><span class="identifier-syntax">path</span><span class="plain-syntax">[</span><span class="identifier-syntax">strlen</span><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">) - </span><span class="constant-syntax">1</span><span class="plain-syntax">];</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">last</span><span class="plain-syntax"> != </span><span class="character-syntax">'/'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">last</span><span class="plain-syntax"> != </span><span class="character-syntax">'\\'</span><span class="plain-syntax">))</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">strcat</span><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">, </span><span class="string-syntax">"\\"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">strcat</span><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">, </span><span class="identifier-syntax">add</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">strcpy</span><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">, </span><span class="identifier-syntax">base</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">last</span><span class="plain-syntax"> = </span><span class="identifier-syntax">path</span><span class="plain-syntax">[</span><span class="identifier-syntax">strlen</span><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">) - </span><span class="constant-syntax">1</span><span class="plain-syntax">];</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">last</span><span class="plain-syntax"> != </span><span class="character-syntax">'/'</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">last</span><span class="plain-syntax"> != </span><span class="character-syntax">'\\'</span><span class="plain-syntax">))</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">strcat</span><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">, </span><span class="string-syntax">"\\"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">strcat</span><span class="plain-syntax">(</span><span class="identifier-syntax">path</span><span class="plain-syntax">, </span><span class="identifier-syntax">add</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Platform::rsync</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Platform::rsync</span></span>:<br/>POSIX Platforms - <a href="1-pp.html#SP15">&#167;15</a><br/>Pathnames - <a href="3-pth.html#SP10">&#167;10</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">transcoded_source</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">transcoded_dest</span><span class="plain-syntax">) {</span>

Binary file not shown.

View file

@ -141,7 +141,7 @@ a C program to find twin prime numbers. If we weave:
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb/Tangled/inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/twinprimes.inweb</span><span class="ConsoleText-identifier-syntax"> -weave</span>
<span class="ConsoleText-plain-syntax"> web "twinprimes": 1 section(s) : 4 paragraph(s) : 48 line(s)</span>
<span class="ConsoleText-plain-syntax"> web "twinprimes": 1 section(s) : 3 paragraph(s) : 55 line(s)</span>
<span class="ConsoleText-plain-syntax"> [Complete Program: HTML -&gt; inweb/Examples/twinprimes.html]</span>
</pre>
<p class="commentary">As with tangling, we can override this destination with <span class="extract"><span class="ConsoleText-extract-syntax">-weave-to F</span></span>, telling
@ -156,7 +156,7 @@ web, with multiple sections, it would make a set of linked pages, but here
there's just one.) This can then be looked at with a browser such as Chrome or
Safari. HTML is not the only format we can produce. Inweb performs the weave
by following a "pattern", and it has several patterns built in, notably <span class="extract"><span class="ConsoleText-extract-syntax">HTML</span></span>,
<span class="extract"><span class="ConsoleText-extract-syntax">Ebook</span></span> and <span class="extract"><span class="ConsoleText-extract-syntax">TeX</span></span>.
<span class="extract"><span class="ConsoleText-extract-syntax">Ebook</span></span>, <span class="extract"><span class="ConsoleText-extract-syntax">TeX</span></span> and <span class="extract"><span class="ConsoleText-extract-syntax">PDFTeX</span></span>.
</p>
<p class="commentary">Running Inweb with <span class="extract"><span class="ConsoleText-extract-syntax">-weave-as P</span></span> tells it to weave with pattern <span class="extract"><span class="ConsoleText-extract-syntax">P</span></span>; the
@ -166,7 +166,7 @@ would be overkill for such a tiny program. Instead:
</p>
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb/Tangled/inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/twinprimes.inweb</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> TeX</span>
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb/Tangled/inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/twinprimes.inweb</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> PDFTeX</span>
</pre>
<p class="commentary">This will only work if you have the mathematical typesetting system TeX
installed, and in particular, the <span class="extract"><span class="ConsoleText-extract-syntax">pdftex</span></span> tool. (This comes as part of
@ -176,8 +176,8 @@ is like so:
</p>
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb/Tangled/inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/twinprimes.inweb</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> TeX</span>
<span class="ConsoleText-plain-syntax"> web "twinprimes": 1 section(s) : 4 paragraph(s) : 48 line(s)</span>
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb/Tangled/inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/twinprimes.inweb</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> PDFTeX</span>
<span class="ConsoleText-plain-syntax"> web "twinprimes": 1 section(s) : 3 paragraph(s) : 55 line(s)</span>
<span class="ConsoleText-plain-syntax"> [Complete Program: PDF -&gt; inweb/Examples/twinprimes.tex: 1pp 103K]</span>
</pre>
<p class="commentary">Inweb automatically creates <span class="extract"><span class="ConsoleText-extract-syntax">twinprimes.tex</span></span> and runs it through <span class="extract"><span class="ConsoleText-extract-syntax">pdftex</span></span>
@ -397,7 +397,7 @@ module used this to bring in a Windows-only header file.)
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/goldbach</span><span class="ConsoleText-identifier-syntax"> -weave</span>
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/goldbach</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> TeX</span>
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/goldbach</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> PDFTeX</span>
</pre>
<p class="commentary">This will produce single HTML or PDF files of the woven form of the whole
program. (Note that the PDF file now has a cover page: on a web with just
@ -412,7 +412,7 @@ been running weaves like these:
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/goldbach</span><span class="ConsoleText-identifier-syntax"> -weave</span><span class="ConsoleText-plain-syntax"> all</span>
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/goldbach</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> TeX all</span>
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/goldbach</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> PDFTeX all</span>
</pre>
<p class="commentary">The opposite extreme from <span class="extract"><span class="ConsoleText-extract-syntax">all</span></span> is <span class="extract"><span class="ConsoleText-extract-syntax">sections</span></span>. This still weaves the entire
web, but now cuts it up into individual files, one for each section. For
@ -436,7 +436,7 @@ of Eratosthenes". Similarly,
</p>
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/goldbach</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> TeX sections</span>
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inweb</span><span class="ConsoleText-plain-syntax"> inweb/Examples/goldbach</span><span class="ConsoleText-identifier-syntax"> -weave-as</span><span class="ConsoleText-plain-syntax"> PDFTeX sections</span>
</pre>
<p class="commentary">creates the files:
</p>

View file

@ -36,7 +36,7 @@
</nav>
<main role="main">
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><b>inweb</b></li></ul>
<p class="purpose">A modern system for literate programming. This is version 7.1.0.</p>
<p class="purpose">A modern system for literate programming. This is version 7.1.1.</p>
<hr>
<div class="contentspage">
<ul class="chapterlist">

5
notes/release/7-1-0.md Normal file
View file

@ -0,0 +1,5 @@
# Release notes for Inweb v7.1.0
This release was made in April 2022, but was only a prerelease and was marked
`-beta` in its semantic version number. The first proper release for major
version 7 is [v7.2.0](7-2-0.md).

9
notes/release/7-2-0.md Normal file
View file

@ -0,0 +1,9 @@
# Release notes for Inweb v7.2.0
This release was made in August 2022, and was the first proper release for major
version 7. This release is the baseline for Inweb release notes from here on.
The prerelease version [v7.1.0](7-1-0.md), a stopgap during the period when
Inform's open-sourcing was getting going, is substantially the same program.
However, 7.2.0 corrects a few bugs, and the `foundation` library added a number
of useful functions, notably to do with JSON file parsing and validation.

12
notes/version_history.md Normal file
View file

@ -0,0 +1,12 @@
# Version history
See [versions](versions.md) for details of Inweb's version numbering.
Links in the following table are to the archive of release notes, which
covers only the open-source era of Inform. (Earlier versions of Inweb were
sufficiently different to be not worth covering here.)
Version | Build | Date | Highlights
--------------------------- | ----- | -------------- | ----------
[7.1.0](release/7-1-0.md) | 1A96 | April 2022 | Prereleased beta
[7.2.0](release/7-2-0.md) | 1B15 | August 2022 | First proper release

26
notes/versioning.md Normal file
View file

@ -0,0 +1,26 @@
# Branching and versioning policy
## Version numbers for Inweb
Inweb is developed in public. Command-line users comfortable with git can always get the very latest state. But that potentially means endless different versions of Inweb out there in the wild. To clarify this situation, all versions are numbered, and we will distinguish between "release" versions, which are ready for public use, and "unstable" versions, which are not.
"Release" versions have simple version numbers in the shape `X.Y.Z`: for example, `7.1.0`.
"Unstable" versions are commits of the software between releases. These have much longer version numbers, containing an `-alpha` or `-beta` warning. For example, `7.1.0-beta+1B14`. (The `+1B14` is a daily build number, also only
present on version numbers of unstable versions.)
Note that `inweb -version` prints out the full version number of the core
source it was compiled from. This one is clearly unstable:
$ inweb/Tangled/inweb -version
inweb version 7.1.0-beta+1B14 'Escape to Danger' (9 August 2022)
(At some point, major versions of Inweb were given code-names according to the
episodes of the 1964 Doctor Who serial [The Web Planet](https://en.wikipedia.org/wiki/The_Web_Planet).
Major version 8 will be "Crater of Needles".)
## Branching
In the core Inweb repository, active development is on the `master` branch, at least for now. That will always be a version which is unstable. All releases will be made from short branches off of `master`. For example, there will soon be a branch called `r7.1`. This will contain as few commits as possible, ideally just one, which would be the actual release version of 7.1.0. But if there are then point updates with bug fixes, say 7.1.1, 7.1.2, and so on, those would be further commits to the `r7.1` branch. Later, another short branch from `master` would be `r7.2`.
Releases will be tagged with their version numbers, so the commit representing 7.1.0 will be tagged `v7.1.0`. These will be presented under Releases in the usual Github way, from the column on the right-hand side of the home page. We expect to provide the app installers as associated binary files on those releases, though that won't be the only place they are available.

View file

@ -1,6 +1,6 @@
# Inweb {bibliographic datum: Version Number of: inweb}
v{bibliographic datum: Semantic Version Number of: inweb} '{bibliographic datum: Version Name of: inweb}' ({bibliographic datum: Build Date of: inweb})
[Version](notes/versioning.md): {bibliographic datum: Semantic Version Number of: inweb} '{bibliographic datum: Version Name of: inweb}' ({bibliographic datum: Build Date of: inweb})
## About Inweb
@ -40,24 +40,27 @@ This is in order that there can be clear ownership.
## Build Instructions
**Caution**: The `main` branch of this repository generally holds "unstable", that is,
unreleased work-in-progress versions of Inform. See [notes/versioning.md](notes/versioning.md).
Inweb is intentionally self-sufficient, with no dependencies on any other
software beyond a modern C compiler. However, it does in a sense depend on
itself: because Inweb is itself a web, you need Inweb to compile Inweb.
Getting around that circularity means that the initial setup takes a few steps.
Make a directory in which to work: let's call this "work". Then:
Make a directory in which to work: let's call this `work`. Then:
* Change the current directory to this: "cd work"
* Clone Inweb: "git clone https://github.com/ganelson/inweb.git"
* Change the current directory to this: `cd work`
* Clone Inweb: `git clone https://github.com/ganelson/inweb.git`
* Run **one of the following commands**.
* "bash inweb/scripts/first.sh linux"
* "bash inweb/scripts/first.sh macos"
* "bash inweb/scripts/first.sh macos32"
* "bash inweb/scripts/first.sh macosarm"
* "bash inweb/scripts/first.sh macosuniv"
* "bash inweb/scripts/first.sh unix"
* "bash inweb/scripts/first.sh windows"
* Test that all is well: "inweb/Tangled/inweb -help"
* `bash inweb/scripts/first.sh linux`
* `bash inweb/scripts/first.sh macos`
* `bash inweb/scripts/first.sh macos32`
* `bash inweb/scripts/first.sh macosarm`
* `bash inweb/scripts/first.sh macosuniv`
* `bash inweb/scripts/first.sh unix`
* `bash inweb/scripts/first.sh windows`
* Test that all is well: `inweb/Tangled/inweb -help`
Some notes on which platform to choose:
* For Intel Macs running MacOS 10.13 ("High Sierra") or earlier, use macos32.
@ -75,13 +78,13 @@ has not yet an opportunity to contribute build settings.
You should now have a working copy of Inweb, with its own makefile tailored
to your platform now in place (at inweb/inweb.mk). To build inweb again, e.g.
after editing inweb's source code, do not run the shell script first.sh again.
Instead, you must use: "make -f inweb/inweb.mk"
Instead, you must use: `make -f inweb/inweb.mk`
If you wish to tweak the makefile, do not edit it directly. Instead,
edit inweb/scripts/inweb.mkscript and inweb/Materials/platforms/PLATFORM.mkscript,
where PLATFORM is your choice as above (e.g., 'macos'). Then run "make -f inweb/inweb.mk makers"
where PLATFORM is your choice as above (e.g., 'macos'). Then run `make -f inweb/inweb.mk makers`
to rebuild all these makefiles with your changes incorporated; and then run
the shell script "inweb/scripts/first.sh" again.
the shell script `inweb/scripts/first.sh` again.
A few features of inweb used when integrating the core Inform software into its
apps rely on having the standard Unix tool "rsync" installed: so on Linux, where
@ -141,7 +144,7 @@ A small executable for running unit tests against Foundation is also included:
## Testing Inweb
If you have also built Intest as "work/intest", then you can try these:
If you have also built Intest as `work/intest`, then you can try these:
* intest/Tangled/intest inweb all
* intest/Tangled/intest inweb/foundation-test all

View file

@ -2,4 +2,3 @@
4 5Z71 April 2009
The Web Planet 5 6H66 April 2011 Ported to C
The Zarbi 6 6L02 May 2014
Escape to Danger 7.1 * 28 April 2022 Modernised throughout