| 1 |
This is the change file for CWEB's COMMON under VAX/VMS. |
| 2 |
|
| 3 |
created: |
| 4 |
1987 BL (Bjorn Larsen, University of Oslo) |
| 5 |
|
| 6 |
modified: |
| 7 |
01-FEB-1992 ST (Stephan Trebels <[email protected]>) |
| 8 |
> include ctype,stdio,ssdef from textlibrary SYS$SHARE:VAXCDEF.TLB |
| 9 |
> change error return code to SS$_ABORT |
| 10 |
(perhaps better than %NONAME-E-NOMSG, Message number 2 ) |
| 11 |
|
| 12 |
(also modified by Don Knuth to match changes in the master file) |
| 13 |
(only the two changes by BL are necessary for initial bootstrapping |
| 14 |
via hand-editing of common.c) |
| 15 |
|
| 16 |
@x section 3 (01-FEB-1992 ST) |
| 17 |
#include <ctype.h> /* definition of |@!isalpha|, |@!isdigit| and so on */ |
| 18 |
#include <stdbool.h> /* definition of |@!bool|, |@!true| and |@!false| */ |
| 19 |
#include <stddef.h> /* definition of |@!ptrdiff_t| */ |
| 20 |
#include <stdint.h> /* definition of |@!uint8_t| and |@!uint16_t| */ |
| 21 |
#include <stdio.h> /* definition of |@!printf| and friends */ |
| 22 |
#include <stdlib.h> /* definition of |@!getenv| and |@!exit| */ |
| 23 |
#include <string.h> /* definition of |@!strlen|, |@!strcmp| and so on */ |
| 24 |
@y |
| 25 |
#include ctype /* definition of |@!isalpha|, |@!isdigit| and so on */ |
| 26 |
/* VMS searches text libraries faster */ |
| 27 |
#include stdbool /* definition of |@!bool|, |@!true| and |@!false| */ |
| 28 |
#include stddef /* definition of |@!ptrdiff_t| */ |
| 29 |
#include stdint /* definition of |@!uint8_t| and |@!uint16_t| */ |
| 30 |
#include stdio /* definition of |@!printf| and friends */ |
| 31 |
#include stdlib /* definition of |@!getenv| and |@!exit| */ |
| 32 |
#include string /* definition of |@!strlen|, |@!strcmp| and so on */ |
| 33 |
@z |
| 34 |
|
| 35 |
@x section 68 (01-FEB-1992 ST) |
| 36 |
programs are started. Here, for instance, we pass the operating system |
| 37 |
a status of |EXIT_SUCCESS| if and only if only harmless messages were printed. |
| 38 |
@y |
| 39 |
programs are started. Here, for instance, we pass VAX/VMS |
| 40 |
a status of |SS$_NORMAL| if and only if only harmless |
| 41 |
messages have been printed. |
| 42 |
A suitable status to signal an error condition to VAX/VMS could be |
| 43 |
|SS$_ABORT|, telling the operating system to |
| 44 |
print |"%SYSTEM-F-ABORT, abort"|, if |history > harmless_message|. |
| 45 |
@z |
| 46 |
|
| 47 |
@x section 68 (1987 BL) (01-FEB-1992 ST) (11-JAN-1993 DEK) |
| 48 |
if (history > harmless_message) return EXIT_FAILURE; |
| 49 |
else return EXIT_SUCCESS; |
| 50 |
@y |
| 51 |
/* |
| 52 |
VAX/VMS and UNIX have different error status conventions. |
| 53 |
VAX/VMS uses odd values (for example |SS$_NORMAL|) to indicate success, |
| 54 |
even values indicate errors, resulting in messages displayed |
| 55 |
on the screen. |SS$_ABORT| has been chosen, to indicate an |
| 56 |
error and display something that's not complete nonsense. |
| 57 |
*/ |
| 58 |
if (history > harmless_message) exit(SS$_ABORT); |
| 59 |
else exit(SS$_NORMAL); |
| 60 |
@z |
| 61 |
|
| 62 |
@x section 75 (01-FEB-1992 ST) |
| 63 |
An omitted change file argument means that |"/dev/null"| should be used, |
| 64 |
when no changes are desired. |
| 65 |
@y |
| 66 |
An omitted change file argument means that the |
| 67 |
null device |"NL:"| should be used, when no changes are desired. |
| 68 |
@z |
| 69 |
|
| 70 |
@x section 75 (1987 BL) (01-FEB-1992 ST) (05-APR-1992 DEK) |
| 71 |
strcpy(change_file_name,"/dev/null"); |
| 72 |
@y |
| 73 |
strcpy(change_file_name,"NL:"); |
| 74 |
/* {\tt NL:} is the VAX/VMS notation for {\tt /dev/null} */ |
| 75 |
@z |
| 76 |
|
| 77 |
@x section 85 (01-FEB-1992 ST) |
| 78 |
@* Index. |
| 79 |
@y |
| 80 |
@* VAX/VMS specific code. |
| 81 |
We have used |SS$_NORMAL| and |SS$_ABORT| as return codes, |
| 82 |
so we have to include the system message codes. |
| 83 |
|
| 84 |
@<Include files@>= |
| 85 |
#include ssdef /* we need VAX/VMS system messages */ |
| 86 |
|
| 87 |
@* Index. |
| 88 |
@z |