summaryrefslogtreecommitdiff
path: root/web/systems/mac/cweb
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /web/systems/mac/cweb
Initial commit
Diffstat (limited to 'web/systems/mac/cweb')
-rw-r--r--web/systems/mac/cweb/CTanglePPCbin0 -> 104951 bytes
-rw-r--r--web/systems/mac/cweb/CWEBChangeFilesForMacOS/comm-mac.ch89
-rw-r--r--web/systems/mac/cweb/CWEBChangeFilesForMacOS/ctang-mac.ch58
-rw-r--r--web/systems/mac/cweb/CWEBChangeFilesForMacOS/cweav-mac.ch18
-rw-r--r--web/systems/mac/cweb/CWeavePPCbin0 -> 126251 bytes
-rw-r--r--web/systems/mac/cweb/ReadMe.txt29
6 files changed, 194 insertions, 0 deletions
diff --git a/web/systems/mac/cweb/CTanglePPC b/web/systems/mac/cweb/CTanglePPC
new file mode 100644
index 0000000000..384b3e7737
--- /dev/null
+++ b/web/systems/mac/cweb/CTanglePPC
Binary files differ
diff --git a/web/systems/mac/cweb/CWEBChangeFilesForMacOS/comm-mac.ch b/web/systems/mac/cweb/CWEBChangeFilesForMacOS/comm-mac.ch
new file mode 100644
index 0000000000..c4b81f81a8
--- /dev/null
+++ b/web/systems/mac/cweb/CWEBChangeFilesForMacOS/comm-mac.ch
@@ -0,0 +1,89 @@
+This is the change file for CWEB's COMMON under MacOS
+(Contributed by Markus van Almsick m.van.almsick@cityweb.de, October 2000)
+
+Changes necessary for compiling with Metrowerks CodeWarrior Pro 5
+Use the stationary for a Std C console
+
+This change file addresses three issues:
+1. The MacOS does not have a /dev/null device. We work around this problem
+by skipping input_ln routines for FILEs named /dev/null.
+2. The MacOS has a different path name convention. We take '\','/', and ':'
+as path name separators.
+3. CWEB does not always close files after using them. We make sure that
+web and change files are closed before reopening these files or before
+exiting the program. FILE* pointers of closed files are set to NULL.
+
+
+
+@x section 70 /* emulate input from |/dev/null| */
+int input_ln(fp) /* copies a line into |buffer| or returns 0 */
+FILE *fp; /* what file to read from */
+{
+ register int c=EOF; /* character read; initialized so some compilers won't complain */
+ register char *k; /* where next character goes */
+@y
+int input_ln(fp) /* copies a line into |buffer| or returns 0 */
+FILE *fp; /* what file to read from */
+{
+ register int c=EOF; /* character read; initialized so some compilers won't complain */
+ register char *k; /* where next character goes */
+ if (fp == NULL) return(0); /* MacOS /dev/null substitute */
+@z
+
+
+@x /* initialize files with NULL pointer to mark them as still closed */
+FILE *file[max_include_depth]; /* stack of non-change files */
+FILE *change_file; /* change file */
+@y
+FILE *file[max_include_depth]={NULL,NULL}; /* stack of non-change files */
+FILE *change_file=NULL; /* change file */
+@z
+
+
+@x /* close an open web file before reopening it */
+@<Open input files@>=
+@y
+@<Open input files@>=
+if (web_file != NULL) { /* make sure file is closed before (re)opening */
+ fclose(web_file);
+ web_file = NULL;
+}
+@z
+
+
+@x /* close an open change file before reopening it and don't look for |/dev/null| */
+if ((change_file=fopen(change_file_name,"r"))==NULL)
+ fatal("! Cannot open change file ", change_file_name);
+@y
+if (change_file != NULL) { /* make sure file is closed before (re)opening */
+ fclose(change_file);
+ change_file = NULL;
+}
+if(strcmp(change_file_name,"/dev/null")==0)
+ change_file=NULL; /* MacOS substitute for a |/dev/null| file */
+else {
+ if ((change_file=fopen(change_file_name,"r"))==NULL)
+ fatal("! Cannot open change file ", change_file_name);
+}
+@z
+
+
+@x /* close open change and web files before exiting the program */
+int wrap_up() {
+@y
+int wrap_up() {
+ if(web_file!=NULL) { /* make sure |web_file| is closed */
+ fclose(web_file);
+ }
+ if(change_file!=NULL) { /* make sure |change_file| is closed */
+ fclose(change_file);
+ }
+@z
+
+
+@x /* implement DOS and MacOS path name separators */
+ else if (*s=='/') dot_pos=NULL,name_pos=++s;
+@y
+ else if (*s == ':' || *s == '\\' || *s == '/')
+ dot_pos=NULL,name_pos=++s;
+@z
diff --git a/web/systems/mac/cweb/CWEBChangeFilesForMacOS/ctang-mac.ch b/web/systems/mac/cweb/CWEBChangeFilesForMacOS/ctang-mac.ch
new file mode 100644
index 0000000000..878497bb35
--- /dev/null
+++ b/web/systems/mac/cweb/CWEBChangeFilesForMacOS/ctang-mac.ch
@@ -0,0 +1,58 @@
+This is the change file for CWEB's CTANGLE 3.6 under MacOS
+(Contributed by Markus van Almsick m.van.almsick@cityweb.de, October 2000)
+
+Changes necessary for compiling with Metrowerks CodeWarrior Pro 5
+Use the stationary for a Std C console
+
+This change file addresses two issues:
+1. The MacOS does not have a command line driven console by default.
+We have to insert the ccommand routine.
+2. CWEB does not close all the files it uses. We insert a few lines
+to assert that files are closed.
+
+
+
+@x /* insert MacOS command line dialog */
+ argc=ac; argv=av;
+@y
+ argc=ac; argv=av;
+ argc = ccommand (&argv); /* addition for MacOS */
+@z
+
+
+@x /* close C file are usage */
+ printf("\n! No program text was specified."); mark_harmless;
+@y
+ printf("\n! No program text was specified.");
+ fclose(C_file); /* close main C file */
+ mark_harmless;
+@z
+
+
+@x /* close C file are usage */
+@<Write all the named output files@>=
+@y
+@<Write all the named output files@>=
+fclose(C_file); /* close main C file */
+@z
+
+
+@x /* don't close main C file twice (see change above) */
+ fclose(C_file);
+ C_file=fopen(output_file_name,"w");
+ if (C_file ==0) fatal("! Cannot open output file:",output_file_name);
+@y
+ C_file=fopen(output_file_name,"w"); /* open secondary C file */
+ if (C_file == NULL)
+ fatal("! Cannot open output file:",output_file_name);
+@z
+
+
+@x /* close secondary C file */
+ while (stack_ptr > stack) get_output();
+ flush_buffer();
+@y
+ while (stack_ptr > stack) get_output();
+ flush_buffer();
+ fclose(C_file); /* close secondary C file */
+@z \ No newline at end of file
diff --git a/web/systems/mac/cweb/CWEBChangeFilesForMacOS/cweav-mac.ch b/web/systems/mac/cweb/CWEBChangeFilesForMacOS/cweav-mac.ch
new file mode 100644
index 0000000000..e493c5fc0b
--- /dev/null
+++ b/web/systems/mac/cweb/CWEBChangeFilesForMacOS/cweav-mac.ch
@@ -0,0 +1,18 @@
+This is the change file for CWEB's CWEAVE under MacOS
+(Contributed by Markus van Almsick m.van.almsick@cityweb.de, October 2000)
+
+Changes necessary for compiling with Metrowerks CodeWarrior Pro 5
+Use the stationary for a Std C console
+
+This change file addresses only one issues:
+1. The MacOS does not have a command line driven console by default.
+We have to insert the ccommand routine.
+
+
+
+@x /* insert MacOS command line dialog */
+ argc=ac; argv=av;
+@y
+ argc=ac; argv=av;
+ argc = ccommand (&argv); /* addition for MacOS */
+@z \ No newline at end of file
diff --git a/web/systems/mac/cweb/CWeavePPC b/web/systems/mac/cweb/CWeavePPC
new file mode 100644
index 0000000000..3fb2dec4e7
--- /dev/null
+++ b/web/systems/mac/cweb/CWeavePPC
Binary files differ
diff --git a/web/systems/mac/cweb/ReadMe.txt b/web/systems/mac/cweb/ReadMe.txt
new file mode 100644
index 0000000000..b7d49a8e77
--- /dev/null
+++ b/web/systems/mac/cweb/ReadMe.txt
@@ -0,0 +1,29 @@
+CWeavePPC and CTanglePPC
+are simple PowerPC MacOS ports of:
+
+The CWEB System of Structured Documentation
+ (version 3.62 - September 2000)
+ by Donald E. Kunth and Silvio Levy
+
+
+Refer to the CWEB System concerning copyrights!
+Use this software at your own risk!
+
+Running CWeavePPC or CTanglePPC you will obtain
+a window to enter a command line according to
+[options] webfile[.w] [{changefile[.ch]|-} [outfile[.c]]]
+
+You may want to consider using the "+e" option for CWeave
+when creating output for LaTeX or other TeX-macros.
+
+The rest is explained in the CWEB manual.
+
+
+Happy weaving and tangling!
+
+Markus van Almsick
+m.van.almsick@cityweb.de
+
+
+P.S. I do not support this software.
+These executables do not run on 68K systems.