diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-18 09:21:39 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-19 08:36:52 +0200 |
commit | 8fcd4b640fc041a97ed982ad1f3831cb2eade061 (patch) | |
tree | 6b27ce94256c03ffd0bb5afe74315427cefac9f8 /rsc | |
parent | fdo#39468 Translate German comments, clean some ws (diff) | |
download | core-8fcd4b640fc041a97ed982ad1f3831cb2eade061.tar.gz core-8fcd4b640fc041a97ed982ad1f3831cb2eade061.zip |
rsc: remove VMS support
Change-Id: I20e8cc7014c140b6e7996ac51fc2d4c8030e2264
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/source/rscpp/cpp.h | 8 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp1.c | 19 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp2.c | 109 | ||||
-rw-r--r-- | rsc/source/rscpp/cpp3.c | 98 | ||||
-rw-r--r-- | rsc/source/rscpp/cppdef.h | 13 |
5 files changed, 4 insertions, 243 deletions
diff --git a/rsc/source/rscpp/cpp.h b/rsc/source/rscpp/cpp.h index 2a42f89ca5c1..b9fde72bed48 100644 --- a/rsc/source/rscpp/cpp.h +++ b/rsc/source/rscpp/cpp.h @@ -221,17 +221,11 @@ typedef struct sizes { #endif /* - * Error codes. VMS uses system definitions. + * Error codes. * Decus C codes are defined in stdio.h. * Others are cooked to order. */ -#if HOST == SYS_VMS -#include <ssdef.h> -#include <stsdef.h> -#define IO_NORMAL (SS$_NORMAL | STS$M_INHIB_MSG) -#define IO_ERROR SS$_ABORT -#endif /* * Note: IO_NORMAL and IO_ERROR are defined in the Decus C stdio.h file */ diff --git a/rsc/source/rscpp/cpp1.c b/rsc/source/rscpp/cpp1.c index d5445b86e561..6265d59dfebd 100644 --- a/rsc/source/rscpp/cpp1.c +++ b/rsc/source/rscpp/cpp1.c @@ -250,9 +250,6 @@ int MAIN(int argc, char** argv) InitCpp5(); InitCpp6(); -#if HOST == SYS_VMS - argc = getredirection(argc, argv); /* vms >file and <file */ -#endif initdefines(); /* O.S. specific def's */ if ( argv[argc-1][0] == '@' ) { @@ -275,16 +272,8 @@ int MAIN(int argc, char** argv) */ if (!streq(useargv[3], "-")) { -#if HOST == SYS_VMS - /* - * On vms, reopen stdout with "vanilla rms" attributes. - */ - if ((i = creat(useargv[3], 0, "rat=cr", "rfm=var")) == -1 - || dup2(i, fileno(stdout)) == -1) -#else pDefOut = fopen( useargv[3], "w" ); if( pDefOut == NULL ) -#endif { perror(useargv[3]); cerror("Can't open output file \"%s\"", useargv[3]); @@ -299,16 +288,8 @@ int MAIN(int argc, char** argv) */ if (!streq(useargv[2], "-")) { -#if HOST == SYS_VMS - /* - * On vms, reopen stdout with "vanilla rms" attributes. - */ - if ((i = creat(useargv[2], 0, "rat=cr", "rfm=var")) == -1 - || dup2(i, fileno(stdout)) == -1) -#else pCppOut = fopen( useargv[2], "w" ); if( pCppOut == NULL ) -#endif { perror(useargv[2]); cerror("Can't open output file \"%s\"", useargv[2]); diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c index 810d82371b4a..64272e3746de 100644 --- a/rsc/source/rscpp/cpp2.c +++ b/rsc/source/rscpp/cpp2.c @@ -21,17 +21,6 @@ #include <ctype.h> #include "cppdef.h" #include "cpp.h" -#if HOST == SYS_VMS -/* - * Include the rms stuff. (We can't just include rms.h as it uses the - * VaxC-specific library include syntax that Decus CPP doesn't support. - * By including things by hand, we can CPP ourself.) - */ -#include <nam.h> -#include <fab.h> -#include <rab.h> -#include <rmsdef.h> -#endif /* * Generate (by hand-inspection) a set of unique values for each control @@ -372,9 +361,6 @@ void doinclude() { int c; int delim; -#if HOST == SYS_VMS - char def_filename[NAM$C_MAXRSS + 1]; -#endif delim = macroid(skipws()); if (delim != '<' && delim != '"') @@ -400,20 +386,8 @@ void doinclude() #endif *workp = EOS; /* Terminate filename */ instring = FALSE; -#if HOST == SYS_VMS - /* - * Assume the default .h filetype. - */ - if (!vmsparse(work, ".H", def_filename)) { - perror(work); /* Oops. */ - goto incerr; - } - else if (openinclude(def_filename, (delim == '"'))) - return; -#else if (openinclude(work, (delim == '"'))) return; -#endif /* * No sense continuing if #include file isn't there. */ @@ -435,11 +409,6 @@ openinclude(char* filename, int searchlocal) */ { char **incptr; -#if HOST == SYS_VMS -#if NFWORK < (NAM$C_MAXRSS + 1) - << error, NFWORK is not greater than NAM$C_MAXRSS >> -#endif -#endif char tmpname[NFWORK]; /* Filename work area */ if (searchlocal) { @@ -518,14 +487,6 @@ hasdirectory(char* source, char* result) return (TRUE); } #else -#if HOST == SYS_VMS - if (vmsparse(source, NULLST, result) - && result[0] != EOS) - return (TRUE); - else { - return (FALSE); - } -#else /* * Random DEC operating system (RSX, RT11, RSTS/E) */ @@ -540,78 +501,8 @@ hasdirectory(char* source, char* result) return (TRUE); } #endif -#endif } -#if HOST == SYS_VMS -/* - * EXP_DEV is set if a device was specified, EXP_DIR if a directory - * is specified. (Both set indicate a file-logical, but EXP_DEV - * would be set by itself if you are reading, say, SYS$INPUT:) - */ -#define DEVDIR (NAM$M_EXP_DEV | NAM$M_EXP_DIR) - -FILE_LOCAL int -vmsparse(source, defstring, result) -char *source; -char *defstring; /* non-NULL -> default string. */ -char *result; /* Size is at least NAM$C_MAXRSS + 1 */ -/* - * Parse the source string, applying the default (properly, using - * the system parse routine), storing it in result. - * TRUE if it parsed, FALSE on error. - * - * If defstring is NULL, there are no defaults and result gets - * (just) the node::[directory] part of the string (possibly "") - */ -{ - struct FAB fab = cc$rms_fab; /* File access block */ - struct NAM nam = cc$rms_nam; /* File name block */ - char fullname[NAM$C_MAXRSS + 1]; - char *rp; /* Result pointer */ - - fab.fab$l_nam = &nam; /* fab -> nam */ - fab.fab$l_fna = source; /* Source filename */ - fab.fab$b_fns = strlen(source); /* Size of source */ - fab.fab$l_dna = defstring; /* Default string */ - if (defstring != NULLST) - fab.fab$b_dns = strlen(defstring); /* Size of default */ - nam.nam$l_esa = fullname; /* Expanded filename */ - nam.nam$b_ess = NAM$C_MAXRSS; /* Expanded name size */ - if (sys$parse(&fab) == RMS$_NORMAL) { /* Parse away */ - fullname[nam.nam$b_esl] = EOS; /* Terminate string */ - result[0] = EOS; /* Just in case */ - rp = &result[0]; - /* - * Remove stuff added implicitly, accepting node names and - * dev:[directory] strings (but not process-permanent files). - */ - if ((nam.nam$l_fnb & NAM$M_PPF) == 0) { - if ((nam.nam$l_fnb & NAM$M_NODE) != 0) { - strncpy(result, nam.nam$l_node, nam.nam$b_node); - rp += nam.nam$b_node; - *rp = EOS; - } - if ((nam.nam$l_fnb & DEVDIR) == DEVDIR) { - strncpy(rp, nam.nam$l_dev, nam.nam$b_dev + nam.nam$b_dir); - rp += nam.nam$b_dev + nam.nam$b_dir; - *rp = EOS; - } - } - if (defstring != NULLST) { - strncpy(rp, nam.nam$l_name, nam.nam$b_name + nam.nam$b_type); - rp += nam.nam$b_name + nam.nam$b_type; - *rp = EOS; - if ((nam.nam$l_fnb & NAM$M_EXP_VER) != 0) { - strncpy(rp, nam.nam$l_ver, nam.nam$b_ver); - rp[nam.nam$b_ver] = EOS; - } - } - return (TRUE); - } - return (FALSE); -} -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c index b7cf288adf57..c2601ae72b13 100644 --- a/rsc/source/rscpp/cpp3.c +++ b/rsc/source/rscpp/cpp3.c @@ -28,7 +28,7 @@ #include <string.h> -#if (OSL_DEBUG_LEVEL > 1) && (HOST == SYS_VMS || HOST == SYS_UNIX) +#if (OSL_DEBUG_LEVEL > 1) && (HOST == SYS_UNIX) #include <signal.h> #endif @@ -97,14 +97,6 @@ void setincdirs() #define MAXINCLUDE (NINCLUDE - 1 - IS_INCLUDE) #endif -#if HOST == SYS_VMS - extern char *getenv(); - - if (getenv("C$LIBRARY") != NULL) - *incend++ = "C$LIBRARY:"; - *incend++ = "SYS$LIBRARY:"; -#define MAXINCLUDE (NINCLUDE - 2 - IS_INCLUDE) -#endif #if HOST == SYS_RSX extern int $$rsts; /* TRUE on RSTS/E */ @@ -294,7 +286,7 @@ dooptions(int argc, char** argv) #if OSL_DEBUG_LEVEL > 1 case 'X': /* Debug */ debug = (isdigit(*ap)) ? atoi(ap) : 1; -#if (HOST == SYS_VMS || HOST == SYS_UNIX) +#if (HOST == SYS_UNIX) signal(SIGINT, (void (*)(int)) abort); /* Trap "interrupt" */ #endif fprintf(stderr, "Debug set to %d\n", debug); @@ -475,92 +467,6 @@ void initdefines() } } -#if HOST == SYS_VMS -/* - * getredirection() is intended to aid in porting C programs - * to VMS (Vax-11 C) which does not support '>' and '<' - * I/O redirection. With suitable modification, it may - * useful for other portability problems as well. - */ -int -getredirection(argc, argv) -int argc; -char **argv; -/* - * Process vms redirection arg's. Exit if any error is seen. - * If getredirection() processes an argument, it is erased - * from the vector. getredirection() returns a new argc value. - * - * Warning: do not try to simplify the code for vms. The code - * presupposes that getredirection() is called before any data is - * read from stdin or written to stdout. - * - * Normal usage is as follows: - * - * main(argc, argv) - * int argc; - * char *argv[]; - * { - * argc = getredirection(argc, argv); - * } - */ -{ - char *ap; /* Argument pointer */ - int i; /* argv[] index */ - int j; /* Output index */ - int file; /* File_descriptor */ - extern int errno; /* Last vms i/o error */ - - for (j = i = 1; i < argc; i++) { /* Do all arguments */ - switch (*(ap = argv[i])) { - case '<': /* <file */ - if (freopen(++ap, "r", stdin) == NULL) { - perror(ap); /* Can't find file */ - exit(errno); /* Is a fatal error */ - } - break; - - case '>': /* >file or >>file */ - if (*++ap == '>') { /* >>file */ - /* - * If the file exists, and is writable by us, - * call freopen to append to the file (using the - * file's current attributes). Otherwise, create - * a new file with "vanilla" attributes as if the - * argument was given as ">filename". - * access(name, 2) returns zero if we can write on - * the specified file. - */ - if (access(++ap, 2) == 0) { - if (freopen(ap, "a", stdout) != NULL) - break; /* Exit case statement */ - perror(ap); /* Error, can't append */ - exit(errno); /* After access test */ - } /* If file accessible */ - } - /* - * On vms, we want to create the file using "standard" - * record attributes. creat(...) creates the file - * using the caller's default protection mask and - * "variable length, implied carriage return" - * attributes. dup2() associates the file with stdout. - */ - if ((file = creat(ap, 0, "rat=cr", "rfm=var")) == -1 - || dup2(file, fileno(stdout)) == -1) { - perror(ap); /* Can't create file */ - exit(errno); /* is a fatal error */ - } /* If '>' creation */ - break; /* Exit case test */ - - default: - argv[j++] = ap; /* Not a redirector */ - break; /* Exit case test */ - } - } /* For all arguments */ - argv[j] = NULL; /* Terminate argv[] */ - return (j); /* Return new argc */ -} -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/rsc/source/rscpp/cppdef.h b/rsc/source/rscpp/cppdef.h index bd46badf1a80..468cec0a5d16 100644 --- a/rsc/source/rscpp/cppdef.h +++ b/rsc/source/rscpp/cppdef.h @@ -35,7 +35,6 @@ */ #define SYS_UNKNOWN 0 #define SYS_UNIX 1 -#define SYS_VMS 2 #define SYS_RSX 3 #define SYS_RT11 4 #define SYS_LATTICE 5 @@ -46,9 +45,6 @@ #ifdef unix #define HOST SYS_UNIX #else -#ifdef vms -#define HOST SYS_VMS -#else #ifdef rsx #define HOST SYS_RSX #else @@ -58,7 +54,6 @@ #endif #endif #endif -#endif #ifndef HOST #define HOST SYS_UNKNOWN @@ -130,12 +125,6 @@ #define SYSTEM "unix" #endif -#if TARGET == SYS_VMS -#define MACHINE "vax" -#define SYSTEM "vms" -#define COMPILER "vax11c" -#endif - #if TARGET == SYS_RSX #define MACHINE "pdp11" #define SYSTEM "rsx" @@ -235,7 +224,7 @@ /* * OK_DOLLAR enables use of $ as a valid "letter" in identifiers. * This is a permitted extension to the Ansi Standard and is required - * for e.g., VMS, RSX-11M, etc. It should be set FALSE if cpp is + * for e.g., RSX-11M, etc. It should be set FALSE if cpp is * used to preprocess assembler source on Unix systems. OLD_PREPROCESSOR * sets OK_DOLLAR FALSE for that reason. */ |