Update bootstrap files.

This commit is contained in:
2024-03-15 09:13:19 +00:00
parent 0aa114e920
commit 56da919f27
11 changed files with 1413 additions and 252 deletions

60
main.c
View File

@@ -1,17 +1,25 @@
#line 878 "nuweb.w"
#include "global.h"
#line 955 "nuweb.w"
#include <stdlib.h>
int main(argc, argv)
int argc;
char **argv;
int main(int argc, char** argv)
{
int arg = 1;
/* Interpret command-line arguments */
#line 1113 "nuweb.w"
command_name = argv[0];
#line 1119 "nuweb.w"
while (arg < argc) {
char *s = argv[arg];
if (*s++ == '-') {
/* Interpret the argument string \verb|s| */
#line 1139 "nuweb.w"
{
char c = *s++;
while (c) {
@@ -56,8 +64,12 @@ int main(argc, argv)
}
HasValue:;
}
#line 1122 "nuweb.w"
arg++;
/* Perhaps get the prepend path */
#line 1186 "nuweb.w"
if (prepend_flag)
{
if (*s == '\0')
@@ -66,7 +78,11 @@ HasValue:;
prepend_flag = FALSE;
}
#line 1124 "nuweb.w"
/* Perhaps get the version info string */
#line 1214 "nuweb.w"
if (version_info_flag)
{
if (*s == '\0')
@@ -75,7 +91,11 @@ HasValue:;
version_info_flag = FALSE;
}
#line 1125 "nuweb.w"
/* Perhaps get the hyperref options */
#line 1224 "nuweb.w"
if (hyperopt_flag)
{
if (*s == '\0')
@@ -85,7 +105,11 @@ HasValue:;
hyperref_flag = TRUE;
}
#line 1126 "nuweb.w"
/* Perhaps add an include path */
#line 1196 "nuweb.w"
if (includepath_flag)
{
struct incl * le
@@ -102,11 +126,17 @@ HasValue:;
includepath_flag = FALSE;
}
#line 1127 "nuweb.w"
}
else break;
}
#line 960 "nuweb.w"
/* Set locale information */
#line 1240 "nuweb.w"
{
/* try to get locale information */
char *s=getenv("LC_CTYPE");
@@ -118,8 +148,12 @@ HasValue:;
fprintf(stderr, "Setting locale failed\n");
}
#line 961 "nuweb.w"
initialise_delimit_scrap_array();
/* Process the remaining arguments (file names) */
#line 1259 "nuweb.w"
{
if (arg >= argc) {
fprintf(stderr, "%s: expected a file name. ", command_name);
@@ -128,11 +162,15 @@ HasValue:;
}
do {
/* Handle the file name in \verb|argv[arg]| */
#line 1281 "nuweb.w"
{
char source_name[FILENAME_MAX];
char tex_name[FILENAME_MAX];
char aux_name[FILENAME_MAX];
/* Build \verb|source_name| and \verb|tex_name| */
#line 1304 "nuweb.w"
{
char *p = argv[arg];
char *q = source_name;
@@ -150,6 +188,8 @@ HasValue:;
c = *p++;
}
/* Add the source path to the include path list */
#line 1344 "nuweb.w"
if (trim != source_name) {
struct incl * le
= (struct incl *)arena_getmem(sizeof(struct incl));
@@ -165,6 +205,8 @@ HasValue:;
*trim = sv;
}
#line 1320 "nuweb.w"
*q = '\0';
if (dot) {
*dot = '\0'; /* produce HTML when the file extension is ".hw" */
@@ -181,7 +223,11 @@ HasValue:;
*q = '\0';
}
}
#line 1285 "nuweb.w"
/* Process a file */
#line 1370 "nuweb.w"
{
pass1(source_name);
current_sector = 1;
@@ -191,7 +237,7 @@ HasValue:;
int saved_number_flag = number_flag;
number_flag = TRUE;
collect_numbers(aux_name);
write_html(source_name, tex_name, 0/*Dummy */);
write_html(source_name, tex_name);
number_flag = saved_number_flag;
}
else {
@@ -203,9 +249,15 @@ HasValue:;
write_files(file_names);
arena_free();
}
#line 1286 "nuweb.w"
}
#line 1266 "nuweb.w"
arg++;
} while (arg < argc);
}
#line 963 "nuweb.w"
exit(0);
}