diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2008-07-31 05:33:56 +0000 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2008-07-31 05:33:56 +0000 |
commit | 7c2fb837ec2f0e0a509f22ccc35f9b43476a6119 (patch) | |
tree | 7ec796ef1f109e43c8be2cc8cfb8dc579cfa8033 /src | |
parent | 69ab3201ca6f6ef1414d678fd9cb13dd4d6f6b95 (diff) | |
download | emacs-7c2fb837ec2f0e0a509f22ccc35f9b43476a6119.tar.gz |
* bitmaps/README:
* xfns.c:
* termcap.c:
* term.c:
* syswait.h:
* systty.h:
* systime.h:
* syssignal.h:
* sysdep.c:
* process.h:
* process.c:
* print.c:
* ndir.h:
* lread.c:
* keyboard.c:
* getpagesize.h:
* floatfns.c:
* fileio.c:
* emacs.c:
* doc.c:
* dispnew.c:
* dired.c:
* data.c:
* callproc.c:
* buffer.c:
* README:
* Makefile.in:
* s/template.h:
* s/msdos.h:
* m/vax.h: Remove VMS support.
* s/vms.h:
* vlimit.h:
* uaf.h:
* temacs.opt:
* param.h:
* ioctl.h: Remove file.
* descrip.mms:
* compile.com: Remove file.
* Create.c: Remove VMS support.
* message.el (Module):
* gnus-start.el (Module):
* gnus-registry.el (Module):
* textmodes/texinfmt.el:
* nxml/nxml-enc.el:
* mail/feedmail.el:
* international/mule.el:
* international/latexenc.el:
* emulation/viper-util.el:
* emulation/viper-init.el:
* emulation/viper-ex.el:
* emacs-lisp/bytecomp.el:
* version.el:
* subr.el:
* startup.el:
* sort.el:
* shadowfile.el:
* recentf.el:
* printing.el:
* paths.el:
* minibuffer.el:
* ls-lisp.el:
* loadup.el:
* hippie-exp.el:
* finder.el:
* files.el:
* ediff-util.el:
* ediff-ptch.el:
* ediff-init.el:
* ediff-diff.el:
* dired.el:
* dired-aux.el:
* cus-edit.el:
* bindings.el:
* arc-mode.el:
* add-log.el: Remove VMS support.
* obsolete/vmsproc.el:
* obsolete/vms-pmail.el:
* obsolete/vms-patch.el: Remove file.
* etags.c:
* emacsclient.c: Remove VMS support.
* termcap.src: Remove file.
* README:
* PROBLEMS:
* MACHINES: Remove VMS info.
* ediff.texi: Remove VMS support.
* os.texi:
* intro.texi:
* files.texi: Remove VMS support.
* emacs.texi: Remove VMS support.
* make-dist:
* README: Remove VMS support.
* vms: Remove directory.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 39 | ||||
-rw-r--r-- | src/Makefile.in | 8 | ||||
-rw-r--r-- | src/README | 17 | ||||
-rw-r--r-- | src/bitmaps/README | 3 | ||||
-rw-r--r-- | src/buffer.c | 2 | ||||
-rw-r--r-- | src/callproc.c | 20 | ||||
-rw-r--r-- | src/data.c | 4 | ||||
-rw-r--r-- | src/dired.c | 84 | ||||
-rw-r--r-- | src/dispnew.c | 30 | ||||
-rw-r--r-- | src/doc.c | 25 | ||||
-rw-r--r-- | src/emacs.c | 84 | ||||
-rw-r--r-- | src/fileio.c | 725 | ||||
-rw-r--r-- | src/floatfns.c | 10 | ||||
-rw-r--r-- | src/getpagesize.h | 4 | ||||
-rw-r--r-- | src/ioctl.h | 4 | ||||
-rw-r--r-- | src/keyboard.c | 37 | ||||
-rw-r--r-- | src/lread.c | 10 | ||||
-rw-r--r-- | src/m/vax.h | 17 | ||||
-rw-r--r-- | src/ndir.h | 17 | ||||
-rw-r--r-- | src/param.h | 5 | ||||
-rw-r--r-- | src/print.c | 39 | ||||
-rw-r--r-- | src/process.c | 127 | ||||
-rw-r--r-- | src/process.h | 2 | ||||
-rw-r--r-- | src/s/msdos.h | 1 | ||||
-rw-r--r-- | src/s/template.h | 8 | ||||
-rw-r--r-- | src/s/vms.h | 192 | ||||
-rw-r--r-- | src/sysdep.c | 2000 | ||||
-rw-r--r-- | src/syssignal.h | 2 | ||||
-rw-r--r-- | src/systime.h | 6 | ||||
-rw-r--r-- | src/systty.h | 47 | ||||
-rw-r--r-- | src/syswait.h | 17 | ||||
-rw-r--r-- | src/temacs.opt | 60 | ||||
-rw-r--r-- | src/term.c | 23 | ||||
-rw-r--r-- | src/termcap.c | 35 | ||||
-rw-r--r-- | src/uaf.h | 298 | ||||
-rw-r--r-- | src/vlimit.h | 5 | ||||
-rw-r--r-- | src/xfns.c | 4 |
37 files changed, 63 insertions, 3948 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 89b730f299d..bb9f3c600a9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,44 @@ 2008-07-31 Dan Nicolaescu <dann@ics.uci.edu> + * bitmaps/README: + * xfns.c: + * termcap.c: + * term.c: + * syswait.h: + * systty.h: + * systime.h: + * syssignal.h: + * sysdep.c: + * process.h: + * process.c: + * print.c: + * ndir.h: + * lread.c: + * keyboard.c: + * getpagesize.h: + * floatfns.c: + * fileio.c: + * emacs.c: + * doc.c: + * dispnew.c: + * dired.c: + * data.c: + * callproc.c: + * buffer.c: + * README: + * Makefile.in: + * s/template.h: + * s/msdos.h: + * m/vax.h: Remove VMS support. + * s/vms.h: + * vlimit.h: + * uaf.h: + * temacs.opt: + * param.h: + * ioctl.h: Remove file. + +2008-07-31 Dan Nicolaescu <dann@ics.uci.edu> + * s/ms-w32.h (MULTI_KBOARD): Remove. * xterm.c: * xselect.c: diff --git a/src/Makefile.in b/src/Makefile.in index 2fe5990a1a5..3536e816422 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -622,12 +622,6 @@ otherobj= $(termcapobj) lastfile.o $(mallocobj) $(widgetobj) $(LIBOBJS) #endif #endif -#ifdef VMS -#define VMS_SUPPORT ${lispsource}vmsproc.elc ${lispsource}vms-patch.elc -#else -#define VMS_SUPPORT -#endif - #ifdef MSDOS #define MSDOS_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc \ ${lispsource}dos-fns.elc ${lispsource}dos-w32.elc ${lispsource}dos-vars.elc \ @@ -762,7 +756,6 @@ lisp= \ ${lispsource}ediff-hook.elc \ ${lispsource}epa-hook.elc \ TOOLTIP_SUPPORT \ - VMS_SUPPORT \ MSDOS_SUPPORT \ WINNT_SUPPORT \ WINDOW_SUPPORT \ @@ -864,7 +857,6 @@ shortlisp= \ for the sake of systems which can''t handle large ones. */ SOME_MACHINE_LISP = ../lisp/mouse.elc \ ../lisp/select.elc ../lisp/scroll-bar.elc \ - VMS_SUPPORT \ ../lisp/ls-lisp.elc ../lisp/dos-fns.elc \ ../lisp/w32-fns.elc ../lisp/dos-w32.elc \ ../lisp/disp-table.elc ../lisp/dos-vars.elc \ diff --git a/src/README b/src/README index 2975b2f982e..ad37bb206fb 100644 --- a/src/README +++ b/src/README @@ -5,8 +5,7 @@ See the end of the file for license conditions. This directory contains the source files for the C component of GNU Emacs. Nothing in this directory is needed for using Emacs once it is built -and installed, if the dumped Emacs (on Unix systems) or the Emacs -executable and map files (on VMS systems) are copied elsewhere. +and installed, if the dumped Emacs (on Unix systems) is copied elsewhere. See the files ../README and then ../INSTALL for installation instructions. @@ -18,20 +17,6 @@ controls the compilation of Emacs. Most of this should work transparently to the user; you should only need to run `../configure', and then type `make'. -See the file VMSBUILD in this directory for instructions on compiling, -linking and building Emacs on VMS. - -The files `*.com' and `temacs.opt' are used on VMS only. -The files `vlimit.h', `ioclt.h' and `param.h' are stubs to -allow compilation on VMS with the minimum amount of #ifdefs. - -`uaf.h' contains VMS uaf structure definitions. This is only needed if -you define READ_SYSUAF. This should only be done for single-user -systems where you are not overly concerned with security, since it -either requires that you install Emacs with SYSPRV or make SYSUAF.DAT -world readable. Otherwise, Emacs can determine information about the -current user, but no one else. - This file is part of GNU Emacs. diff --git a/src/bitmaps/README b/src/bitmaps/README index 016aeb70e1e..2a6e72595cc 100644 --- a/src/bitmaps/README +++ b/src/bitmaps/README @@ -1,6 +1,5 @@ This directory contains bitmap files that Emacs uses from -/usr/include/X11/bitmaps. That directory doesn't seem to exist under -VMS. +/usr/include/X11/bitmaps. COPYRIGHT AND LICENSE INFORMATION diff --git a/src/buffer.c b/src/buffer.c index 2ba21922ab8..a2d0cfac591 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5312,7 +5312,6 @@ init_buffer () if (!pwd) fatal ("`get_current_dir_name' failed: %s\n", strerror (errno)); -#ifndef VMS /* Maybe this should really use some standard subroutine whose definition is filename syntax dependent. */ len = strlen (pwd); @@ -5323,7 +5322,6 @@ init_buffer () pwd[len] = DIRECTORY_SEP; pwd[len + 1] = '\0'; } -#endif /* not VMS */ current_buffer->directory = make_unibyte_string (pwd, strlen (pwd)); if (! NILP (buffer_defaults.enable_multibyte_characters)) diff --git a/src/callproc.c b/src/callproc.c index a6de7668c15..1aad176978e 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -90,13 +90,9 @@ extern int errno; #include "msdos.h" #endif -#ifdef VMS -extern noshare char **environ; -#else #ifndef USE_CRT_DLL extern char **environ; #endif -#endif #ifdef HAVE_SETPGID #if !defined (USG) || defined (BSD_PGRPS) @@ -142,8 +138,6 @@ static int call_process_exited; EXFUN (Fgetenv_internal, 2); -#ifndef VMS /* VMS version is in vmsproc.c. */ - static Lisp_Object call_process_kill (fdpid) Lisp_Object fdpid; @@ -843,7 +837,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) Vlocale_coding_system, 0); return make_number (synch_process_retcode); } -#endif static Lisp_Object delete_temp_file (name) @@ -999,8 +992,6 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r RETURN_UNGCPRO (unbind_to (count, Fcall_process (nargs, args))); } -#ifndef VMS /* VMS version is in vmsproc.c. */ - static int relocate_fd (); static char ** @@ -1448,7 +1439,6 @@ egetenv (var) return 0; } -#endif /* not VMS */ /* This is run before init_cmdargs. */ @@ -1551,16 +1541,9 @@ init_callproc () dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n", Vdata_directory); -#ifdef VMS - Vshell_file_name = build_string ("*dcl*"); -#else sh = (char *) getenv ("SHELL"); Vshell_file_name = build_string (sh ? sh : "/bin/sh"); -#endif -#ifdef VMS - Vtemp_file_name_pattern = build_string ("tmp:emacsXXXXXX."); -#else if (getenv ("TMPDIR")) { char *dir = getenv ("TMPDIR"); @@ -1570,7 +1553,6 @@ init_callproc () } else Vtemp_file_name_pattern = build_string ("/tmp/emacsXXXXXX"); -#endif #ifdef DOS_NT Vshared_game_score_directory = Qnil; @@ -1686,10 +1668,8 @@ use. See `setenv' and `getenv'. */); Vprocess_environment = Qnil; -#ifndef VMS defsubr (&Scall_process); defsubr (&Sgetenv_internal); -#endif defsubr (&Scall_process_region); } diff --git a/src/data.c b/src/data.c index ab52c20c77f..54c0d7c211c 100644 --- a/src/data.c +++ b/src/data.c @@ -3271,10 +3271,6 @@ arith_error (signo) must reestablish each time */ signal (signo, arith_error); #endif /* USG */ -#ifdef VMS - /* VMS systems are like USG. */ - signal (signo, arith_error); -#endif /* VMS */ sigsetmask (SIGEMPTYMASK); SIGNAL_THREAD_CHECK (signo); diff --git a/src/dired.c b/src/dired.c index 2d82c4bfdc3..5e82fef0df2 100644 --- a/src/dired.c +++ b/src/dired.c @@ -27,18 +27,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_PWD_H #include <pwd.h> #endif -#ifndef VMS #include <grp.h> -#endif #include <errno.h> -#ifdef VMS -#include <string.h> -#include <rms.h> -#include <rmsdef.h> -#endif - #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -62,15 +54,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #else /* not SYSV_SYSTEM_DIR */ -#ifdef NONSYSTEM_DIR_LIBRARY -#include "ndir.h" -#else /* not NONSYSTEM_DIR_LIBRARY */ #ifdef MSDOS #include <dirent.h> #else #include <sys/dir.h> #endif -#endif /* not NONSYSTEM_DIR_LIBRARY */ #include <sys/stat.h> @@ -174,10 +162,6 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) compile_pattern to do the work for us. */ /* Pass 1 for the MULTIBYTE arg because we do make multibyte strings if the contents warrant. */ -#ifdef VMS - bufp = compile_pattern (match, 0, - buffer_defaults.downcase_table, 0, 1); -#else /* !VMS */ # ifdef WINDOWSNT /* Windows users want case-insensitive wildcards. */ bufp = compile_pattern (match, 0, @@ -185,7 +169,6 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) # else /* !WINDOWSNT */ bufp = compile_pattern (match, 0, Qnil, 0, 1); # endif /* !WINDOWSNT */ -#endif /* !VMS */ } /* Note: ENCODE_FILE and DECODE_FILE can GC because they can run @@ -215,11 +198,9 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) re_match_object = Qt; /* Decide whether we need to add a directory separator. */ -#ifndef VMS if (directory_nbytes == 0 || !IS_ANY_SEP (SREF (directory, directory_nbytes - 1))) needsep = 1; -#endif /* not VMS */ /* Loop reading blocks until EOF or error. */ for (;;) @@ -483,21 +464,7 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate) elt = Qnil; -#ifdef VMS - extern DIRENTRY * readdirver (); - - DIRENTRY *((* readfunc) ()); - - /* Filename completion on VMS ignores case, since VMS filesys does. */ - specbind (Qcompletion_ignore_case, Qt); - - readfunc = readdir; - if (ver_flag) - readfunc = readdirver; - file = Fupcase (file); -#else /* not VMS */ CHECK_STRING (file); -#endif /* not VMS */ #ifdef FILE_SYSTEM_CASE file = FILE_SYSTEM_CASE (file); @@ -535,9 +502,6 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate) int len; int canexclude = 0; -#ifdef VMS - dp = (*readfunc) (d); -#else errno = 0; dp = readdir (d); if (dp == NULL && (0 @@ -549,7 +513,6 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate) # endif )) { QUIT; continue; } -#endif if (!dp) break; @@ -830,10 +793,8 @@ file_name_completion_stat (dirname, dp, st_addr) #endif /* MSDOS */ bcopy (SDATA (dirname), fullname, pos); -#ifndef VMS if (!IS_DIRECTORY_SEP (fullname[pos - 1])) fullname[pos++] = DIRECTORY_SEP; -#endif bcopy (dp->d_name, fullname + pos, len); fullname[pos + len] = 0; @@ -856,47 +817,6 @@ file_name_completion_stat (dirname, dp, st_addr) #endif /* S_IFLNK */ } -#ifdef VMS - -DEFUN ("file-name-all-versions", Ffile_name_all_versions, - Sfile_name_all_versions, 2, 2, 0, - doc: /* Return a list of all versions of file name FILE in directory DIRECTORY. */) - (file, directory) - Lisp_Object file, directory; -{ - return file_name_completion (file, directory, 1, 1, Qnil); -} - -DEFUN ("file-version-limit", Ffile_version_limit, Sfile_version_limit, 1, 1, 0, - doc: /* Return the maximum number of versions allowed for FILE. -Returns nil if the file cannot be opened or if there is no version limit. */) - (filename) - Lisp_Object filename; -{ - Lisp_Object retval; - struct FAB fab; - struct RAB rab; - struct XABFHC xabfhc; - int status; - - filename = Fexpand_file_name (filename, Qnil); - fab = cc$rms_fab; - xabfhc = cc$rms_xabfhc; - fab.fab$l_fna = SDATA (filename); - fab.fab$b_fns = strlen (fab.fab$l_fna); - fab.fab$l_xab = (char *) &xabfhc; - status = sys$open (&fab, 0, 0); - if (status != RMS$_NORMAL) /* Probably non-existent file */ - return Qnil; - sys$close (&fab, 0, 0); - if (xabfhc.xab$w_verlimit == 32767) - return Qnil; /* No version limit */ - else - return make_number (xabfhc.xab$w_verlimit); -} - -#endif /* VMS */ - Lisp_Object make_time (time) time_t time; @@ -1132,10 +1052,6 @@ syms_of_dired () defsubr (&Sdirectory_files); defsubr (&Sdirectory_files_and_attributes); defsubr (&Sfile_name_completion); -#ifdef VMS - defsubr (&Sfile_name_all_versions); - defsubr (&Sfile_version_limit); -#endif /* VMS */ defsubr (&Sfile_name_all_completions); defsubr (&Sfile_attributes); defsubr (&Sfile_attributes_lessp); diff --git a/src/dispnew.c b/src/dispnew.c index 4c55f2e7adb..e3e73919fe4 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6836,12 +6836,7 @@ init_display () if (! inhibit_window_system && ! display_arg) { char *display; -#ifdef VMS - display = getenv ("DECW$DISPLAY"); -#else display = getenv ("DISPLAY"); -#endif - display_arg = (display != 0 && *display != 0); if (display_arg && !x_display_ok (display)) @@ -6912,40 +6907,15 @@ init_display () #endif if (!terminal_type) { -#ifdef VMS - fprintf (stderr, "Please specify your terminal type.\n\ -For types defined in VMS, use set term /device=TYPE.\n\ -For types not defined in VMS, use define emacs_term \"TYPE\".\n\ -\(The quotation marks are necessary since terminal types are lower case.)\n"); -#else /* not VMS */ - #ifdef HAVE_WINDOW_SYSTEM if (! inhibit_window_system) fprintf (stderr, "Please set the environment variable DISPLAY or TERM (see `tset').\n"); else #endif /* HAVE_WINDOW_SYSTEM */ fprintf (stderr, "Please set the environment variable TERM; see `tset'.\n"); -#endif /* not VMS */ exit (1); } -#ifdef VMS - /* VMS DCL tends to up-case things, so down-case term type. - Hardly any uppercase letters in terminal types; should be none. */ - { - char *new = (char *) xmalloc (strlen (terminal_type) + 1); - char *p; - - strcpy (new, terminal_type); - - for (p = new; *p; p++) - if (isupper (*p)) - *p = tolower (*p); - - terminal_type = new; - } -#endif /* VMS */ - { struct terminal *t; struct frame *f = XFRAME (selected_frame); diff --git a/src/doc.c b/src/doc.c index 433a6109afc..7f9ab5d3b38 100644 --- a/src/doc.c +++ b/src/doc.c @@ -58,28 +58,6 @@ extern Lisp_Object Voverriding_local_map; extern Lisp_Object Qremap; -/* For VMS versions with limited file name syntax, - convert the name to something VMS will allow. */ -static void -munge_doc_file_name (name) - char *name; -{ -#ifdef VMS -#ifndef NO_HYPHENS_IN_FILENAMES - extern char * sys_translate_unix (char *ufile); - strcpy (name, sys_translate_unix (name)); -#else /* NO_HYPHENS_IN_FILENAMES */ - char *p = name; - while (*p) - { - if (*p == '-') - *p = '_'; - p++; - } -#endif /* NO_HYPHENS_IN_FILENAMES */ -#endif /* VMS */ -} - /* Buffer used for reading from documentation file. */ static char *get_doc_string_buffer; static int get_doc_string_buffer_size; @@ -169,7 +147,6 @@ get_doc_string (filepos, unibyte, definition) name = (char *) alloca (minsize + SCHARS (file) + 8); strcpy (name, SDATA (Vdoc_directory)); strcat (name, SDATA (file)); - munge_doc_file_name (name); } else { @@ -186,7 +163,6 @@ get_doc_string (filepos, unibyte, definition) So check in ../etc. */ strcpy (name, "../etc/"); strcat (name, SDATA (file)); - munge_doc_file_name (name); fd = emacs_open (name, O_RDONLY, 0); } @@ -618,7 +594,6 @@ the same file name is found in the `doc-directory'. */) strcpy (name, SDATA (Vdoc_directory)); } strcat (name, SDATA (filename)); /*** Add this line ***/ - munge_doc_file_name (name); /* Vbuild_files is nil when temacs is run, and non-nil after that. */ if (NILP (Vbuild_files)) diff --git a/src/emacs.c b/src/emacs.c index 9d1e69f600f..ece0e41487d 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -27,10 +27,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <sys/types.h> #include <sys/file.h> -#ifdef VMS -#include <ssdef.h> -#endif - #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -378,9 +374,6 @@ fatal_error_signal (sig) shut_down_emacs (sig, 0, Qnil); } -#ifdef VMS - LIB$STOP (SS$_ABORT); -#else /* Signal the same code; this time it will really be fatal. Remember that since we're in a signal handler, the signal we're going to send is probably blocked, so we have to unblock it if we @@ -393,7 +386,6 @@ fatal_error_signal (sig) fatal_error_signal_hook (); kill (getpid (), fatal_error_code); -#endif /* not VMS */ } #ifdef SIGDANGER @@ -591,14 +583,6 @@ DEFUN ("invocation-directory", Finvocation_directory, Sinvocation_directory, } -#ifdef VMS -#ifdef LINK_CRTL_SHARE -#ifdef SHARABLE_LIB_BUG -extern noshare char **environ; -#endif /* SHARABLE_LIB_BUG */ -#endif /* LINK_CRTL_SHARE */ -#endif /* VMS */ - #ifdef HAVE_TZSET /* A valid but unlikely value for the TZ environment value. It is OK (though a bit slower) if the user actually chooses this value. */ @@ -785,16 +769,7 @@ bug_reporting_address () /* ARGSUSED */ int -main (argc, argv -#ifdef VMS -, envp -#endif -) - int argc; - char **argv; -#ifdef VMS - char **envp; -#endif +main (int argc, char **argv) { #if GC_MARK_STACK Lisp_Object dummy; @@ -921,29 +896,6 @@ main (argc, argv } #endif -#ifdef VMS - /* If -map specified, map the data file in. */ - { - char *file; - if (argmatch (argv, argc, "-map", "--map-data", 3, &file, &skip_args)) - mapin_data (file); - } - -#ifdef LINK_CRTL_SHARE -#ifdef SHARABLE_LIB_BUG - /* Bletcherous shared libraries! */ - if (!stdin) - stdin = fdopen (0, "r"); - if (!stdout) - stdout = fdopen (1, "w"); - if (!stderr) - stderr = fdopen (2, "w"); - if (!environ) - environ = envp; -#endif /* SHARABLE_LIB_BUG */ -#endif /* LINK_CRTL_SHARE */ -#endif /* VMS */ - #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK) /* Extend the stack space available. Don't do that if dumping, since some systems (e.g. DJGPP) @@ -1565,9 +1517,6 @@ main (argc, argv #endif syms_of_textprop (); syms_of_composite (); -#ifdef VMS - syms_of_vmsproc (); -#endif /* VMS */ #ifdef WINDOWSNT syms_of_ntproc (); #endif /* WINDOWSNT */ @@ -1644,16 +1593,8 @@ main (argc, argv init_editfns (); /* init_process uses Voperating_system_release. */ init_process (); /* init_display uses add_keyboard_wait_descriptor. */ init_keyboard (); /* This too must precede init_sys_modes. */ -#ifdef VMS - init_vmsproc (); /* And this too. */ -#endif /* VMS */ if (!noninteractive) - { -#ifdef VMS - init_vms_input ();/* init_display calls get_tty_size, that needs this. */ -#endif /* VMS */ - init_display (); /* Determine terminal type. Calls init_sys_modes. */ - } + init_display (); /* Determine terminal type. Calls init_sys_modes. */ init_fns (); init_xdisp (); #ifdef HAVE_WINDOW_SYSTEM @@ -1662,9 +1603,6 @@ main (argc, argv #endif /* HAVE_WINDOW_SYSTEM */ init_macros (); init_floatfns (); -#ifdef VMS - init_vmsfns (); -#endif /* VMS */ #ifdef HAVE_SOUND init_sound (); #endif @@ -1770,9 +1708,6 @@ struct standard_args standard_args[] = #ifdef HAVE_SHM { "-nl", "--no-shared-memory", 140, 0 }, #endif -#ifdef VMS - { "-map", "--map-data", 130, 0 }, -#endif { "-t", "--terminal", 120, 1 }, { "-nw", "--no-window-system", 110, 0 }, { "-nw", "--no-windows", 110, 0 }, @@ -2051,12 +1986,6 @@ all of which are called before Emacs is actually killed. */) UNGCPRO; -/* Is it really necessary to do this deassign - when we are going to exit anyway? */ -/* #ifdef VMS - stop_vms_input (); - #endif */ - shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil); /* If we have an auto-save list file, @@ -2124,10 +2053,6 @@ shut_down_emacs (sig, no_x, stuff) unlock_all_files (); #endif -#ifdef VMS - kill_vms_processes (); -#endif - #if 0 /* This triggers a bug in XCloseDisplay and is not needed. */ #ifdef HAVE_X_WINDOWS /* It's not safe to call intern here. Maybe we are crashing. */ @@ -2264,9 +2189,6 @@ You must run Emacs in batch mode in order to dump it. */) #endif fflush (stdout); -#ifdef VMS - mapout_data (SDATA (filename)); -#else /* Tell malloc where start of impure now is. */ /* Also arrange for warnings when nearly out of space. */ #ifndef SYSTEM_MALLOC @@ -2297,7 +2219,6 @@ You must run Emacs in batch mode in order to dump it. */) #ifdef DOUG_LEA_MALLOC free (malloc_state_ptr); #endif -#endif /* not VMS */ Vpurify_flag = tem; @@ -2455,7 +2376,6 @@ Special values: `ms-dos' compiled as an MS-DOS application. `windows-nt' compiled as a native W32 application. `cygwin' compiled using the Cygwin library. - `vax-vms' compiled for a (Open)VMS system. Anything else indicates some sort of Unix system. */); Vsystem_type = intern (SYSTEM_TYPE); diff --git a/src/fileio.c b/src/fileio.c index 918c06fdced..69eac9a7e98 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -50,14 +50,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #endif #include <ctype.h> - -#ifdef VMS -#include "vmsdir.h" -#include <perror.h> -#include <stddef.h> -#include <string.h> -#endif - #include <errno.h> #ifndef vax11c @@ -111,13 +103,6 @@ extern int errno; #define DRIVE_LETTER(x) (tolower (x)) #endif -#ifdef VMS -#include <file.h> -#include <rmsdef.h> -#include <fab.h> -#include <nam.h> -#endif - #include "systime.h" #ifdef HPUX @@ -200,10 +185,6 @@ Lisp_Object Vwrite_region_annotations_so_far; /* File name in which we write a list of all our auto save files. */ Lisp_Object Vauto_save_list_file_name; -/* On VMS, nonzero means write new files with record format stmlf. - Zero means use var format. */ -int vms_stmlf_recfm; - /* On NT, specifies the directory separator character, used (eg.) when expanding file names. This can be bound to / or \. */ Lisp_Object Vdirectory_sep_char; @@ -404,8 +385,7 @@ DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory, doc: /* Return the directory component in file name FILENAME. Return nil if FILENAME does not include a directory. Otherwise return a directory name. -Given a Unix syntax file name, returns a string ending in slash; -on VMS, perhaps instead a string ending in `:', `]' or `>'. */) +Given a Unix syntax file name, returns a string ending in slash. */) (filename) Lisp_Object filename; { @@ -433,9 +413,6 @@ on VMS, perhaps instead a string ending in `:', `]' or `>'. */) p = beg + SBYTES (filename); while (p != beg && !IS_DIRECTORY_SEP (p[-1]) -#ifdef VMS - && p[-1] != ':' && p[-1] != ']' && p[-1] != '>' -#endif /* VMS */ #ifdef DOS_NT /* only recognise drive specifier at the beginning */ && !(p[-1] == ':' @@ -500,9 +477,6 @@ or the entire name if it contains no slash. */) end = p = beg + SBYTES (filename); while (p != beg && !IS_DIRECTORY_SEP (p[-1]) -#ifdef VMS - && p[-1] != ':' && p[-1] != ']' && p[-1] != '>' -#endif /* VMS */ #ifdef DOS_NT /* only recognise drive specifier at beginning */ && !(p[-1] == ':' @@ -557,64 +531,6 @@ file_name_as_directory (out, in) return out; } -#ifdef VMS - /* Is it already a directory string? */ - if (in[size] == ':' || in[size] == ']' || in[size] == '>') - return out; - /* Is it a VMS directory file name? If so, hack VMS syntax. */ - else if (! index (in, '/') - && ((size > 3 && ! strcmp (&in[size - 3], ".DIR")) - || (size > 3 && ! strcmp (&in[size - 3], ".dir")) - || (size > 5 && (! strncmp (&in[size - 5], ".DIR", 4) - || ! strncmp (&in[size - 5], ".dir", 4)) - && (in[size - 1] == '.' || in[size - 1] == ';') - && in[size] == '1'))) - { - register char *p, *dot; - char brack; - - /* x.dir -> [.x] - dir:x.dir --> dir:[x] - dir:[x]y.dir --> dir:[x.y] */ - p = in + size; - while (p != in && *p != ':' && *p != '>' && *p != ']') p--; - if (p != in) - { - strncpy (out, in, p - in); - out[p - in] = '\0'; - if (*p == ':') - { - brack = ']'; - strcat (out, ":["); - } - else - { - brack = *p; - strcat (out, "."); - } - p++; - } - else - { - brack = ']'; - strcpy (out, "[."); - } - dot = index (p, '.'); - if (dot) - { - /* blindly remove any extension */ - size = strlen (out) + (dot - p); - strncat (out, p, dot - p); - } - else - { - strcat (out, p); - size = strlen (out); - } - out[size++] = brack; - out[size] = '\0'; - } -#else /* not VMS */ /* For Unix syntax, Append a slash if necessary */ if (!IS_DIRECTORY_SEP (out[size])) { @@ -625,7 +541,6 @@ file_name_as_directory (out, in) #ifdef DOS_NT CORRECT_DIR_SEPS (out); #endif -#endif /* not VMS */ return out; } @@ -636,8 +551,7 @@ This operation exists because a directory is also a file, but its name as a directory is different from its name as a file. The result can be used as the value of `default-directory' or passed as second argument to `expand-file-name'. -For a Unix-syntax file name, just appends a slash. -On VMS, converts \"[X]FOO.DIR\" to \"[X.FOO]\", etc. */) +For a Unix-syntax file name, just appends a slash. */) (file) Lisp_Object file; { @@ -662,9 +576,6 @@ On VMS, converts \"[X]FOO.DIR\" to \"[X.FOO]\", etc. */) /* * Convert from directory name to filename. - * On VMS: - * xyzzy:[mukesh.emacs] => xyzzy:[mukesh]emacs.dir.1 - * xyzzy:[mukesh] => xyzzy:[000000]mukesh.dir.1 * On UNIX, it's simple: just make sure there isn't a terminating / * Value is nonzero if the string output is different from the input. @@ -675,130 +586,9 @@ directory_file_name (src, dst) char *src, *dst; { long slen; -#ifdef VMS - long rlen; - char * ptr, * rptr; - char bracket; - struct FAB fab = cc$rms_fab; - struct NAM nam = cc$rms_nam; - char esa[NAM$C_MAXRSS]; -#endif /* VMS */ slen = strlen (src); -#ifdef VMS - if (! index (src, '/') - && (src[slen - 1] == ']' - || src[slen - 1] == ':' - || src[slen - 1] == '>')) - { - /* VMS style - convert [x.y.z] to [x.y]z, [x] to [000000]x */ - fab.fab$l_fna = src; - fab.fab$b_fns = slen; - fab.fab$l_nam = &nam; - fab.fab$l_fop = FAB$M_NAM; - - nam.nam$l_esa = esa; - nam.nam$b_ess = sizeof esa; - nam.nam$b_nop |= NAM$M_SYNCHK; - - /* We call SYS$PARSE to handle such things as [--] for us. */ - if (SYS$PARSE (&fab, 0, 0) == RMS$_NORMAL) - { - slen = nam.nam$b_esl; - if (esa[slen - 1] == ';' && esa[slen - 2] == '.') - slen -= 2; - esa[slen] = '\0'; - src = esa; - } - if (src[slen - 1] != ']' && src[slen - 1] != '>') - { - /* what about when we have logical_name:???? */ - if (src[slen - 1] == ':') - { /* Xlate logical name and see what we get */ - ptr = strcpy (dst, src); /* upper case for getenv */ - while (*ptr) - { - if ('a' <= *ptr && *ptr <= 'z') - *ptr -= 040; - ptr++; - } - dst[slen - 1] = 0; /* remove colon */ - if (!(src = egetenv (dst))) - return 0; - /* should we jump to the beginning of this procedure? - Good points: allows us to use logical names that xlate - to Unix names, - Bad points: can be a problem if we just translated to a device - name... - For now, I'll punt and always expect VMS names, and hope for - the best! */ - slen = strlen (src); - if (src[slen - 1] != ']' && src[slen - 1] != '>') - { /* no recursion here! */ - strcpy (dst, src); - return 0; - } - } - else - { /* not a directory spec */ - strcpy (dst, src); - return 0; - } - } - bracket = src[slen - 1]; - - /* If bracket is ']' or '>', bracket - 2 is the corresponding - opening bracket. */ - ptr = index (src, bracket - 2); - if (ptr == 0) - { /* no opening bracket */ - strcpy (dst, src); - return 0; - } - if (!(rptr = rindex (src, '.'))) - rptr = ptr; - slen = rptr - src; - strncpy (dst, src, slen); - dst[slen] = '\0'; - if (*rptr == '.') - { - dst[slen++] = bracket; - dst[slen] = '\0'; - } - else - { - /* If we have the top-level of a rooted directory (i.e. xx:[000000]), - then translate the device and recurse. */ - if (dst[slen - 1] == ':' - && dst[slen - 2] != ':' /* skip decnet nodes */ - && strcmp (src + slen, "[000000]") == 0) - { - dst[slen - 1] = '\0'; - if ((ptr = egetenv (dst)) - && (rlen = strlen (ptr) - 1) > 0 - && (ptr[rlen] == ']' || ptr[rlen] == '>') - && ptr[rlen - 1] == '.') - { - char * buf = (char *) alloca (strlen (ptr) + 1); - strcpy (buf, ptr); - buf[rlen - 1] = ']'; - buf[rlen] = '\0'; - return directory_file_name (buf, dst); - } - else - dst[slen - 1] = ':'; - } - strcat (dst, "[000000]"); - slen += 8; - } - rptr++; - rlen = strlen (rptr) - 1; - strncat (dst, rptr, rlen); - dst[slen + rlen] = '\0'; - strcat (dst, ".DIR.1"); - return 1; - } -#endif /* VMS */ + /* Process as Unix format: just remove any final slash. But leave "/" unchanged; do not change it to "". */ strcpy (dst, src); @@ -821,9 +611,7 @@ DEFUN ("directory-file-name", Fdirectory_file_name, Sdirectory_file_name, This is the name of the file that holds the data for the directory DIRECTORY. This operation exists because a directory is also a file, but its name as a directory is different from its name as a file. -In Unix-syntax, this function just removes the final slash. -On VMS, given a VMS-syntax directory name such as \"[X.Y]\", -it returns a file name such as \"[X]Y.DIR.1\". */) +In Unix-syntax, this function just removes the final slash. */) (directory) Lisp_Object directory; { @@ -841,14 +629,7 @@ it returns a file name such as \"[X]Y.DIR.1\". */) if (!NILP (handler)) return call2 (handler, Qdirectory_file_name, directory); -#ifdef VMS - /* 20 extra chars is insufficient for VMS, since we might perform a - logical name translation. an equivalence string can be up to 255 - chars long, so grab that much extra space... - sss */ - buf = (char *) alloca (SBYTES (directory) + 20 + 255); -#else buf = (char *) alloca (SBYTES (directory) + 20); -#endif directory_file_name (SDATA (directory), buf); return make_specified_string (buf, -1, strlen (buf), STRING_MULTIBYTE (directory)); @@ -1038,14 +819,6 @@ See also the function `substitute-in-file-name'. */) int tlen; struct passwd *pw; -#ifdef VMS - unsigned char * colon = 0; - unsigned char * close = 0; - unsigned char * slash = 0; - unsigned char * brack = 0; - int lbrack = 0, rbrack = 0; - int dots = 0; -#endif /* VMS */ #ifdef DOS_NT int drive = 0; int collapse_newdir = 1; @@ -1196,9 +969,6 @@ See also the function `substitute-in-file-name'. */) #ifdef WINDOWSNT && (drive || IS_DIRECTORY_SEP (nm[1])) && !is_escaped #endif -#ifdef VMS - || index (nm, ':') -#endif /* VMS */ ) { /* If it turns out that the filename we want to return is just a @@ -1229,92 +999,10 @@ See also the function `substitute-in-file-name'. */) && IS_DIRECTORY_SEP (p[0]) && IS_DIRECTORY_SEP (p[1])) lose = 1; - -#ifdef VMS - if (p[0] == '\\') - lose = 1; - if (p[0] == '/') { - /* if dev:[dir]/, move nm to / */ - if (!slash && p > nm && (brack || colon)) { - nm = (brack ? brack + 1 : colon + 1); - lbrack = rbrack = 0; - brack = 0; - colon = 0; - } - slash = p; - } - if (p[0] == '-') -#ifdef NO_HYPHENS_IN_FILENAMES - if (lbrack == rbrack) - { - /* Avoid clobbering negative version numbers. */ - if (dots < 2) - p[0] = '_'; - } - else -#endif /* NO_HYPHENS_IN_FILENAMES */ - if (lbrack > rbrack - && ((p[-1] == '.' || p[-1] == '[' || p[-1] == '<') - && (p[1] == '.' || p[1] == ']' || p[1] == '>'))) - lose = 1; -#ifdef NO_HYPHENS_IN_FILENAMES - else - p[0] = '_'; -#endif /* NO_HYPHENS_IN_FILENAMES */ - /* count open brackets, reset close bracket pointer */ - if (p[0] == '[' || p[0] == '<') - lbrack++, brack = 0; - /* count close brackets, set close bracket pointer */ - if (p[0] == ']' || p[0] == '>') - rbrack++, brack = p; - /* detect ][ or >< */ - if ((p[0] == ']' || p[0] == '>') && (p[1] == '[' || p[1] == '<')) - lose = 1; - if ((p[0] == ':' || p[0] == ']' || p[0] == '>') && p[1] == '~') - nm = p + 1, lose = 1; - if (p[0] == ':' && (colon || slash)) - /* if dev1:[dir]dev2:, move nm to dev2: */ - if (brack) - { - nm = brack + 1; - brack = 0; - } - /* if /name/dev:, move nm to dev: */ - else if (slash) - nm = slash + 1; - /* if node::dev:, move colon following dev */ - else if (colon && colon[-1] == ':') - colon = p; - /* if dev1:dev2:, move nm to dev2: */ - else if (colon && colon[-1] != ':') - { - nm = colon + 1; - colon = 0; - } - if (p[0] == ':' && !colon) - { - if (p[1] == ':') - p++; - colon = p; - } - if (lbrack == rbrack) - if (p[0] == ';') - dots = 2; - else if (p[0] == '.') - dots++; -#endif /* VMS */ p++; } if (!lose) { -#ifdef VMS - if (index (nm, '/')) - { - nm = sys_translate_unix (nm); - nm_in_name = 0; - return make_specified_string (nm, -1, strlen (nm), multibyte); - } -#endif /* VMS */ #ifdef DOS_NT /* Make sure directories are all separated with / or \ as desired, but avoid allocation of a new string when not @@ -1367,9 +1055,6 @@ See also the function `substitute-in-file-name'. */) if (nm[0] == '~') /* prefix ~ */ { if (IS_DIRECTORY_SEP (nm[1]) -#ifdef VMS - || nm[1] == ':' -#endif /* VMS */ || nm[1] == 0) /* ~ by itself */ { Lisp_Object tem; @@ -1393,18 +1078,11 @@ See also the function `substitute-in-file-name'. */) #ifdef DOS_NT collapse_newdir = 0; #endif -#ifdef VMS - nm++; /* Don't leave the slash in nm. */ -#endif /* VMS */ } else /* ~user/filename */ { unsigned char *o, *p; - for (p = nm; *p && (!IS_DIRECTORY_SEP (*p) -#ifdef VMS - && *p != ':' -#endif /* VMS */ - ); p++); + for (p = nm; *p && (!IS_DIRECTORY_SEP (*p)); p++); o = alloca (p - nm + 1); bcopy ((char *) nm, o, p - nm); o [p - nm] = 0; @@ -1415,14 +1093,10 @@ See also the function `substitute-in-file-name'. */) if (pw) { newdir = (unsigned char *) pw -> pw_dir; -#ifdef VMS - nm = p + 1; /* skip the terminator */ -#else nm = p; #ifdef DOS_NT collapse_newdir = 0; #endif -#endif /* VMS */ } /* If we don't find a user of that name, leave the name @@ -1465,9 +1139,6 @@ See also the function `substitute-in-file-name'. */) #ifdef WINDOWSNT && !(IS_DIRECTORY_SEP (nm[0]) && IS_DIRECTORY_SEP (nm[1])) #endif -#ifdef VMS - && !index (nm, ':') -#endif && !newdir) { newdir = SDATA (default_directory); @@ -1588,7 +1259,6 @@ See also the function `substitute-in-file-name'. */) if (newdir) { -#ifndef VMS if (nm[0] == 0 || IS_DIRECTORY_SEP (nm[0])) { #ifdef DOS_NT @@ -1603,69 +1273,19 @@ See also the function `substitute-in-file-name'. */) strcpy (target, newdir); } else -#endif file_name_as_directory (target, newdir); } strcat (target, nm); -#ifdef VMS - if (index (target, '/')) - strcpy (target, sys_translate_unix (target)); -#endif /* VMS */ - - /* ASSERT (IS_DIRECTORY_SEP (target[0])) if not VMS */ /* Now canonicalize by removing `//', `/.' and `/foo/..' if they appear. */ - { unsigned char *p = target; unsigned char *o = target; while (*p) { -#ifdef VMS - if (*p != ']' && *p != '>' && *p != '-') - { - if (*p == '\\') - p++; - *o++ = *p++; - } - else if ((p[0] == ']' || p[0] == '>') && p[0] == p[1] + 2) - /* brackets are offset from each other by 2 */ - { - p += 2; - if (*p != '.' && *p != '-' && o[-1] != '.') - /* convert [foo][bar] to [bar] */ - while (o[-1] != '[' && o[-1] != '<') - o--; - else if (*p == '-' && *o != '.') - *--p = '.'; - } - else if (p[0] == '-' && o[-1] == '.' - && (p[1] == '.' || p[1] == ']' || p[1] == '>')) - /* flush .foo.- ; leave - if stopped by '[' or '<' */ - { - do - o--; - while (o[-1] != '.' && o[-1] != '[' && o[-1] != '<'); - if (p[1] == '.') /* foo.-.bar ==> bar. */ - p += 2; - else if (o[-1] == '.') /* '.foo.-]' ==> ']' */ - p++, o--; - /* else [foo.-] ==> [-] */ - } - else - { -#ifdef NO_HYPHENS_IN_FILENAMES - if (*p == '-' - && o[-1] != '[' && o[-1] != '<' && o[-1] != '.' - && p[1] != ']' && p[1] != '>' && p[1] != '.') - *p = '_'; -#endif /* NO_HYPHENS_IN_FILENAMES */ - *o++ = *p++; - } -#else /* not VMS */ if (!IS_DIRECTORY_SEP (*p)) { *o++ = *p++; @@ -1707,7 +1327,6 @@ See also the function `substitute-in-file-name'. */) { *o++ = *p++; } -#endif /* not VMS */ } #ifdef DOS_NT @@ -1777,32 +1396,13 @@ See also the function `substitute-in-file-name'.") unsigned char *target; struct passwd *pw; int lose; -#ifdef VMS - unsigned char * colon = 0; - unsigned char * close = 0; - unsigned char * slash = 0; - unsigned char * brack = 0; - int lbrack = 0, rbrack = 0; - int dots = 0; -#endif /* VMS */ CHECK_STRING (name); - -#ifdef VMS - /* Filenames on VMS are always upper case. */ - name = Fupcase (name); -#endif - nm = SDATA (name); /* If nm is absolute, flush ...// and detect /./ and /../. If no /./ or /../ we can return right away. */ - if ( - nm[0] == '/' -#ifdef VMS - || index (nm, ':') -#endif /* VMS */ - ) + if (nm[0] == '/') { p = nm; lose = 0; @@ -1817,87 +1417,10 @@ See also the function `substitute-in-file-name'.") && (p[2] == '/' || p[2] == 0 || (p[2] == '.' && (p[3] == '/' || p[3] == 0)))) lose = 1; -#ifdef VMS - if (p[0] == '\\') - lose = 1; - if (p[0] == '/') { - /* if dev:[dir]/, move nm to / */ - if (!slash && p > nm && (brack || colon)) { - nm = (brack ? brack + 1 : colon + 1); - lbrack = rbrack = 0; - brack = 0; - colon = 0; - } - slash = p; - } - if (p[0] == '-') -#ifndef VMS4_4 - /* VMS pre V4.4,convert '-'s in filenames. */ - if (lbrack == rbrack) - { - if (dots < 2) /* this is to allow negative version numbers */ - p[0] = '_'; - } - else -#endif /* VMS4_4 */ - if (lbrack > rbrack - && ((p[-1] == '.' || p[-1] == '[' || p[-1] == '<') - && (p[1] == '.' || p[1] == ']' || p[1] == '>'))) - lose = 1; -#ifndef VMS4_4 - else - p[0] = '_'; -#endif /* VMS4_4 */ - /* count open brackets, reset close bracket pointer */ - if (p[0] == '[' || p[0] == '<') - lbrack++, brack = 0; - /* count close brackets, set close bracket pointer */ - if (p[0] == ']' || p[0] == '>') - rbrack++, brack = p; - /* detect ][ or >< */ - if ((p[0] == ']' || p[0] == '>') && (p[1] == '[' || p[1] == '<')) - lose = 1; - if ((p[0] == ':' || p[0] == ']' || p[0] == '>') && p[1] == '~') - nm = p + 1, lose = 1; - if (p[0] == ':' && (colon || slash)) - /* if dev1:[dir]dev2:, move nm to dev2: */ - if (brack) - { - nm = brack + 1; - brack = 0; - } - /* If /name/dev:, move nm to dev: */ - else if (slash) - nm = slash + 1; - /* If node::dev:, move colon following dev */ - else if (colon && colon[-1] == ':') - colon = p; - /* If dev1:dev2:, move nm to dev2: */ - else if (colon && colon[-1] != ':') - { - nm = colon + 1; - colon = 0; - } - if (p[0] == ':' && !colon) - { - if (p[1] == ':') - p++; - colon = p; - } - if (lbrack == rbrack) - if (p[0] == ';') - dots = 2; - else if (p[0] == '.') - dots++; -#endif /* VMS */ p++; } if (!lose) { -#ifdef VMS - if (index (nm, '/')) - return build_string (sys_translate_unix (nm)); -#endif /* VMS */ if (nm == SDATA (name)) return name; return build_string (nm); @@ -1909,18 +1432,11 @@ See also the function `substitute-in-file-name'.") newdir = 0; if (nm[0] == '~') /* prefix ~ */ - if (nm[1] == '/' -#ifdef VMS - || nm[1] == ':' -#endif /* VMS */ - || nm[1] == 0)/* ~/filename */ + if (nm[1] == '/' || nm[1] == 0)/* ~/filename */ { if (!(newdir = (unsigned char *) egetenv ("HOME"))) newdir = (unsigned char *) ""; nm++; -#ifdef VMS - nm++; /* Don't leave the slash in nm. */ -#endif /* VMS */ } else /* ~user/filename */ { @@ -1929,11 +1445,6 @@ See also the function `substitute-in-file-name'.") /* Find end of name. */ unsigned char *ptr = (unsigned char *) index (user, '/'); int len = ptr ? ptr - user : strlen (user); -#ifdef VMS - unsigned char *ptr1 = index (user, ':'); - if (ptr1 != 0 && ptr1 - user < len) - len = ptr1 - user; -#endif /* VMS */ /* Copy the user name into temp storage. */ o = (unsigned char *) alloca (len + 1); bcopy ((char *) user, o, len); @@ -1952,11 +1463,7 @@ See also the function `substitute-in-file-name'.") nm += len; } - if (nm[0] != '/' -#ifdef VMS - && !index (nm, ':') -#endif /* not VMS */ - && !newdir) + if (nm[0] != '/' && !newdir) { if (NILP (defalt)) defalt = current_buffer->directory; @@ -1972,19 +1479,13 @@ See also the function `substitute-in-file-name'.") if (newdir) { -#ifndef VMS if (nm[0] == 0 || nm[0] == '/') strcpy (target, newdir); else -#endif file_name_as_directory (target, newdir); } strcat (target, nm); -#ifdef VMS - if (index (target, '/')) - strcpy (target, sys_translate_unix (target)); -#endif /* VMS */ /* Now canonicalize by removing /. and /foo/.. if they appear */ @@ -1993,48 +1494,6 @@ See also the function `substitute-in-file-name'.") while (*p) { -#ifdef VMS - if (*p != ']' && *p != '>' && *p != '-') - { - if (*p == '\\') - p++; - *o++ = *p++; - } - else if ((p[0] == ']' || p[0] == '>') && p[0] == p[1] + 2) - /* brackets are offset from each other by 2 */ - { - p += 2; - if (*p != '.' && *p != '-' && o[-1] != '.') - /* convert [foo][bar] to [bar] */ - while (o[-1] != '[' && o[-1] != '<') - o--; - else if (*p == '-' && *o != '.') - *--p = '.'; - } - else if (p[0] == '-' && o[-1] == '.' - && (p[1] == '.' || p[1] == ']' || p[1] == '>')) - /* flush .foo.- ; leave - if stopped by '[' or '<' */ - { - do - o--; - while (o[-1] != '.' && o[-1] != '[' && o[-1] != '<'); - if (p[1] == '.') /* foo.-.bar ==> bar. */ - p += 2; - else if (o[-1] == '.') /* '.foo.-]' ==> ']' */ - p++, o--; - /* else [foo.-] ==> [-] */ - } - else - { -#ifndef VMS4_4 - if (*p == '-' - && o[-1] != '[' && o[-1] != '<' && o[-1] != '.' - && p[1] != ']' && p[1] != '>' && p[1] != '.') - *p = '_'; -#endif /* VMS4_4 */ - *o++ = *p++; - } -#else /* not VMS */ if (*p != '/') { *o++ = *p++; @@ -2063,7 +1522,6 @@ See also the function `substitute-in-file-name'.") { *o++ = *p++; } -#endif /* not VMS */ } return make_string (target, o - target); @@ -2077,13 +1535,6 @@ file_name_absolute_p (filename) { return (IS_DIRECTORY_SEP (*filename) || *filename == '~' -#ifdef VMS - /* ??? This criterion is probably wrong for '<'. */ - || index (filename, ':') || index (filename, '<') - || (*filename == '[' && (filename[1] != '-' - || (filename[2] != '.' && filename[2] != ']')) - && filename[1] != '.') -#endif /* VMS */ #ifdef DOS_NT || (IS_DRIVE (*filename) && IS_DEVICE_SEP (filename[1]) && IS_DIRECTORY_SEP (filename[2])) @@ -2100,9 +1551,6 @@ search_embedded_absfilename (nm, endp) for (p = nm + 1; p < endp; p++) { if ((0 -#ifdef VMS - || p[-1] == ':' || p[-1] == ']' || p[-1] == '>' -#endif /* VMS */ || IS_DIRECTORY_SEP (p[-1])) && file_name_absolute_p (p) #if defined (WINDOWSNT) || defined(CYGWIN) @@ -2112,11 +1560,7 @@ search_embedded_absfilename (nm, endp) #endif /* not (WINDOWSNT || CYGWIN) */ ) { - for (s = p; *s && (!IS_DIRECTORY_SEP (*s) -#ifdef VMS - && *s != ':' -#endif /* VMS */ - ); s++); + for (s = p; *s && (!IS_DIRECTORY_SEP (*s)); s++); if (p[0] == '~' && s > p + 1) /* we've got "/~something/" */ { unsigned char *o = alloca (s - p + 1); @@ -2147,10 +1591,7 @@ DEFUN ("substitute-in-file-name", Fsubstitute_in_file_name, the value of that variable. The variable name should be terminated with a character not a letter, digit or underscore; otherwise, enclose the entire variable name in braces. -If `/~' appears, all of FILENAME through that `/' is discarded. - -On VMS, `$' substitution is not done; this function does little and only -duplicates what `expand-file-name' does. */) +If `/~' appears, all of FILENAME through that `/' is discarded. */) (filename) Lisp_Object filename; { @@ -2189,9 +1630,6 @@ duplicates what `expand-file-name' does. */) (make_specified_string (p, -1, endp - p, STRING_MULTIBYTE (filename))); -#ifdef VMS - return filename; -#else /* See if any variables are substituted into the string and find the total length of their values in `total' */ @@ -2333,7 +1771,6 @@ duplicates what `expand-file-name' does. */) error ("Substituting nonexistent environment variable \"%s\"", target); /* NOTREACHED */ -#endif /* not VMS */ return Qnil; } @@ -2347,13 +1784,7 @@ expand_and_dir_to_file (filename, defdir) register Lisp_Object absname; absname = Fexpand_file_name (filename, defdir); -#ifdef VMS - { - register int c = SREF (absname, SBYTES (absname) - 1); - if (c == ':' || c == ']' || c == '>') - absname = Fdirectory_file_name (absname); - } -#else + /* Remove final slash, if any (unless this is the root dir). stat behaves differently depending! */ if (SCHARS (absname) > 1 @@ -2361,7 +1792,6 @@ expand_and_dir_to_file (filename, defdir) && !IS_DEVICE_SEP (SREF (absname, SBYTES (absname)-2))) /* We cannot take shortcuts; they might be wrong for magic file names. */ absname = Fdirectory_file_name (absname); -#endif return absname; } @@ -2554,10 +1984,6 @@ uid and gid of FILE to NEWNAME. */) } #endif /* S_ISREG && S_ISLNK */ -#ifdef VMS - /* Create the copy file with the same record format as the input file */ - ofd = sys_creat (SDATA (encoded_newname), 0666, ifd); -#else #ifdef MSDOS /* System's default file type was set to binary by _fmode in emacs.c. */ ofd = emacs_open (SDATA (encoded_newname), @@ -2570,7 +1996,6 @@ uid and gid of FILE to NEWNAME. */) | (NILP (ok_if_already_exists) ? O_EXCL : 0), 0666); #endif /* not MSDOS */ -#endif /* VMS */ if (ofd < 0) report_file_error ("Opening output file", Fcons (newname, Qnil)); @@ -2960,33 +2385,6 @@ This happens for interactive use with M-x. */) #endif /* S_IFLNK */ } -#ifdef VMS - -DEFUN ("define-logical-name", Fdefine_logical_name, Sdefine_logical_name, - 2, 2, "sDefine logical name: \nsDefine logical name %s as: ", - doc: /* Define the job-wide logical name NAME to have the value STRING. -If STRING is nil or a null string, the logical name NAME is deleted. */) - (name, string) - Lisp_Object name; - Lisp_Object string; -{ - CHECK_STRING (name); - if (NILP (string)) - delete_logical_name (SDATA (name)); - else - { - CHECK_STRING (string); - - if (SCHARS (string) == 0) - delete_logical_name (SDATA (name)); - else - define_logical_name (SDATA (name), SDATA (string)); - } - - return string; -} -#endif /* VMS */ - DEFUN ("file-name-absolute-p", Ffile_name_absolute_p, Sfile_name_absolute_p, 1, 1, 0, @@ -3182,10 +2580,6 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, ? Qt : Qnil); dir = Ffile_name_directory (absname); -#ifdef VMS - if (!NILP (dir)) - dir = Fdirectory_file_name (dir); -#endif /* VMS */ #ifdef MSDOS if (!NILP (dir)) dir = Fdirectory_file_name (dir); @@ -3823,10 +3217,8 @@ variable `last-coding-system-used' to the coding system actually used. */) record_unwind_protect (close_file_unwind, make_number (fd)); - /* Supposedly happens on VMS. */ /* Can happen on any platform that uses long as type of off_t, but allows - file sizes to exceed 2Gb. VMS is no longer officially supported, so - give a message suitable for the latter case. */ + file sizes to exceed 2Gb, so give a suitable message. */ if (! not_regular && st.st_size < 0) error ("Maximum buffer size exceeded"); @@ -4995,9 +4387,6 @@ This does code conversion according to the value of struct stat st; int count = SPECPDL_INDEX (); int count1; -#ifdef VMS - unsigned char *fname = 0; /* If non-0, original filename (must rename) */ -#endif /* VMS */ Lisp_Object handler; Lisp_Object visit_file; Lisp_Object annotations; @@ -5131,52 +4520,6 @@ This does code conversion according to the value of #endif /* not DOS_NT */ if (desc < 0 && (NILP (append) || errno == ENOENT)) -#ifdef VMS - if (auto_saving) /* Overwrite any previous version of autosave file */ - { - vms_truncate (fn); /* if fn exists, truncate to zero length */ - desc = emacs_open (fn, O_RDWR, 0); - if (desc < 0) - desc = creat_copy_attrs (STRINGP (current_buffer->filename) - ? SDATA (current_buffer->filename) : 0, - fn); - } - else /* Write to temporary name and rename if no errors */ - { - Lisp_Object temp_name; - temp_name = Ffile_name_directory (filename); - - if (!NILP (temp_name)) - { - temp_name = Fmake_temp_name (concat2 (temp_name, - build_string ("$$SAVE$$"))); - fname = SDATA (filename); - fn = SDATA (temp_name); - desc = creat_copy_attrs (fname, fn); - if (desc < 0) - { - /* If we can't open the temporary file, try creating a new - version of the original file. VMS "creat" creates a - new version rather than truncating an existing file. */ - fn = fname; - fname = 0; - desc = creat (fn, 0666); -#if 0 /* This can clobber an existing file and fail to replace it, - if the user runs out of space. */ - if (desc < 0) - { - /* We can't make a new version; - try to truncate and rewrite existing version if any. */ - vms_truncate (fn); - desc = emacs_open (fn, O_RDWR, 0); - } -#endif - } - } - else - desc = creat (fn, 0666); - } -#else /* not VMS */ #ifdef DOS_NT desc = emacs_open (fn, O_WRONLY | O_CREAT | buffer_file_type @@ -5187,7 +4530,6 @@ This does code conversion according to the value of | (EQ (mustbenew, Qexcl) ? O_EXCL : 0), auto_saving ? auto_save_mode_bits : 0666); #endif /* not DOS_NT */ -#endif /* not VMS */ if (desc < 0) { @@ -5222,25 +4564,6 @@ This does code conversion according to the value of UNGCPRO; -#ifdef VMS -/* - * Kludge Warning: The VMS C RTL likes to insert carriage returns - * if we do writes that don't end with a carriage return. Furthermore - * it cannot handle writes of more then 16K. The modified - * version of "sys_write" in SYSDEP.C (see comment there) copes with - * this EXCEPT for the last record (if it doesn't end with a carriage - * return). This implies that if your buffer doesn't end with a carriage - * return, you get one free... tough. However it also means that if - * we make two calls to sys_write (a la the following code) you can - * get one at the gap as well. The easiest way to fix this (honest) - * is to move the gap to the next newline (or the end of the buffer). - * Thus this change. - * - * Yech! - */ - if (GPT > BEG && GPT_ADDR[-1] != '\n') - move_gap (find_next_newline (GPT, 1)); -#else #if 0 /* The new encoding routine doesn't require the following. */ @@ -5257,7 +4580,6 @@ This does code conversion according to the value of SET_PT_BOTH (opoint, opoint_byte); } #endif -#endif failure = 0; immediate_quit = 1; @@ -5318,29 +4640,14 @@ This does code conversion according to the value of but who knows about all the other machines with NFS?) */ #if 0 - /* On VMS, must do the stat after the close - since closing changes the modtime. */ -#ifndef VMS - /* Recall that #if defined does not work on VMS. */ #define FOO fstat (desc, &st); #endif -#endif /* NFS can report a write failure now. */ if (emacs_close (desc) < 0) failure = 1, save_errno = errno; -#ifdef VMS - /* If we wrote to a temporary name and had no errors, rename to real name. */ - if (fname) - { - if (!failure) - failure = (rename (fn, fname) != 0), save_errno = errno; - fn = fname; - } -#endif /* VMS */ - #ifndef FOO stat (fn, &st); #endif @@ -6256,11 +5563,6 @@ of file names regardless of the current language environment. */); Fput (Qfile_date_error, Qerror_message, build_string ("Cannot set file date")); - DEFVAR_BOOL ("vms-stmlf-recfm", &vms_stmlf_recfm, - doc: /* *Non-nil means write new files with record format `stmlf'. -nil means use format `var'. This variable is meaningful only on VMS. */); - vms_stmlf_recfm = 0; - DEFVAR_LISP ("directory-sep-char", &Vdirectory_sep_char, doc: /* Directory separator character for built-in functions that return file names. The value is always ?/. Don't use this variable, just use `/'. */); @@ -6376,9 +5678,6 @@ When non-nil, the function `move-file-to-trash' will be used by defsubr (&Srename_file); defsubr (&Sadd_name_to_file); defsubr (&Smake_symbolic_link); -#ifdef VMS - defsubr (&Sdefine_logical_name); -#endif /* VMS */ defsubr (&Sfile_name_absolute_p); defsubr (&Sfile_exists_p); defsubr (&Sfile_executable_p); diff --git a/src/floatfns.c b/src/floatfns.c index 8ee28210e43..d454d6e3cf1 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -101,16 +101,6 @@ extern int errno; #endif #endif -/* Avoid traps on VMS from sinh and cosh. - All the other functions set errno instead. */ - -#ifdef VMS -#undef cosh -#undef sinh -#define cosh(x) ((exp(x)+exp(-x))*0.5) -#define sinh(x) ((exp(x)-exp(-x))*0.5) -#endif /* VMS */ - #ifdef FLOAT_CATCH_SIGILL static SIGTYPE float_error (); #endif diff --git a/src/getpagesize.h b/src/getpagesize.h index 928e0440cce..1d29be0d45e 100644 --- a/src/getpagesize.h +++ b/src/getpagesize.h @@ -19,10 +19,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #ifndef HAVE_GETPAGESIZE -# ifdef VMS -# define getpagesize() 512 -# endif - # ifdef HAVE_UNISTD_H # include <unistd.h> # endif diff --git a/src/ioctl.h b/src/ioctl.h deleted file mode 100644 index 34f2a9aa644..00000000000 --- a/src/ioctl.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Emacs ioctl emulation for VMS */ - -/* arch-tag: 48595931-af6e-407d-95c7-484059087767 - (do not change this comment) */ diff --git a/src/keyboard.c b/src/keyboard.c index a61eb836f26..51e228b37b0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -51,9 +51,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include "msdos.h" #include <time.h> #else /* not MSDOS */ -#ifndef VMS #include <sys/ioctl.h> -#endif #endif /* not MSDOS */ #include "syssignal.h" @@ -4015,9 +4013,6 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) /* One way or another, wait until input is available; then, if interrupt handlers have not read it, read it now. */ -#ifdef OLDVMS - wait_for_kbd_input (); -#else /* Note SIGIO has been undef'd if FIONREAD is missing. */ #ifdef SIGIO gobble_input (0); @@ -4048,7 +4043,6 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) if (!interrupt_input && kbd_fetch_ptr == kbd_store_ptr) /* Pass 1 for EXPECT since we just waited to have input. */ read_avail_input (1); -#endif /* not VMS */ } if (CONSP (Vunread_command_events)) @@ -6907,7 +6901,6 @@ gobble_input (expected) xd_read_queued_messages (); #endif /* HAVE_DBUS */ -#ifndef VMS #ifdef SIGIO if (interrupt_input) { @@ -6930,7 +6923,6 @@ gobble_input (expected) } else #endif -#endif read_avail_input (expected); #endif } @@ -6980,17 +6972,11 @@ record_asynch_buffer_change () } } -#ifndef VMS - /* Read any terminal input already buffered up by the system into the kbd_buffer, but do not wait. EXPECTED should be nonzero if the caller knows there is some input. - Except on VMS, all input is read by this function. - If interrupt_input is nonzero, this function MUST be called - only when SIGIO is blocked. - Returns the number of keyboard chars read, or -1 meaning this is a bad time to try to read input. */ @@ -7238,7 +7224,6 @@ tty_read_avail_input (struct terminal *terminal, return nread; } -#endif /* not VMS */ void handle_async_input () @@ -11011,19 +10996,11 @@ handle_interrupt () */ sys_suspend (); #else -#ifdef VMS - if (sys_suspend () == -1) - { - printf ("Not running as a subprocess;\n"); - printf ("you can continue or abort.\n"); - } -#else /* not VMS */ /* Perhaps should really fork an inferior shell? But that would not provide any way to get back to the original shell, ever. */ printf ("No support for stopping a process on this operating system;\n"); printf ("you can continue or abort.\n"); -#endif /* not VMS */ #endif /* not SIGTSTP */ #ifdef MSDOS /* We must remain inside the screen area when the internal terminal @@ -11062,11 +11039,7 @@ handle_interrupt () #ifdef MSDOS printf ("\r\nAbort? (y or n) "); #else /* not MSDOS */ -#ifdef VMS - printf ("Abort (and enter debugger)? (y or n) "); -#else /* not VMS */ printf ("Abort (and dump core)? (y or n) "); -#endif /* not VMS */ #endif /* not MSDOS */ fflush (stdout); if (((c = getchar ()) & ~040) == 'Y') @@ -11169,11 +11142,6 @@ See also `current-input-mode'. */) new_interrupt_input = 0; #endif /* not SIGIO */ -/* Our VMS input only works by interrupts, as of now. */ -#ifdef VMS - new_interrupt_input = 1; -#endif - if (new_interrupt_input != interrupt_input) { #ifdef POLL_FOR_INPUT @@ -11589,11 +11557,6 @@ init_keyboard () interrupt_input = 0; #endif -/* Our VMS input only works by interrupts, as of now. */ -#ifdef VMS - interrupt_input = 1; -#endif - sigfree (); dribble = 0; diff --git a/src/lread.c b/src/lread.c index 872b6cfc2fc..f36162b1a85 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1342,11 +1342,7 @@ complete_filename_p (pathname) register const unsigned char *s = SDATA (pathname); return (IS_DIRECTORY_SEP (s[0]) || (SCHARS (pathname) > 2 - && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])) -#ifdef VMS - || index (s, ':') -#endif /* VMS */ - ); + && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2]))); } DEFUN ("locate-file-internal", Flocate_file_internal, Slocate_file_internal, 2, 4, 0, @@ -3719,9 +3715,7 @@ oblookup (obarray, ptr, size, size_byte) } /* This is sometimes needed in the middle of GC. */ obsize &= ~ARRAY_MARK_FLAG; - /* Combining next two lines breaks VMS C 2.3. */ - hash = hash_string (ptr, size_byte); - hash %= obsize; + hash = hash_string (ptr, size_byte) % obsize; bucket = XVECTOR (obarray)->contents[hash]; oblookup_last_bucket_number = hash; if (EQ (bucket, make_number (0))) diff --git a/src/m/vax.h b/src/m/vax.h index 8b0593c028d..bfb0dee5f23 100644 --- a/src/m/vax.h +++ b/src/m/vax.h @@ -25,11 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ NOTE-START The vax (-machine=vax) runs zillions of different operating systems. -Vax running VMS (-opsystem=vms) - - 18.36 believed to work. Addition of features is necessary to make - this Emacs version more usable. - NOTE-END */ /* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word @@ -57,18 +52,6 @@ NOTE-END */ #endif /* BSD_SYSTEM */ -#ifdef VMS - -/* Data type of load average, as read out of driver. */ - -#define LOAD_AVE_TYPE float - -/* Convert that into an integer that is 100 for a load average of 1.0 */ - -#define LOAD_AVE_CVT(x) ((int) ((x) * 100.0)) - -#endif /* VMS */ - #ifdef BSD4_2 #define HAVE_FTIME #endif diff --git a/src/ndir.h b/src/ndir.h index d254b5cf603..d7bac9d3fae 100644 --- a/src/ndir.h +++ b/src/ndir.h @@ -7,30 +7,13 @@ * copyright, constituting the only possible expression of the * algorithm in this format. */ -#ifdef VMS -#ifndef FAB$C_BID -#include <fab.h> -#endif -#ifndef NAM$C_BID -#include <nam.h> -#endif -#ifndef RMS$_SUC -#include <rmsdef.h> -#endif -#include "vmsdir.h" -#endif /* VMS */ #define DIRBLKSIZ 512 /* size of directory block */ -#ifdef VMS -#define MAXNAMLEN (DIR$S_NAME + 7) /* 80 plus room for version #. */ -#define MAXFULLSPEC NAM$C_MAXRSS /* Maximum full spec */ -#else #ifdef WINDOWSNT #define MAXNAMLEN 255 #else /* not WINDOWSNT */ #define MAXNAMLEN 15 /* maximum filename length */ #endif /* not WINDOWSNT */ -#endif /* VMS */ /* NOTE: MAXNAMLEN must be one less than a multiple of 4 */ struct direct /* data from readdir() */ diff --git a/src/param.h b/src/param.h deleted file mode 100644 index 5e80bf9e548..00000000000 --- a/src/param.h +++ /dev/null @@ -1,5 +0,0 @@ -/* This is so that Emacs can run on VMS... */ -#define EXEC_PAGESIZE 512 - -/* arch-tag: a6daea28-33a6-4dd3-97d8-5ee1a12f09d3 - (do not change this comment) */ diff --git a/src/print.c b/src/print.c index b9d2e12be15..90b46496eff 100644 --- a/src/print.c +++ b/src/print.c @@ -167,11 +167,6 @@ extern int noninteractive_need_newline; extern int minibuffer_auto_raise; -#ifdef MAX_PRINT_CHARS -static int print_chars; -static int max_print; -#endif /* MAX_PRINT_CHARS */ - void print_interval (); /* GDB resets this to zero on W32 to disable OutputDebugString calls. */ @@ -309,11 +304,6 @@ printchar (ch, fun) unsigned int ch; Lisp_Object fun; { -#ifdef MAX_PRINT_CHARS - if (max_print) - print_chars++; -#endif /* MAX_PRINT_CHARS */ - if (!NILP (fun) && !EQ (fun, Qt)) call1 (fun, make_number (ch)); else @@ -382,11 +372,6 @@ strout (ptr, size, size_byte, printcharfun, multibyte) bcopy (ptr, print_buffer + print_buffer_pos_byte, size_byte); print_buffer_pos += size; print_buffer_pos_byte += size_byte; - -#ifdef MAX_PRINT_CHARS - if (max_print) - print_chars += size; -#endif /* MAX_PRINT_CHARS */ } else if (noninteractive && EQ (printcharfun, Qt)) { @@ -419,11 +404,6 @@ strout (ptr, size, size_byte, printcharfun, multibyte) insert_char (ch); } } - -#ifdef MAX_PRINT_CHARS - if (max_print) - print_chars += size; -#endif /* MAX_PRINT_CHARS */ } else { @@ -764,9 +744,6 @@ is used instead. */) { PRINTDECLARE; -#ifdef MAX_PRINT_CHARS - max_print = 0; -#endif /* MAX_PRINT_CHARS */ if (NILP (printcharfun)) printcharfun = Vstandard_output; PRINTPREPARE; @@ -900,10 +877,6 @@ is used instead. */) PRINTDECLARE; struct gcpro gcpro1; -#ifdef MAX_PRINT_CHARS - print_chars = 0; - max_print = MAX_PRINT_CHARS; -#endif /* MAX_PRINT_CHARS */ if (NILP (printcharfun)) printcharfun = Vstandard_output; GCPRO1 (object); @@ -912,10 +885,6 @@ is used instead. */) print (object, printcharfun, 1); PRINTCHAR ('\n'); PRINTFINISH; -#ifdef MAX_PRINT_CHARS - max_print = 0; - print_chars = 0; -#endif /* MAX_PRINT_CHARS */ UNGCPRO; return object; } @@ -1614,14 +1583,6 @@ print_object (obj, printcharfun, escapeflag) print_depth++; -#ifdef MAX_PRINT_CHARS - if (max_print && print_chars > max_print) - { - PRINTCHAR ('\n'); - print_chars = 0; - } -#endif /* MAX_PRINT_CHARS */ - switch (XTYPE (obj)) { case Lisp_Int: diff --git a/src/process.c b/src/process.c index 3d64ff2cdd0..f343ccc0cc4 100644 --- a/src/process.c +++ b/src/process.c @@ -159,11 +159,7 @@ extern Lisp_Object QCfilter; #endif /* HAVE_SOCKETS */ /* Define first descriptor number available for subprocesses. */ -#ifdef VMS -#define FIRST_PROC_DESC 1 -#else /* Not VMS */ #define FIRST_PROC_DESC 3 -#endif /* Define SIGCHLD as an alias for SIGCLD. There are many conditionals testing SIGCHLD. */ @@ -192,9 +188,6 @@ extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact); #ifndef USE_CRT_DLL extern int errno; #endif -#ifdef VMS -extern char *sys_errlist[]; -#endif #ifndef HAVE_H_ERRNO extern int h_errno; @@ -1417,12 +1410,7 @@ list_processes_1 (query_only) { Lisp_Object tem; tem = Fcar (Fcdr (p->status)); -#ifdef VMS - if (XINT (tem) < NSIG) - write_string (sys_errlist [XINT (tem)], -1); - else -#endif - Fprinc (symbol, Qnil); + Fprinc (symbol, Qnil); } else if (NETCONN1_P (p) || SERIALCONN1_P (p)) { @@ -1587,12 +1575,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) register Lisp_Object *args; { Lisp_Object buffer, name, program, proc, current_dir, tem; -#ifdef VMS - register unsigned char *new_argv; - int len; -#else register unsigned char **new_argv; -#endif register int i; int count = SPECPDL_INDEX (); @@ -1709,28 +1692,6 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) XPROCESS (proc)->encode_coding_system = val; } -#ifdef VMS - /* Make a one member argv with all args concatenated - together separated by a blank. */ - len = SBYTES (program) + 2; - for (i = 3; i < nargs; i++) - { - tem = args[i]; - CHECK_STRING (tem); - len += SBYTES (tem) + 1; /* count the blank */ - } - new_argv = (unsigned char *) alloca (len); - strcpy (new_argv, SDATA (program)); - for (i = 3; i < nargs; i++) - { - tem = args[i]; - CHECK_STRING (tem); - strcat (new_argv, " "); - strcat (new_argv, SDATA (tem)); - } - /* Need to add code here to check for program existence on VMS */ - -#else /* not VMS */ new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); /* If program file name is not absolute, search our path for it. @@ -1782,7 +1743,6 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) new_argv[i - 2] = SDATA (tem); } new_argv[i - 2] = 0; -#endif /* not VMS */ XPROCESS (proc)->decoding_buf = make_uninit_string (0); XPROCESS (proc)->decoding_carryover = 0; @@ -1841,7 +1801,6 @@ create_process_sigchld () #endif #endif -#ifndef VMS /* VMS version of this function is in vmsproc.c. */ void create_process (process, new_argv, current_dir) Lisp_Object process; @@ -2285,7 +2244,6 @@ create_process (process, new_argv, current_dir) if (pid < 0) report_file_error ("Doing vfork", Qnil); } -#endif /* not VMS */ #ifdef HAVE_SOCKETS @@ -4098,19 +4056,9 @@ deactivate_process (proc) { /* Beware SIGCHLD hereabouts. */ flush_pending_output (inchannel); -#ifdef VMS - { - VMS_PROC_STUFF *get_vms_process_pointer (), *vs; - sys$dassgn (outchannel); - vs = get_vms_process_pointer (p->pid); - if (vs) - give_back_vms_process_stuff (vs); - } -#else emacs_close (inchannel); if (outchannel >= 0 && outchannel != inchannel) emacs_close (outchannel); -#endif p->infd = -1; p->outfd = -1; @@ -5231,37 +5179,6 @@ read_process_output (proc, channel) int carryover = p->decoding_carryover; int readmax = 4096; -#ifdef VMS - VMS_PROC_STUFF *vs, *get_vms_process_pointer(); - - vs = get_vms_process_pointer (p->pid); - if (vs) - { - if (!vs->iosb[0]) - return (0); /* Really weird if it does this */ - if (!(vs->iosb[0] & 1)) - return -1; /* I/O error */ - } - else - error ("Could not get VMS process pointer"); - chars = vs->inputBuffer; - nbytes = clean_vms_buffer (chars, vs->iosb[1]); - if (nbytes <= 0) - { - start_vms_process_read (vs); /* Crank up the next read on the process */ - return 1; /* Nothing worth printing, say we got 1 */ - } - if (carryover > 0) - { - /* The data carried over in the previous decoding (which are at - the tail of decoding buffer) should be prepended to the new - data read to decode all together. */ - chars = (char *) alloca (nbytes + carryover); - bcopy (SDATA (p->decoding_buf), buf, carryover); - bcopy (vs->inputBuffer, chars + carryover, nbytes); - } -#else /* not VMS */ - chars = (char *) alloca (carryover + readmax); if (carryover) /* See the comment above. */ @@ -5318,7 +5235,6 @@ read_process_output (proc, channel) else nbytes = nbytes + 1; } -#endif /* not VMS */ p->decoding_carryover = 0; @@ -5441,9 +5357,6 @@ read_process_output (proc, channel) if (waiting_for_user_input_p == -1) record_asynch_buffer_change (); -#ifdef VMS - start_vms_process_read (vs); -#endif unbind_to (count, Qnil); return nbytes; } @@ -5566,9 +5479,6 @@ read_process_output (proc, channel) SET_PT_BOTH (opoint, opoint_byte); set_buffer_internal (old); } -#ifdef VMS - start_vms_process_read (vs); -#endif return nbytes; } @@ -5620,10 +5530,6 @@ send_process (proc, buf, len, object) GCPRO1 (object); -#ifdef VMS - VMS_PROC_STUFF *vs, *get_vms_process_pointer(); -#endif /* VMS */ - if (p->raw_status_new) update_status (p); if (! EQ (p->status, Qrun)) @@ -5704,14 +5610,6 @@ send_process (proc, buf, len, object) buf = SDATA (coding->dst_object); } -#ifdef VMS - vs = get_vms_process_pointer (p->pid); - if (vs == 0) - error ("Could not find this process: %x", p->pid); - else if (write_to_vms_process (vs, buf, len)) - ; -#else /* not VMS */ - if (pty_max_bytes == 0) { #if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON) @@ -5873,23 +5771,16 @@ send_process (proc, buf, len, object) Fprocess_send_eof (proc); } } -#endif /* not VMS */ else { signal (SIGPIPE, old_sigpipe); -#ifndef VMS proc = process_sent_to; p = XPROCESS (proc); -#endif p->raw_status_new = 0; p->status = Fcons (Qexit, Fcons (make_number (256), Qnil)); p->tick = ++process_tick; deactivate_process (proc); -#ifdef VMS - error ("Error writing to process %s; closed it", SDATA (p->name)); -#else error ("SIGPIPE raised on process %s; closed it", SDATA (p->name)); -#endif } UNGCPRO; @@ -6193,20 +6084,8 @@ process_send_signal (process, signo, current_group, nomsg) break; #endif /* ! defined (SIGCONT) */ case SIGINT: -#ifdef VMS - send_process (proc, "\003", 1, Qnil); /* ^C */ - goto whoosh; -#endif case SIGQUIT: -#ifdef VMS - send_process (proc, "\031", 1, Qnil); /* ^Y */ - goto whoosh; -#endif case SIGKILL: -#ifdef VMS - sys$forcex (&(p->pid), 0, 1); - whoosh: -#endif flush_pending_output (p->infd); break; } @@ -6547,9 +6426,6 @@ process has been transmitted to the serial port. */) send_process (proc, "", 0, Qnil); } -#ifdef VMS - send_process (proc, "\032", 1, Qnil); /* ^z */ -#else if (XPROCESS (proc)->pty_flag) send_process (proc, "\004", 1, Qnil); else if (EQ (XPROCESS (proc)->type, Qserial)) @@ -6594,7 +6470,6 @@ process has been transmitted to the serial port. */) XPROCESS (proc)->outfd = new_outfd; } -#endif /* VMS */ return process; } diff --git a/src/process.h b/src/process.h index 29cf38a2a4f..3f50fc5a146 100644 --- a/src/process.h +++ b/src/process.h @@ -152,7 +152,7 @@ extern int synch_process_termsig; extern int synch_process_retcode; /* The name of the file open to get a null file, or a data sink. - VMS, MS-DOS, and OS/2 redefine this. */ + MS-DOS, and OS/2 redefine this. */ #ifndef NULL_DEVICE #define NULL_DEVICE "/dev/null" #endif diff --git a/src/s/msdos.h b/src/s/msdos.h index 2d29a5548b7..7699f80d192 100644 --- a/src/s/msdos.h +++ b/src/s/msdos.h @@ -40,7 +40,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ #define DOS_NT /* MSDOS or WINDOWSNT */ #undef BSD_SYSTEM -#undef VMS /* SYSTEM_TYPE should indicate the kind of system you are using. It sets the Lisp variable system-type. */ diff --git a/src/s/template.h b/src/s/template.h index ce5c8fdbe5c..f7a7d7f0af1 100644 --- a/src/s/template.h +++ b/src/s/template.h @@ -31,7 +31,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* #define BSD4_2 */ /* #define BSD4_3 */ /* #define BSD_SYSTEM */ -/* #define VMS */ /* SYSTEM_TYPE should indicate the kind of system you are using. It sets the Lisp variable system-type. */ @@ -93,13 +92,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define HAVE_PTYS -/* - * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate - * The 4.2 opendir, etc., library functions. - */ - -#define NONSYSTEM_DIR_LIBRARY - /* Define this symbol if your system has the functions bcopy, etc. */ #define BSTRING diff --git a/src/s/vms.h b/src/s/vms.h deleted file mode 100644 index e95e5f217ae..00000000000 --- a/src/s/vms.h +++ /dev/null @@ -1,192 +0,0 @@ -/* system description header for VMS - Copyright (C) 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ - -/* - * Define symbols to identify the version of Unix this is. - * Define all the symbols that apply correctly. - */ - -#ifndef VMS /* Decus cpp doesn't define this but VAX C does */ -#define VMS -#endif /* VMS */ -/* Note that this file is used indirectly via vms4-0.h, or some other - such file. These other files define a symbol VMS4_0, VMS4_2, etc. */ - -/* SYSTEM_TYPE should indicate the kind of system you are using. - It sets the Lisp variable system-type. */ - -#define SYSTEM_TYPE "vax-vms" - -/* Letter to use in finding device name of first pty, - if system supports pty's. 'a' means it is /dev/ptya0 */ - -#define FIRST_PTY_LETTER 'a' - -/* - * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate - * The 4.2 opendir, etc., library functions. - */ - -#define NONSYSTEM_DIR_LIBRARY - -/* Define the maximum record length for print strings, if needed. */ - -#define MAX_PRINT_CHARS 300 - - -/* Here, on a separate page, add any special hacks needed - to make Emacs work on this system. For example, - you might define certain system call names that don't - exist on your system, or that do different things on - your system and must be used only through an encapsulation - (Which you should place, by convention, in sysdep.c). */ - -/* In olden days, VMS filenames did not support hyphen (i.e., the "-" - character). You can #undef this in vmsX-Y.h for newer versions. */ - -#define NO_HYPHENS_IN_FILENAMES - -/* Do you have the sharable library bug? If you link with a sharable - library that contains psects with the NOSHR attribute and also refer to - those psects in your program, the linker give you a private version of - the psect which is not related to the version used by the sharable - library. The end result is that your references to variables in that - psect have absolutely nothing to do with library references to what is - supposed to be the same variable. If you intend to link with the standard - C library (NOT the sharable one) you don't need to define this. (This - is NOT fixed in V4.4...) */ - -#define SHARABLE_LIB_BUG - -/* Partially due to the above mentioned bug and also so that we don't need - to require that people have a sharable C library, the default for Emacs - is to link with the non-shared library. If you want to link with the - shared library, define this and remake xmakefile and fileio.c. This allows - us to ship a guaranteed executable image. */ - -#define LINK_CRTL_SHARE - -/* Define this if you want to read the file SYS$SYSTEM:SYSUAF.DAT for user - information. If you do use this, you must either make SYSUAF.DAT world - readable or install Emacs with SYSPRV. */ - -/* #define READ_SYSUAF */ - -/* Traditionally, filenames on VMS are always upper case. */ - -#define FILE_SYSTEM_CASE Fupcase - -/* On VMS these have a different name */ - -#define index strchr -#define rindex strrchr -#define unlink delete - -#ifndef __GNUC__ -extern double mth$dmod(double, double); -#endif - -/* Some time routines are missing in the VAX C RTL, or needs some - extra bit of code */ -#define tzset sys_tzset -#define localtime sys_localtime -#define gmtime sys_gmtime - -/* On later versions of VMS these exist in the C run time library, but - we are using our own implementations. Hide their names to avoid - linker errors */ -#define rename sys_rename -#define execvp sys_execvp -#define system sys_system - -#ifndef GNU_MALLOC -/* Hide these names so that we don't get linker errors */ -#define malloc sys_malloc -#define free sys_free -#define realloc sys_realloc -#define calloc sys_calloc - -/* Don't use the standard brk and sbrk */ -#define sbrk sys_sbrk -#define brk sys_brk -#endif - -/* On VMS we want to avoid reading and writing very large amounts of - data at once, so we redefine read and write here. */ - -#define read sys_read -#define write sys_write - -/* sys_creat just calls the real creat with additional args of - "rfm=var", "rat=cr" to get "normal" VMS files... */ -#define creat sys_creat - -/* fwrite forces an RMS PUT on every call. This is abysmally slow, so - we emulate fwrite with fputc, which forces buffering and is much - faster! */ -#define fwrite sys_fwrite - -/* getuid only returns the member number, which is not unique on most VMS - systems. We emulate it with (getgid()<<16 | getuid()). */ -#define getuid sys_getuid - -/* If user asks for TERM, check first for EMACS_TERM. */ -#define getenv sys_getenv - -/* Standard C abort is less useful than it should be. */ -#define abort sys_abort - -/* Case conflicts with C library fread. */ -#define Fread F_read - -/* Case conflicts with C library srandom. */ -#define Srandom S_random - -/* Cause initialization of vmsfns.c to be run. */ -#define SYMS_SYSTEM syms_of_vmsfns () - -/* VAXCRTL access doesn't deal with SYSPRV very well (among other oddities...) - Here, we use $CHKPRO to really determine access. */ -#define access sys_access - -#define PAGESIZE 512 - -#define _longjmp longjmp -#define _setjmp setjmp - -globalref char sdata[]; -#define DATA_START (((int) sdata + 511) & ~511) -#define TEXT_START 512 - -#define PURESIZE 330000 - -/* Stdio FILE type has extra indirect on VMS, so must alter this macro. */ - -#define PENDING_OUTPUT_COUNT(FILE) ((*(FILE))->_ptr - (*(FILE))->_base) - -#define NULL_DEVICE "NLA0:" - -/* Case conflict with Xlib XFree () */ -#define xfree emacs_xfree - -/* What separator do we use in paths? */ -#define SEPCHAR ',' - -/* arch-tag: 76bc2b70-46d1-4334-8f12-955c0d0ca6d4 - (do not change this comment) */ diff --git a/src/sysdep.c b/src/sysdep.c index 908375d344d..8da7d6a4784 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -90,32 +90,7 @@ extern int errno; #endif #endif -#ifdef VMS -#include <rms.h> -#include <ttdef.h> -#include <tt2def.h> -#include <iodef.h> -#include <ssdef.h> -#include <descrip.h> -#include <fibdef.h> -#include <atrdef.h> -#include <ctype.h> -#include <string.h> -#ifdef __GNUC__ #include <sys/file.h> -#else -#include <file.h> -#endif -#undef F_SETFL -#ifndef RAB$C_BID -#include <rab.h> -#endif -#define MAXIOSIZE (32 * PAGESIZE) /* Don't I/O more than 32 blocks at a time */ -#endif /* VMS */ - -#ifndef VMS -#include <sys/file.h> -#endif /* not VMS */ #ifdef HAVE_FCNTL_H #include <fcntl.h> @@ -159,10 +134,6 @@ int _cdecl _getpid (void); extern char *getwd (char *); #endif -#ifdef NONSYSTEM_DIR_LIBRARY -#include "ndir.h" -#endif /* NONSYSTEM_DIR_LIBRARY */ - #include "syssignal.h" #include "systime.h" #ifdef HAVE_UTIME_H @@ -297,12 +268,6 @@ discard_tty_input () if (noninteractive) return; -#ifdef VMS - end_kbd_input (); - SYS$QIOW (0, fileno (CURTTY()->input), IO$_READVBLK|IO$M_PURGE, input_iosb, 0, 0, - &buf.main, 0, 0, terminator_mask, 0, 0); - queue_kbd_input (); -#else /* not VMS */ #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ while (dos_keyread () != -1) ; @@ -319,7 +284,6 @@ discard_tty_input () } } #endif /* not MSDOS */ -#endif /* not VMS */ #endif /* not WINDOWSNT */ } @@ -357,20 +321,13 @@ init_baud_rate (int fd) #ifdef DOS_NT emacs_ospeed = 15; #else /* not DOS_NT */ -#ifdef VMS - struct sensemode sg; - - SYS$QIOW (0, fd, IO$_SENSEMODE, &sg, 0, 0, - &sg.class, 12, 0, 0, 0, 0 ); - emacs_ospeed = sg.xmit_baud; -#else /* not VMS */ #ifdef HAVE_TERMIOS struct termios sg; sg.c_cflag = B9600; tcgetattr (fd, &sg); emacs_ospeed = cfgetospeed (&sg); -#else /* neither VMS nor TERMIOS */ +#else /* not TERMIOS */ #ifdef HAVE_TERMIO struct termio sg; @@ -381,7 +338,7 @@ init_baud_rate (int fd) ioctl (fd, TCGETA, &sg); #endif emacs_ospeed = sg.c_cflag & CBAUD; -#else /* neither VMS nor TERMIOS nor TERMIO */ +#else /* neither TERMIOS nor TERMIO */ struct sgttyb sg; sg.sg_ospeed = B9600; @@ -390,7 +347,6 @@ init_baud_rate (int fd) emacs_ospeed = sg.sg_ospeed; #endif /* not HAVE_TERMIO */ #endif /* not HAVE_TERMIOS */ -#endif /* not VMS */ #endif /* not DOS_NT */ } @@ -443,12 +399,6 @@ wait_for_termination (pid) while (1) { #ifdef subprocesses -#ifdef VMS - int status; - - status = SYS$FORCEX (&pid, 0, 0); - break; -#else /* not VMS */ #if defined (BSD_SYSTEM) || defined (HPUX) /* Note that kill returns -1 even if the process is just a zombie now. But inevitably a SIGCHLD interrupt should be generated @@ -503,7 +453,6 @@ wait_for_termination (pid) #endif /* not HAVE_SYSV_SIGPAUSE */ #endif /* not POSIX_SIGNALS */ #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ -#endif /* not VMS */ #else /* not subprocesses */ #if __DJGPP__ > 1 break; @@ -545,7 +494,6 @@ flush_pending_output (channel) #endif } -#ifndef VMS /* Set up the terminal at the other end of a pseudo-terminal that we will be controlling an inferior through. It should not echo or do line-editing, since that is done @@ -643,7 +591,6 @@ child_setup_tty (out) #endif /* not DOS_NT */ } -#endif /* not VMS */ #endif /* subprocesses */ @@ -662,47 +609,6 @@ static void restore_signal_handlers P_ ((struct save_signal *)); void sys_suspend () { -#ifdef VMS - /* "Foster" parentage allows emacs to return to a subprocess that attached - to the current emacs as a cheaper than starting a whole new process. This - is set up by KEPTEDITOR.COM. */ - unsigned long parent_id, foster_parent_id; - char *fpid_string; - - fpid_string = getenv ("EMACS_PARENT_PID"); - if (fpid_string != NULL) - { - sscanf (fpid_string, "%x", &foster_parent_id); - if (foster_parent_id != 0) - parent_id = foster_parent_id; - else - parent_id = getppid (); - } - else - parent_id = getppid (); - - xfree (fpid_string); /* On VMS, this was malloc'd */ - - if (parent_id && parent_id != 0xffffffff) - { - SIGTYPE (*oldsig)() = (int) signal (SIGINT, SIG_IGN); - int status = LIB$ATTACH (&parent_id) & 1; - signal (SIGINT, oldsig); - return status; - } - else - { - struct { - int l; - char *a; - } d_prompt; - d_prompt.l = sizeof ("Emacs: "); /* Our special prompt */ - d_prompt.a = "Emacs: "; /* Just a reminder */ - LIB$SPAWN (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &d_prompt, 0); - return 1; - } - return -1; -#else #if defined (SIGTSTP) && !defined (MSDOS) { @@ -724,7 +630,6 @@ sys_suspend () #endif /* no USG_JOBCTRL */ #endif /* no SIGTSTP */ -#endif /* not VMS */ } /* Fork a subshell. */ @@ -732,7 +637,6 @@ sys_suspend () void sys_subshell () { -#ifndef VMS #ifdef DOS_NT /* Demacs 1.1.2 91/10/20 Manabu Higashida */ int st; char oldwd[MAXPATHLEN+1]; /* Fixed length is safe on MSDOS. */ @@ -858,7 +762,6 @@ sys_subshell () #endif restore_signal_handlers (saved_handlers); synch_process_alive = 0; -#endif /* !VMS */ } static void @@ -1076,14 +979,6 @@ emacs_get_tty (fd, settings) return -1; #else -#ifdef VMS - /* Vehemently Monstrous System? :-) */ - if (! (SYS$QIOW (0, fd, IO$_SENSEMODE, settings, 0, 0, - &settings->main.class, 12, 0, 0, 0, 0) - & 1)) - return -1; - -#else #ifndef DOS_NT /* I give up - I hope you have the BSD ioctls. */ if (ioctl (fd, TIOCGETP, &settings->main) < 0) @@ -1091,7 +986,6 @@ emacs_get_tty (fd, settings) #endif /* not DOS_NT */ #endif #endif -#endif /* Suivant - Do we have to get struct ltchars data? */ #ifdef HAVE_LTCHARS @@ -1168,14 +1062,6 @@ emacs_set_tty (fd, settings, flushp) return -1; #else -#ifdef VMS - /* Vehemently Monstrous System? :-) */ - if (! (SYS$QIOW (0, fd, IO$_SETMODE, &input_iosb, 0, 0, - &settings->main.class, 12, 0, 0, 0, 0) - & 1)) - return -1; - -#else #ifndef DOS_NT /* I give up - I hope you have the BSD ioctls. */ if (ioctl (fd, (flushp) ? TIOCSETP : TIOCSETN, &settings->main) < 0) @@ -1184,7 +1070,6 @@ emacs_set_tty (fd, settings, flushp) #endif #endif -#endif /* Suivant - Do we have to get struct ltchars data? */ #ifdef HAVE_LTCHARS @@ -1253,25 +1138,6 @@ init_sys_modes (tty_out) if (!tty_out->output) return; /* The tty is suspended. */ -#ifdef VMS - if (!input_ef) - input_ef = get_kbd_event_flag (); - /* LIB$GET_EF (&input_ef); */ - SYS$CLREF (input_ef); - waiting_for_ast = 0; - if (!timer_ef) - timer_ef = get_timer_event_flag (); - /* LIB$GET_EF (&timer_ef); */ - SYS$CLREF (timer_ef); - if (input_ef / 32 != timer_ef / 32) - croak ("Input and timer event flags in different clusters."); - timer_eflist = ((unsigned) 1 << (input_ef % 32)) | - ((unsigned) 1 << (timer_ef % 32)); -#ifndef VMS4_4 - sys_access_reinit (); -#endif -#endif /* VMS */ - #ifdef BSD_PGRPS #if 0 /* read_socket_hook is not global anymore. I think doing this @@ -1431,16 +1297,6 @@ init_sys_modes (tty_out) tty.main.c_iflag &= ~BRKINT; #endif #else /* if not HAVE_TERMIO */ -#ifdef VMS - tty.main.tt_char |= TT$M_NOECHO; - if (meta_key) - tty.main.tt_char |= TT$M_EIGHTBIT; - if (tty_out->flow_control) - tty.main.tt_char |= TT$M_TTSYNC; - else - tty.main.tt_char &= ~TT$M_TTSYNC; - tty.main.tt2_char |= TT2$M_PASTHRU | TT2$M_XON; -#else /* not VMS (BSD, that is) */ #ifndef DOS_NT XSETINT (Vtty_erase_char, tty.main.sg_erase); tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS); @@ -1448,7 +1304,6 @@ init_sys_modes (tty_out) tty.main.sg_flags |= ANYP; tty.main.sg_flags |= interrupt_input ? RAW : CBREAK; #endif /* not DOS_NT */ -#endif /* not VMS (BSD, that is) */ #endif /* not HAVE_TERMIO */ /* If going to use CBREAK mode, we must request C-g to interrupt @@ -1500,14 +1355,6 @@ init_sys_modes (tty_out) #endif #endif -#ifdef VMS -/* Appears to do nothing when in PASTHRU mode. - SYS$QIOW (0, fileno (tty_out->input), IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0, - interrupt_signal, oob_chars, 0, 0, 0, 0); -*/ - queue_kbd_input (0); -#endif /* VMS */ - #ifdef F_SETFL #ifdef F_GETOWN /* F_SETFL does not imply existence of F_GETOWN */ if (interrupt_input) @@ -1529,9 +1376,6 @@ init_sys_modes (tty_out) #endif /* F_GETOWN */ #endif /* F_SETFL */ -#ifdef VMS /* VMS sometimes has this symbol but lacks setvbuf. */ -#undef _IOFBF -#endif #ifdef _IOFBF /* This symbol is defined on recent USG systems. Someone says without this call USG won't really buffer the file @@ -1625,22 +1469,6 @@ get_tty_size (int fd, int *widthp, int *heightp) } #else -#ifdef VMS - - /* Use a fresh channel since the current one may have stale info - (for example, from prior to a suspend); and to avoid a dependency - in the init sequence. */ - int chan; - struct sensemode tty; - - SYS$ASSIGN (&input_dsc, &chan, 0, 0); - SYS$QIOW (0, chan, IO$_SENSEMODE, &tty, 0, 0, - &tty.class, 12, 0, 0, 0, 0); - SYS$DASSGN (chan); - *widthp = tty.scr_wid; - *heightp = tty.scr_len; - -#else #ifdef MSDOS *widthp = ScreenCols (); *heightp = ScreenRows (); @@ -1648,7 +1476,6 @@ get_tty_size (int fd, int *widthp, int *heightp) *widthp = 0; *heightp = 0; #endif -#endif /* not VMS */ #endif /* not SunOS-style */ #endif /* not BSD-style */ } @@ -1822,270 +1649,7 @@ setup_pty (fd) } #endif /* HAVE_PTYS */ -#ifdef VMS - -/* Assigning an input channel is done at the start of Emacs execution. - This is called each time Emacs is resumed, also, but does nothing - because input_chain is no longer zero. */ - -void -init_vms_input () -{ - int status; - - if (fileno (CURTTY ()->input)) == 0) - { - status = SYS$ASSIGN (&input_dsc, &fileno (CURTTY ()->input)), 0, 0); - if (! (status & 1)) - LIB$STOP (status); - } -} - -/* Deassigning the input channel is done before exiting. */ - -void -stop_vms_input () -{ - return SYS$DASSGN (fileno (CURTTY ()->input))); -} - -short input_buffer; - -/* Request reading one character into the keyboard buffer. - This is done as soon as the buffer becomes empty. */ - -void -queue_kbd_input () -{ - int status; - extern kbd_input_ast (); - - waiting_for_ast = 0; - stop_input = 0; - status = SYS$QIO (0, fileno (CURTTY()->input), IO$_READVBLK, - &input_iosb, kbd_input_ast, 1, - &input_buffer, 1, 0, terminator_mask, 0, 0); -} - -int input_count; - -/* Ast routine that is called when keyboard input comes in - in accord with the SYS$QIO above. */ - -void -kbd_input_ast () -{ - register int c = -1; - int old_errno = errno; - extern EMACS_TIME *input_available_clear_time; - - if (waiting_for_ast) - SYS$SETEF (input_ef); - waiting_for_ast = 0; - input_count++; -#ifdef ASTDEBUG - if (input_count == 25) - exit (1); - printf ("Ast # %d,", input_count); - printf (" iosb = %x, %x, %x, %x", - input_iosb.offset, input_iosb.status, input_iosb.termlen, - input_iosb.term); -#endif - if (input_iosb.offset) - { - c = input_buffer; -#ifdef ASTDEBUG - printf (", char = 0%o", c); -#endif - } -#ifdef ASTDEBUG - printf ("\n"); - fflush (stdout); - sleep (1); -#endif - if (! stop_input) - queue_kbd_input (); - if (c >= 0) - { - struct input_event e; - EVENT_INIT (e); - - e.kind = ASCII_KEYSTROKE_EVENT; - XSETINT (e.code, c); - e.frame_or_window = selected_frame; - kbd_buffer_store_event (&e); - } - if (input_available_clear_time) - EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); - errno = old_errno; -} - -/* Wait until there is something in kbd_buffer. */ - -void -wait_for_kbd_input () -{ - extern int have_process_input, process_exited; - - /* If already something, avoid doing system calls. */ - if (detect_input_pending ()) - { - return; - } - /* Clear a flag, and tell ast routine above to set it. */ - SYS$CLREF (input_ef); - waiting_for_ast = 1; - /* Check for timing error: ast happened while we were doing that. */ - if (!detect_input_pending ()) - { - /* No timing error: wait for flag to be set. */ - set_waiting_for_input (0); - SYS$WFLOR (input_ef, input_eflist); - clear_waiting_for_input (); - if (!detect_input_pending ()) - /* Check for subprocess input availability */ - { - int dsp = have_process_input || process_exited; - - SYS$CLREF (process_ef); - if (have_process_input) - process_command_input (); - if (process_exited) - process_exit (); - if (dsp) - { - update_mode_lines++; - prepare_menu_bars (); - redisplay_preserve_echo_area (18); - } - } - } - waiting_for_ast = 0; -} - -/* Get rid of any pending QIO, when we are about to suspend - or when we want to throw away pending input. - We wait for a positive sign that the AST routine has run - and therefore there is no I/O request queued when we return. - SYS$SETAST is used to avoid a timing error. */ - -void -end_kbd_input () -{ -#ifdef ASTDEBUG - printf ("At end_kbd_input.\n"); - fflush (stdout); - sleep (1); -#endif - if (LIB$AST_IN_PROG ()) /* Don't wait if suspending from kbd_buffer_store_event! */ - { - SYS$CANCEL (fileno (CURTTY()->input)); - return; - } - - SYS$SETAST (0); - /* Clear a flag, and tell ast routine above to set it. */ - SYS$CLREF (input_ef); - waiting_for_ast = 1; - stop_input = 1; - SYS$CANCEL (fileno (CURTTY()->input)); - SYS$SETAST (1); - SYS$WAITFR (input_ef); - waiting_for_ast = 0; -} - -/* Wait for either input available or time interval expiry. */ - -void -input_wait_timeout (timeval) - int timeval; /* Time to wait, in seconds */ -{ - int time [2]; - static int zero = 0; - static int large = -10000000; - - LIB$EMUL (&timeval, &large, &zero, time); /* Convert to VMS format */ - - /* If already something, avoid doing system calls. */ - if (detect_input_pending ()) - { - return; - } - /* Clear a flag, and tell ast routine above to set it. */ - SYS$CLREF (input_ef); - waiting_for_ast = 1; - /* Check for timing error: ast happened while we were doing that. */ - if (!detect_input_pending ()) - { - /* No timing error: wait for flag to be set. */ - SYS$CANTIM (1, 0); - if (SYS$SETIMR (timer_ef, time, 0, 1) & 1) /* Set timer */ - SYS$WFLOR (timer_ef, timer_eflist); /* Wait for timer expiry or input */ - } - waiting_for_ast = 0; -} - -/* The standard `sleep' routine works some other way - and it stops working if you have ever quit out of it. - This one continues to work. */ - -sys_sleep (timeval) - int timeval; -{ - int time [2]; - static int zero = 0; - static int large = -10000000; - - LIB$EMUL (&timeval, &large, &zero, time); /* Convert to VMS format */ - - SYS$CANTIM (1, 0); - if (SYS$SETIMR (timer_ef, time, 0, 1) & 1) /* Set timer */ - SYS$WAITFR (timer_ef); /* Wait for timer expiry only */ -} - -void -init_sigio (fd) - int fd; -{ - request_sigio (); -} - -reset_sigio (fd) - int fd; -{ - unrequest_sigio (); -} - -void -request_sigio () -{ - if (noninteractive) - return; - croak ("request sigio"); -} - -void -unrequest_sigio () -{ - if (noninteractive) - return; - croak ("unrequest sigio"); -} - -#endif /* VMS */ - -/* Note that VMS compiler won't accept defined (CANNOT_DUMP). */ -#ifndef CANNOT_DUMP -#define NEED_STARTS -#endif - -#ifndef SYSTEM_MALLOC -#ifndef NEED_STARTS -#define NEED_STARTS -#endif -#endif - -#ifdef NEED_STARTS +#if !defined(CANNOT_DUMP) || !defined(SYSTEM_MALLOC) /* Some systems that cannot dump also cannot implement these. */ /* @@ -2167,12 +1731,10 @@ start_of_data () extern Lisp_Object Vsystem_name; -#ifndef VMS #ifdef HAVE_SOCKETS #include <sys/socket.h> #include <netdb.h> #endif /* HAVE_SOCKETS */ -#endif /* not VMS */ #ifdef TRY_AGAIN #ifndef HAVE_H_ERRNO @@ -2183,15 +1745,6 @@ extern int h_errno; void init_system_name () { -#ifdef VMS - char *sp, *end; - if ((sp = egetenv ("SYS$NODE")) == 0) - Vsystem_name = build_string ("vax-vms"); - else if ((end = index (sp, ':')) == 0) - Vsystem_name = build_string (sp); - else - Vsystem_name = make_string (sp, end - sp); -#else #ifndef HAVE_GETHOSTNAME struct utsname uts; uname (&uts); @@ -2307,7 +1860,6 @@ init_system_name () #endif /* HAVE_SOCKETS */ Vsystem_name = build_string (hostname); #endif /* HAVE_GETHOSTNAME */ -#endif /* VMS */ { unsigned char *p; for (p = SDATA (Vsystem_name); *p; p++) @@ -2317,7 +1869,6 @@ init_system_name () } #ifndef MSDOS -#ifndef VMS #if !defined (HAVE_SELECT) #include "sysselect.h" @@ -2557,7 +2108,6 @@ read_input_waiting () #endif #endif /* not HAVE_SELECT */ -#endif /* not VMS */ #endif /* not MSDOS */ /* POSIX signals support - DJB */ @@ -2888,112 +2438,6 @@ get_random () #endif /* need at least 2 */ return val & ((1L << VALBITS) - 1); } - -#ifdef VMS - -#ifdef getenv -/* If any place else asks for the TERM variable, - allow it to be overridden with the EMACS_TERM variable - before attempting to translate the logical name TERM. As a last - resort, ask for VAX C's special idea of the TERM variable. */ -#undef getenv -char * -sys_getenv (name) - char *name; -{ - register char *val; - static char buf[256]; - static struct dsc$descriptor_s equiv - = {sizeof (buf), DSC$K_DTYPE_T, DSC$K_CLASS_S, buf}; - static struct dsc$descriptor_s d_name - = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0}; - short eqlen; - - if (!strcmp (name, "TERM")) - { - val = (char *) getenv ("EMACS_TERM"); - if (val) - return val; - } - - d_name.dsc$w_length = strlen (name); - d_name.dsc$a_pointer = name; - if (LIB$SYS_TRNLOG (&d_name, &eqlen, &equiv) == 1) - { - char *str = (char *) xmalloc (eqlen + 1); - bcopy (buf, str, eqlen); - str[eqlen] = '\0'; - /* This is a storage leak, but a pain to fix. With luck, - no one will ever notice. */ - return str; - } - return (char *) getenv (name); -} -#endif /* getenv */ - -#ifdef abort -/* Since VMS doesn't believe in core dumps, the only way to debug this beast is - to force a call on the debugger from within the image. */ -#undef abort -sys_abort () -{ - reset_all_sys_modes (); - LIB$SIGNAL (SS$_DEBUG); -} -#endif /* abort */ -#endif /* VMS */ - -#ifdef VMS -#ifdef LINK_CRTL_SHARE -#ifdef SHARABLE_LIB_BUG -/* Variables declared noshare and initialized in sharable libraries - cannot be shared. The VMS linker incorrectly forces you to use a private - version which is uninitialized... If not for this "feature", we - could use the C library definition of sys_nerr and sys_errlist. */ -int sys_nerr = 35; -char *sys_errlist[] = - { - "error 0", - "not owner", - "no such file or directory", - "no such process", - "interrupted system call", - "i/o error", - "no such device or address", - "argument list too long", - "exec format error", - "bad file number", - "no child process", - "no more processes", - "not enough memory", - "permission denied", - "bad address", - "block device required", - "mount devices busy", - "file exists", - "cross-device link", - "no such device", - "not a directory", - "is a directory", - "invalid argument", - "file table overflow", - "too many open files", - "not a typewriter", - "text file busy", - "file too big", - "no space left on device", - "illegal seek", - "read-only file system", - "too many links", - "broken pipe", - "math argument", - "result too large", - "I/O stream empty", - "vax/vms specific error code nontranslatable error" - }; -#endif /* SHARABLE_LIB_BUG */ -#endif /* LINK_CRTL_SHARE */ -#endif /* VMS */ #ifndef HAVE_STRERROR #ifndef WINDOWSNT @@ -3225,7 +2669,6 @@ dup2 (oldd, newd) */ #ifdef subprocesses -#ifndef VMS #ifndef HAVE_GETTIMEOFDAY #ifdef HAVE_TIMEVAL @@ -3246,8 +2689,7 @@ gettimeofday (tp, tzp) #endif #endif -#endif -#endif /* subprocess && !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL && !VMS */ +#endif /* subprocess && !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */ /* * This function will go away as soon as all the stubs fixed. (fnf) @@ -3292,150 +2734,6 @@ closedir (DIR *dirp /* stream from opendir */) #endif /* not HAVE_CLOSEDIR */ #endif /* SYSV_SYSTEM_DIR */ -#ifdef NONSYSTEM_DIR_LIBRARY - -DIR * -opendir (filename) - char *filename; /* name of directory */ -{ - register DIR *dirp; /* -> malloc'ed storage */ - register int fd; /* file descriptor for read */ - struct stat sbuf; /* result of fstat */ - - fd = emacs_open (filename, O_RDONLY, 0); - if (fd < 0) - return 0; - - BLOCK_INPUT; - if (fstat (fd, &sbuf) < 0 - || (sbuf.st_mode & S_IFMT) != S_IFDIR - || (dirp = (DIR *) xmalloc (sizeof (DIR))) == 0) - { - emacs_close (fd); - UNBLOCK_INPUT; - return 0; /* bad luck today */ - } - UNBLOCK_INPUT; - - dirp->dd_fd = fd; - dirp->dd_loc = dirp->dd_size = 0; /* refill needed */ - - return dirp; -} - -void -closedir (dirp) - register DIR *dirp; /* stream from opendir */ -{ - emacs_close (dirp->dd_fd); - xfree ((char *) dirp); -} - - -#ifndef VMS -#define DIRSIZ 14 -struct olddir - { - ino_t od_ino; /* inode */ - char od_name[DIRSIZ]; /* filename */ - }; -#endif /* not VMS */ - -struct direct dir_static; /* simulated directory contents */ - -/* ARGUSED */ -struct direct * -readdir (dirp) - register DIR *dirp; /* stream from opendir */ -{ -#ifndef VMS - register struct olddir *dp; /* -> directory data */ -#else /* VMS */ - register struct dir$_name *dp; /* -> directory data */ - register struct dir$_version *dv; /* -> version data */ -#endif /* VMS */ - - for (; ;) - { - if (dirp->dd_loc >= dirp->dd_size) - dirp->dd_loc = dirp->dd_size = 0; - - if (dirp->dd_size == 0 /* refill buffer */ - && (dirp->dd_size = emacs_read (dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ)) <= 0) - return 0; - -#ifndef VMS - dp = (struct olddir *) &dirp->dd_buf[dirp->dd_loc]; - dirp->dd_loc += sizeof (struct olddir); - - if (dp->od_ino != 0) /* not deleted entry */ - { - dir_static.d_ino = dp->od_ino; - strncpy (dir_static.d_name, dp->od_name, DIRSIZ); - dir_static.d_name[DIRSIZ] = '\0'; - dir_static.d_namlen = strlen (dir_static.d_name); - dir_static.d_reclen = sizeof (struct direct) - - MAXNAMLEN + 3 - + dir_static.d_namlen - dir_static.d_namlen % 4; - return &dir_static; /* -> simulated structure */ - } -#else /* VMS */ - dp = (struct dir$_name *) dirp->dd_buf; - if (dirp->dd_loc == 0) - dirp->dd_loc = (dp->dir$b_namecount&1) ? dp->dir$b_namecount + 1 - : dp->dir$b_namecount; - dv = (struct dir$_version *)&dp->dir$t_name[dirp->dd_loc]; - dir_static.d_ino = dv->dir$w_fid_num; - dir_static.d_namlen = dp->dir$b_namecount; - dir_static.d_reclen = sizeof (struct direct) - - MAXNAMLEN + 3 - + dir_static.d_namlen - dir_static.d_namlen % 4; - strncpy (dir_static.d_name, dp->dir$t_name, dp->dir$b_namecount); - dir_static.d_name[dir_static.d_namlen] = '\0'; - dirp->dd_loc = dirp->dd_size; /* only one record at a time */ - return &dir_static; -#endif /* VMS */ - } -} - -#ifdef VMS -/* readdirver is just like readdir except it returns all versions of a file - as separate entries. */ - -/* ARGUSED */ -struct direct * -readdirver (dirp) - register DIR *dirp; /* stream from opendir */ -{ - register struct dir$_name *dp; /* -> directory data */ - register struct dir$_version *dv; /* -> version data */ - - if (dirp->dd_loc >= dirp->dd_size - sizeof (struct dir$_name)) - dirp->dd_loc = dirp->dd_size = 0; - - if (dirp->dd_size == 0 /* refill buffer */ - && (dirp->dd_size = sys_read (dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ)) <= 0) - return 0; - - dp = (struct dir$_name *) dirp->dd_buf; - if (dirp->dd_loc == 0) - dirp->dd_loc = (dp->dir$b_namecount & 1) ? dp->dir$b_namecount + 1 - : dp->dir$b_namecount; - dv = (struct dir$_version *) &dp->dir$t_name[dirp->dd_loc]; - strncpy (dir_static.d_name, dp->dir$t_name, dp->dir$b_namecount); - sprintf (&dir_static.d_name[dp->dir$b_namecount], ";%d", dv->dir$w_version); - dir_static.d_namlen = strlen (dir_static.d_name); - dir_static.d_ino = dv->dir$w_fid_num; - dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 - + dir_static.d_namlen - dir_static.d_namlen % 4; - dirp->dd_loc = ((char *) (++dv) - dp->dir$t_name); - return &dir_static; -} - -#endif /* VMS */ - -#endif /* NONSYSTEM_DIR_LIBRARY */ - int set_file_times (filename, atime, mtime) @@ -3586,1259 +2884,6 @@ rmdir (dpath) } #endif /* !HAVE_RMDIR */ - - -/* Functions for VMS */ -#ifdef VMS -#include <acldef.h> -#include <chpdef.h> -#include <jpidef.h> - -/* Return as a string the VMS error string pertaining to STATUS. - Reuses the same static buffer each time it is called. */ - -char * -vmserrstr (status) - int status; /* VMS status code */ -{ - int bufadr[2]; - short len; - static char buf[257]; - - bufadr[0] = sizeof buf - 1; - bufadr[1] = (int) buf; - if (! (SYS$GETMSG (status, &len, bufadr, 0x1, 0) & 1)) - return "untranslatable VMS error status"; - buf[len] = '\0'; - return buf; -} - -#ifdef access -#undef access - -/* The following is necessary because 'access' emulation by VMS C (2.0) does - * not work correctly. (It also doesn't work well in version 2.3.) - */ - -#ifdef VMS4_4 - -#define DESCRIPTOR(name,string) struct dsc$descriptor_s name = \ - { strlen (string), DSC$K_DTYPE_T, DSC$K_CLASS_S, string } - -typedef union { - struct { - unsigned short s_buflen; - unsigned short s_code; - char *s_bufadr; - unsigned short *s_retlenadr; - } s; - int end; -} item; -#define buflen s.s_buflen -#define code s.s_code -#define bufadr s.s_bufadr -#define retlenadr s.s_retlenadr - -#define R_OK 4 /* test for read permission */ -#define W_OK 2 /* test for write permission */ -#define X_OK 1 /* test for execute (search) permission */ -#define F_OK 0 /* test for presence of file */ - -int -sys_access (path, mode) - char *path; - int mode; -{ - static char *user = NULL; - char dir_fn[512]; - - /* translate possible directory spec into .DIR file name, so brain-dead - * access can treat the directory like a file. */ - if (directory_file_name (path, dir_fn)) - path = dir_fn; - - if (mode == F_OK) - return access (path, mode); - if (user == NULL && (user = (char *) getenv ("USER")) == NULL) - return -1; - { - int stat; - int flags; - int acces; - unsigned short int dummy; - item itemlst[3]; - static int constant = ACL$C_FILE; - DESCRIPTOR (path_desc, path); - DESCRIPTOR (user_desc, user); - - flags = 0; - acces = 0; - if ((mode & X_OK) && ((stat = access (path, mode)) < 0 || mode == X_OK)) - return stat; - if (mode & R_OK) - acces |= CHP$M_READ; - if (mode & W_OK) - acces |= CHP$M_WRITE; - itemlst[0].buflen = sizeof (int); - itemlst[0].code = CHP$_FLAGS; - itemlst[0].bufadr = (char *) &flags; - itemlst[0].retlenadr = &dummy; - itemlst[1].buflen = sizeof (int); - itemlst[1].code = CHP$_ACCESS; - itemlst[1].bufadr = (char *) &acces; - itemlst[1].retlenadr = &dummy; - itemlst[2].end = CHP$_END; - stat = SYS$CHECK_ACCESS (&constant, &path_desc, &user_desc, itemlst); - return stat == SS$_NORMAL ? 0 : -1; - } -} - -#else /* not VMS4_4 */ - -#include <prvdef.h> -#define ACE$M_WRITE 2 -#define ACE$C_KEYID 1 - -static unsigned short memid, grpid; -static unsigned int uic; - -/* Called from init_sys_modes, so it happens not very often - but at least each time Emacs is loaded. */ -void -sys_access_reinit () -{ - uic = 0; -} - -int -sys_access (filename, type) - char * filename; - int type; -{ - struct FAB fab; - struct XABPRO xab; - int status, size, i, typecode, acl_controlled; - unsigned int *aclptr, *aclend, aclbuf[60]; - union prvdef prvmask; - - /* Get UIC and GRP values for protection checking. */ - if (uic == 0) - { - status = LIB$GETJPI (&JPI$_UIC, 0, 0, &uic, 0, 0); - if (! (status & 1)) - return -1; - memid = uic & 0xFFFF; - grpid = uic >> 16; - } - - if (type != 2) /* not checking write access */ - return access (filename, type); - - /* Check write protection. */ - -#define CHECKPRIV(bit) (prvmask.bit) -#define WRITABLE(field) (! ((xab.xab$w_pro >> field) & XAB$M_NOWRITE)) - - /* Find privilege bits */ - status = SYS$SETPRV (0, 0, 0, prvmask); - if (! (status & 1)) - error ("Unable to find privileges: %s", vmserrstr (status)); - if (CHECKPRIV (PRV$V_BYPASS)) - return 0; /* BYPASS enabled */ - fab = cc$rms_fab; - fab.fab$b_fac = FAB$M_GET; - fab.fab$l_fna = filename; - fab.fab$b_fns = strlen (filename); - fab.fab$l_xab = &xab; - xab = cc$rms_xabpro; - xab.xab$l_aclbuf = aclbuf; - xab.xab$w_aclsiz = sizeof (aclbuf); - status = SYS$OPEN (&fab, 0, 0); - if (! (status & 1)) - return -1; - SYS$CLOSE (&fab, 0, 0); - /* Check system access */ - if (CHECKPRIV (PRV$V_SYSPRV) && WRITABLE (XAB$V_SYS)) - return 0; - /* Check ACL entries, if any */ - acl_controlled = 0; - if (xab.xab$w_acllen > 0) - { - aclptr = aclbuf; - aclend = &aclbuf[xab.xab$w_acllen / 4]; - while (*aclptr && aclptr < aclend) - { - size = (*aclptr & 0xff) / 4; - typecode = (*aclptr >> 8) & 0xff; - if (typecode == ACE$C_KEYID) - for (i = size - 1; i > 1; i--) - if (aclptr[i] == uic) - { - acl_controlled = 1; - if (aclptr[1] & ACE$M_WRITE) - return 0; /* Write access through ACL */ - } - aclptr = &aclptr[size]; - } - if (acl_controlled) /* ACL specified, prohibits write access */ - return -1; - } - /* No ACL entries specified, check normal protection */ - if (WRITABLE (XAB$V_WLD)) /* World writable */ - return 0; - if (WRITABLE (XAB$V_GRP) && - (unsigned short) (xab.xab$l_uic >> 16) == grpid) - return 0; /* Group writable */ - if (WRITABLE (XAB$V_OWN) && - (xab.xab$l_uic & 0xFFFF) == memid) - return 0; /* Owner writable */ - - return -1; /* Not writable */ -} -#endif /* not VMS4_4 */ -#endif /* access */ - -static char vtbuf[NAM$C_MAXRSS+1]; - -/* translate a vms file spec to a unix path */ -char * -sys_translate_vms (vfile) - char * vfile; -{ - char * p; - char * targ; - - if (!vfile) - return 0; - - targ = vtbuf; - - /* leading device or logical name is a root directory */ - if (p = strchr (vfile, ':')) - { - *targ++ = '/'; - while (vfile < p) - *targ++ = *vfile++; - vfile++; - *targ++ = '/'; - } - p = vfile; - if (*p == '[' || *p == '<') - { - while (*++vfile != *p + 2) - switch (*vfile) - { - case '.': - if (vfile[-1] == *p) - *targ++ = '.'; - *targ++ = '/'; - break; - - case '-': - *targ++ = '.'; - *targ++ = '.'; - break; - - default: - *targ++ = *vfile; - break; - } - vfile++; - *targ++ = '/'; - } - while (*vfile) - *targ++ = *vfile++; - - return vtbuf; -} - -static char utbuf[NAM$C_MAXRSS+1]; - -/* translate a unix path to a VMS file spec */ -char * -sys_translate_unix (ufile) - char * ufile; -{ - int slash_seen = 0; - char *p; - char * targ; - - if (!ufile) - return 0; - - targ = utbuf; - - if (*ufile == '/') - { - ufile++; - } - - while (*ufile) - { - switch (*ufile) - { - case '/': - if (slash_seen) - if (index (&ufile[1], '/')) - *targ++ = '.'; - else - *targ++ = ']'; - else - { - *targ++ = ':'; - if (index (&ufile[1], '/')) - *targ++ = '['; - slash_seen = 1; - } - break; - - case '.': - if (strncmp (ufile, "./", 2) == 0) - { - if (!slash_seen) - { - *targ++ = '['; - slash_seen = 1; - } - ufile++; /* skip the dot */ - if (index (&ufile[1], '/')) - *targ++ = '.'; - else - *targ++ = ']'; - } - else if (strncmp (ufile, "../", 3) == 0) - { - if (!slash_seen) - { - *targ++ = '['; - slash_seen = 1; - } - *targ++ = '-'; - ufile += 2; /* skip the dots */ - if (index (&ufile[1], '/')) - *targ++ = '.'; - else - *targ++ = ']'; - } - else - *targ++ = *ufile; - break; - - default: - *targ++ = *ufile; - break; - } - ufile++; - } - *targ = '\0'; - - return utbuf; -} - -char * -getwd (pathname) - char *pathname; -{ - char *ptr, *val; - extern char *getcwd (); - -#define MAXPATHLEN 1024 - - ptr = xmalloc (MAXPATHLEN); - val = getcwd (ptr, MAXPATHLEN); - if (val == 0) - { - xfree (ptr); - return val; - } - strcpy (pathname, ptr); - xfree (ptr); - - return pathname; -} - -int -getppid () -{ - long item_code = JPI$_OWNER; - unsigned long parent_id; - int status; - - if (((status = LIB$GETJPI (&item_code, 0, 0, &parent_id)) & 1) == 0) - { - errno = EVMSERR; - vaxc$errno = status; - return -1; - } - return parent_id; -} - -#undef getuid -unsigned -sys_getuid () -{ - return (getgid () << 16) | getuid (); -} - -#undef read -int -sys_read (fildes, buf, nbyte) - int fildes; - char *buf; - unsigned int nbyte; -{ - return read (fildes, buf, (nbyte < MAXIOSIZE ? nbyte : MAXIOSIZE)); -} - -/* - * VAX/VMS VAX C RTL really loses. It insists that records - * end with a newline (carriage return) character, and if they - * don't it adds one (nice of it isn't it!) - * - * Thus we do this stupidity below. - */ - -#undef write -int -sys_write (fildes, buf, nbytes) - int fildes; - char *buf; - unsigned int nbytes; -{ - register char *p; - register char *e; - int sum = 0; - struct stat st; - - fstat (fildes, &st); - p = buf; - while (nbytes > 0) - { - int len, retval; - - /* Handle fixed-length files with carriage control. */ - if (st.st_fab_rfm == FAB$C_FIX - && ((st.st_fab_rat & (FAB$M_FTN | FAB$M_CR)) != 0)) - { - len = st.st_fab_mrs; - retval = write (fildes, p, min (len, nbytes)); - if (retval != len) - return -1; - retval++; /* This skips the implied carriage control */ - } - else - { - e = p + min (MAXIOSIZE, nbytes) - 1; - while (*e != '\n' && e > p) e--; - if (p == e) /* Ok.. so here we add a newline... sigh. */ - e = p + min (MAXIOSIZE, nbytes) - 1; - len = e + 1 - p; - retval = write (fildes, p, len); - if (retval != len) - return -1; - } - p += retval; - sum += retval; - nbytes -= retval; - } - return sum; -} - -/* Create file NEW copying its attributes from file OLD. If - OLD is 0 or does not exist, create based on the value of - vms_stmlf_recfm. */ - -/* Protection value the file should ultimately have. - Set by create_copy_attrs, and use by rename_sansversions. */ -static unsigned short int fab_final_pro; - -int -creat_copy_attrs (old, new) - char *old, *new; -{ - struct FAB fab = cc$rms_fab; - struct XABPRO xabpro; - char aclbuf[256]; /* Choice of size is arbitrary. See below. */ - extern int vms_stmlf_recfm; - - if (old) - { - fab.fab$b_fac = FAB$M_GET; - fab.fab$l_fna = old; - fab.fab$b_fns = strlen (old); - fab.fab$l_xab = (char *) &xabpro; - xabpro = cc$rms_xabpro; - xabpro.xab$l_aclbuf = aclbuf; - xabpro.xab$w_aclsiz = sizeof aclbuf; - /* Call $OPEN to fill in the fab & xabpro fields. */ - if (SYS$OPEN (&fab, 0, 0) & 1) - { - SYS$CLOSE (&fab, 0, 0); - fab.fab$l_alq = 0; /* zero the allocation quantity */ - if (xabpro.xab$w_acllen > 0) - { - if (xabpro.xab$w_acllen > sizeof aclbuf) - /* If the acl buffer was too short, redo open with longer one. - Wouldn't need to do this if there were some system imposed - limit on the size of an ACL, but I can't find any such. */ - { - xabpro.xab$l_aclbuf = (char *) alloca (xabpro.xab$w_acllen); - xabpro.xab$w_aclsiz = xabpro.xab$w_acllen; - if (SYS$OPEN (&fab, 0, 0) & 1) - SYS$CLOSE (&fab, 0, 0); - else - old = 0; - } - } - else - xabpro.xab$l_aclbuf = 0; - } - else - old = 0; - } - fab.fab$l_fna = new; - fab.fab$b_fns = strlen (new); - if (!old) - { - fab.fab$l_xab = 0; - fab.fab$b_rfm = vms_stmlf_recfm ? FAB$C_STMLF : FAB$C_VAR; - fab.fab$b_rat = FAB$M_CR; - } - - /* Set the file protections such that we will be able to manipulate - this file. Once we are done writing and renaming it, we will set - the protections back. */ - if (old) - fab_final_pro = xabpro.xab$w_pro; - else - SYS$SETDFPROT (0, &fab_final_pro); - xabpro.xab$w_pro &= 0xff0f; /* set O:rewd for now. This is set back later. */ - - /* Create the new file with either default attrs or attrs copied - from old file. */ - if (!(SYS$CREATE (&fab, 0, 0) & 1)) - return -1; - SYS$CLOSE (&fab, 0, 0); - /* As this is a "replacement" for creat, return a file descriptor - opened for writing. */ - return open (new, O_WRONLY); -} - -#ifdef creat -#undef creat -#include <varargs.h> -#ifdef __GNUC__ -#ifndef va_count -#define va_count(X) ((X) = *(((int *) &(va_alist)) - 1)) -#endif -#endif - -int -sys_creat (va_alist) - va_dcl -{ - va_list list_incrementer; - char *name; - int mode; - int rfd; /* related file descriptor */ - int fd; /* Our new file descriptor */ - int count; - struct stat st_buf; - char rfm[12]; - char rat[15]; - char mrs[13]; - char fsz[13]; - extern int vms_stmlf_recfm; - - va_count (count); - va_start (list_incrementer); - name = va_arg (list_incrementer, char *); - mode = va_arg (list_incrementer, int); - if (count > 2) - rfd = va_arg (list_incrementer, int); - va_end (list_incrementer); - if (count > 2) - { - /* Use information from the related file descriptor to set record - format of the newly created file. */ - fstat (rfd, &st_buf); - switch (st_buf.st_fab_rfm) - { - case FAB$C_FIX: - strcpy (rfm, "rfm = fix"); - sprintf (mrs, "mrs = %d", st_buf.st_fab_mrs); - strcpy (rat, "rat = "); - if (st_buf.st_fab_rat & FAB$M_CR) - strcat (rat, "cr"); - else if (st_buf.st_fab_rat & FAB$M_FTN) - strcat (rat, "ftn"); - else if (st_buf.st_fab_rat & FAB$M_PRN) - strcat (rat, "prn"); - if (st_buf.st_fab_rat & FAB$M_BLK) - if (st_buf.st_fab_rat & (FAB$M_CR|FAB$M_FTN|FAB$M_PRN)) - strcat (rat, ", blk"); - else - strcat (rat, "blk"); - return creat (name, 0, rfm, rat, mrs); - - case FAB$C_VFC: - strcpy (rfm, "rfm = vfc"); - sprintf (fsz, "fsz = %d", st_buf.st_fab_fsz); - strcpy (rat, "rat = "); - if (st_buf.st_fab_rat & FAB$M_CR) - strcat (rat, "cr"); - else if (st_buf.st_fab_rat & FAB$M_FTN) - strcat (rat, "ftn"); - else if (st_buf.st_fab_rat & FAB$M_PRN) - strcat (rat, "prn"); - if (st_buf.st_fab_rat & FAB$M_BLK) - if (st_buf.st_fab_rat & (FAB$M_CR|FAB$M_FTN|FAB$M_PRN)) - strcat (rat, ", blk"); - else - strcat (rat, "blk"); - return creat (name, 0, rfm, rat, fsz); - - case FAB$C_STM: - strcpy (rfm, "rfm = stm"); - break; - - case FAB$C_STMCR: - strcpy (rfm, "rfm = stmcr"); - break; - - case FAB$C_STMLF: - strcpy (rfm, "rfm = stmlf"); - break; - - case FAB$C_UDF: - strcpy (rfm, "rfm = udf"); - break; - - case FAB$C_VAR: - strcpy (rfm, "rfm = var"); - break; - } - strcpy (rat, "rat = "); - if (st_buf.st_fab_rat & FAB$M_CR) - strcat (rat, "cr"); - else if (st_buf.st_fab_rat & FAB$M_FTN) - strcat (rat, "ftn"); - else if (st_buf.st_fab_rat & FAB$M_PRN) - strcat (rat, "prn"); - if (st_buf.st_fab_rat & FAB$M_BLK) - if (st_buf.st_fab_rat & (FAB$M_CR|FAB$M_FTN|FAB$M_PRN)) - strcat (rat, ", blk"); - else - strcat (rat, "blk"); - } - else - { - strcpy (rfm, vms_stmlf_recfm ? "rfm = stmlf" : "rfm=var"); - strcpy (rat, "rat=cr"); - } - /* Until the VAX C RTL fixes the many bugs with modes, always use - mode 0 to get the user's default protection. */ - fd = creat (name, 0, rfm, rat); - if (fd < 0 && errno == EEXIST) - { - if (unlink (name) < 0) - report_file_error ("delete", build_string (name)); - fd = creat (name, 0, rfm, rat); - } - return fd; -} -#endif /* creat */ - -/* fwrite to stdout is S L O W. Speed it up by using fputc...*/ -int -sys_fwrite (ptr, size, num, fp) - register char * ptr; - FILE * fp; -{ - register int tot = num * size; - - while (tot--) - fputc (*ptr++, fp); - return num; -} - -/* - * The VMS C library routine creat actually creates a new version of an - * existing file rather than truncating the old version. There are times - * when this is not the desired behavior, for instance, when writing an - * auto save file (you only want one version), or when you don't have - * write permission in the directory containing the file (but the file - * itself is writable). Hence this routine, which is equivalent to - * "close (creat (fn, 0));" on Unix if fn already exists. - */ -int -vms_truncate (fn) - char *fn; -{ - struct FAB xfab = cc$rms_fab; - struct RAB xrab = cc$rms_rab; - int status; - - xfab.fab$l_fop = FAB$M_TEF; /* free allocated but unused blocks on close */ - xfab.fab$b_fac = FAB$M_TRN | FAB$M_GET; /* allow truncate and get access */ - xfab.fab$b_shr = FAB$M_NIL; /* allow no sharing - file must be locked */ - xfab.fab$l_fna = fn; - xfab.fab$b_fns = strlen (fn); - xfab.fab$l_dna = ";0"; /* default to latest version of the file */ - xfab.fab$b_dns = 2; - xrab.rab$l_fab = &xfab; - - /* This gibberish opens the file, positions to the first record, and - deletes all records from there until the end of file. */ - if ((SYS$OPEN (&xfab) & 01) == 01) - { - if ((SYS$CONNECT (&xrab) & 01) == 01 && - (SYS$FIND (&xrab) & 01) == 01 && - (SYS$TRUNCATE (&xrab) & 01) == 01) - status = 0; - else - status = -1; - } - else - status = -1; - SYS$CLOSE (&xfab); - return status; -} - -/* Define this symbol to actually read SYSUAF.DAT. This requires either - SYSPRV or a readable SYSUAF.DAT. */ - -#ifdef READ_SYSUAF -/* - * getuaf.c - * - * Routine to read the VMS User Authorization File and return - * a specific user's record. - */ - -static struct UAF retuaf; - -struct UAF * -get_uaf_name (uname) - char * uname; -{ - register status; - struct FAB uaf_fab; - struct RAB uaf_rab; - - uaf_fab = cc$rms_fab; - uaf_rab = cc$rms_rab; - /* initialize fab fields */ - uaf_fab.fab$l_fna = "SYS$SYSTEM:SYSUAF.DAT"; - uaf_fab.fab$b_fns = 21; - uaf_fab.fab$b_fac = FAB$M_GET; - uaf_fab.fab$b_org = FAB$C_IDX; - uaf_fab.fab$b_shr = FAB$M_GET|FAB$M_PUT|FAB$M_UPD|FAB$M_DEL; - /* initialize rab fields */ - uaf_rab.rab$l_fab = &uaf_fab; - /* open the User Authorization File */ - status = SYS$OPEN (&uaf_fab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - status = SYS$CONNECT (&uaf_rab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - /* read the requested record - index is in uname */ - uaf_rab.rab$l_kbf = uname; - uaf_rab.rab$b_ksz = strlen (uname); - uaf_rab.rab$b_rac = RAB$C_KEY; - uaf_rab.rab$l_ubf = (char *)&retuaf; - uaf_rab.rab$w_usz = sizeof retuaf; - status = SYS$GET (&uaf_rab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - /* close the User Authorization File */ - status = SYS$DISCONNECT (&uaf_rab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - status = SYS$CLOSE (&uaf_fab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - return &retuaf; -} - -struct UAF * -get_uaf_uic (uic) - unsigned long uic; -{ - register status; - struct FAB uaf_fab; - struct RAB uaf_rab; - - uaf_fab = cc$rms_fab; - uaf_rab = cc$rms_rab; - /* initialize fab fields */ - uaf_fab.fab$l_fna = "SYS$SYSTEM:SYSUAF.DAT"; - uaf_fab.fab$b_fns = 21; - uaf_fab.fab$b_fac = FAB$M_GET; - uaf_fab.fab$b_org = FAB$C_IDX; - uaf_fab.fab$b_shr = FAB$M_GET|FAB$M_PUT|FAB$M_UPD|FAB$M_DEL; - /* initialize rab fields */ - uaf_rab.rab$l_fab = &uaf_fab; - /* open the User Authorization File */ - status = SYS$OPEN (&uaf_fab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - status = SYS$CONNECT (&uaf_rab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - /* read the requested record - index is in uic */ - uaf_rab.rab$b_krf = 1; /* 1st alternate key */ - uaf_rab.rab$l_kbf = (char *) &uic; - uaf_rab.rab$b_ksz = sizeof uic; - uaf_rab.rab$b_rac = RAB$C_KEY; - uaf_rab.rab$l_ubf = (char *)&retuaf; - uaf_rab.rab$w_usz = sizeof retuaf; - status = SYS$GET (&uaf_rab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - /* close the User Authorization File */ - status = SYS$DISCONNECT (&uaf_rab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - status = SYS$CLOSE (&uaf_fab); - if (!(status&1)) - { - errno = EVMSERR; - vaxc$errno = status; - return 0; - } - return &retuaf; -} - -static struct passwd retpw; - -struct passwd * -cnv_uaf_pw (up) - struct UAF * up; -{ - char * ptr; - - /* copy these out first because if the username is 32 chars, the next - section will overwrite the first byte of the UIC */ - retpw.pw_uid = up->uaf$w_mem; - retpw.pw_gid = up->uaf$w_grp; - - /* I suppose this is not the best style, to possibly overwrite one - byte beyond the end of the field, but what the heck... */ - ptr = &up->uaf$t_username[UAF$S_USERNAME]; - while (ptr[-1] == ' ') - ptr--; - *ptr = '\0'; - strcpy (retpw.pw_name, up->uaf$t_username); - - /* the rest of these are counted ascii strings */ - strncpy (retpw.pw_gecos, &up->uaf$t_owner[1], up->uaf$t_owner[0]); - retpw.pw_gecos[up->uaf$t_owner[0]] = '\0'; - strncpy (retpw.pw_dir, &up->uaf$t_defdev[1], up->uaf$t_defdev[0]); - retpw.pw_dir[up->uaf$t_defdev[0]] = '\0'; - strncat (retpw.pw_dir, &up->uaf$t_defdir[1], up->uaf$t_defdir[0]); - retpw.pw_dir[up->uaf$t_defdev[0] + up->uaf$t_defdir[0]] = '\0'; - strncpy (retpw.pw_shell, &up->uaf$t_defcli[1], up->uaf$t_defcli[0]); - retpw.pw_shell[up->uaf$t_defcli[0]] = '\0'; - - return &retpw; -} -#else /* not READ_SYSUAF */ -static struct passwd retpw; -#endif /* not READ_SYSUAF */ - -struct passwd * -getpwnam (name) - char * name; -{ -#ifdef READ_SYSUAF - struct UAF *up; -#else - char * user; - char * dir; - unsigned char * full; -#endif /* READ_SYSUAF */ - char *ptr = name; - - while (*ptr) - { - if ('a' <= *ptr && *ptr <= 'z') - *ptr -= 040; - ptr++; - } -#ifdef READ_SYSUAF - if (!(up = get_uaf_name (name))) - return 0; - return cnv_uaf_pw (up); -#else - if (strcmp (name, getenv ("USER")) == 0) - { - retpw.pw_uid = getuid (); - retpw.pw_gid = getgid (); - strcpy (retpw.pw_name, name); - if (full = egetenv ("FULLNAME")) - strcpy (retpw.pw_gecos, full); - else - *retpw.pw_gecos = '\0'; - strcpy (retpw.pw_dir, egetenv ("HOME")); - *retpw.pw_shell = '\0'; - return &retpw; - } - else - return 0; -#endif /* not READ_SYSUAF */ -} - -struct passwd * -getpwuid (uid) - unsigned long uid; -{ -#ifdef READ_SYSUAF - struct UAF * up; - - if (!(up = get_uaf_uic (uid))) - return 0; - return cnv_uaf_pw (up); -#else - if (uid == sys_getuid ()) - return getpwnam (egetenv ("USER")); - else - return 0; -#endif /* not READ_SYSUAF */ -} - -/* return total address space available to the current process. This is - the sum of the current p0 size, p1 size and free page table entries - available. */ -int -vlimit () -{ - int item_code; - unsigned long free_pages; - unsigned long frep0va; - unsigned long frep1va; - register status; - - item_code = JPI$_FREPTECNT; - if (((status = LIB$GETJPI (&item_code, 0, 0, &free_pages)) & 1) == 0) - { - errno = EVMSERR; - vaxc$errno = status; - return -1; - } - free_pages *= 512; - - item_code = JPI$_FREP0VA; - if (((status = LIB$GETJPI (&item_code, 0, 0, &frep0va)) & 1) == 0) - { - errno = EVMSERR; - vaxc$errno = status; - return -1; - } - item_code = JPI$_FREP1VA; - if (((status = LIB$GETJPI (&item_code, 0, 0, &frep1va)) & 1) == 0) - { - errno = EVMSERR; - vaxc$errno = status; - return -1; - } - - return free_pages + frep0va + (0x7fffffff - frep1va); -} - -int -define_logical_name (varname, string) - char *varname; - char *string; -{ - struct dsc$descriptor_s strdsc = - {strlen (string), DSC$K_DTYPE_T, DSC$K_CLASS_S, string}; - struct dsc$descriptor_s envdsc = - {strlen (varname), DSC$K_DTYPE_T, DSC$K_CLASS_S, varname}; - struct dsc$descriptor_s lnmdsc = - {7, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$JOB"}; - - return LIB$SET_LOGICAL (&envdsc, &strdsc, &lnmdsc, 0, 0); -} - -int -delete_logical_name (varname) - char *varname; -{ - struct dsc$descriptor_s envdsc = - {strlen (varname), DSC$K_DTYPE_T, DSC$K_CLASS_S, varname}; - struct dsc$descriptor_s lnmdsc = - {7, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$JOB"}; - - return LIB$DELETE_LOGICAL (&envdsc, &lnmdsc); -} - -int -ulimit () -{ - return 0; -} - -int -setpgrp () -{ - return 0; -} - -int -execvp () -{ - error ("execvp system call not implemented"); - return -1; -} - -int -rename (from, to) - char *from, *to; -{ - int status; - struct FAB from_fab = cc$rms_fab, to_fab = cc$rms_fab; - struct NAM from_nam = cc$rms_nam, to_nam = cc$rms_nam; - char from_esn[NAM$C_MAXRSS]; - char to_esn[NAM$C_MAXRSS]; - - from_fab.fab$l_fna = from; - from_fab.fab$b_fns = strlen (from); - from_fab.fab$l_nam = &from_nam; - from_fab.fab$l_fop = FAB$M_NAM; - - from_nam.nam$l_esa = from_esn; - from_nam.nam$b_ess = sizeof from_esn; - - to_fab.fab$l_fna = to; - to_fab.fab$b_fns = strlen (to); - to_fab.fab$l_nam = &to_nam; - to_fab.fab$l_fop = FAB$M_NAM; - - to_nam.nam$l_esa = to_esn; - to_nam.nam$b_ess = sizeof to_esn; - - status = SYS$RENAME (&from_fab, 0, 0, &to_fab); - - if (status & 1) - return 0; - else - { - if (status == RMS$_DEV) - errno = EXDEV; - else - errno = EVMSERR; - vaxc$errno = status; - return -1; - } -} - -/* This function renames a file like `rename', but it strips - the version number from the "to" filename, such that the "to" file is - will always be a new version. It also sets the file protection once it is - finished. The protection that we will use is stored in fab_final_pro, - and was set when we did a creat_copy_attrs to create the file that we - are renaming. - - We could use the chmod function, but Eunichs uses 3 bits per user category - to describe the protection, and VMS uses 4 (write and delete are separate - bits). To maintain portability, the VMS implementation of `chmod' wires - the W and D bits together. */ - - -static struct fibdef fib; /* We need this initialized to zero */ -char vms_file_written[NAM$C_MAXRSS]; - -int -rename_sans_version (from,to) - char *from, *to; -{ - short int chan; - int stat; - short int iosb[4]; - int status; - struct FAB to_fab = cc$rms_fab; - struct NAM to_nam = cc$rms_nam; - struct dsc$descriptor fib_d ={sizeof (fib),0,0,(char*) &fib}; - struct dsc$descriptor fib_attr[2] - = {{sizeof (fab_final_pro),ATR$C_FPRO,0,(char*) &fab_final_pro},{0,0,0,0}}; - char to_esn[NAM$C_MAXRSS]; - - $DESCRIPTOR (disk,to_esn); - - to_fab.fab$l_fna = to; - to_fab.fab$b_fns = strlen (to); - to_fab.fab$l_nam = &to_nam; - to_fab.fab$l_fop = FAB$M_NAM; - - to_nam.nam$l_esa = to_esn; - to_nam.nam$b_ess = sizeof to_esn; - - status = SYS$PARSE (&to_fab, 0, 0); /* figure out the full file name */ - - if (to_nam.nam$l_fnb && NAM$M_EXP_VER) - *(to_nam.nam$l_ver) = '\0'; - - stat = rename (from, to_esn); - if (stat < 0) - return stat; - - strcpy (vms_file_written, to_esn); - - to_fab.fab$l_fna = vms_file_written; /* this points to the versionless name */ - to_fab.fab$b_fns = strlen (vms_file_written); - - /* Now set the file protection to the correct value */ - SYS$OPEN (&to_fab, 0, 0); /* This fills in the nam$w_fid fields */ - - /* Copy these fields into the fib */ - fib.fib$r_fid_overlay.fib$w_fid[0] = to_nam.nam$w_fid[0]; - fib.fib$r_fid_overlay.fib$w_fid[1] = to_nam.nam$w_fid[1]; - fib.fib$r_fid_overlay.fib$w_fid[2] = to_nam.nam$w_fid[2]; - - SYS$CLOSE (&to_fab, 0, 0); - - stat = SYS$ASSIGN (&disk, &chan, 0, 0); /* open a channel to the disk */ - if (!stat) - LIB$SIGNAL (stat); - stat = SYS$QIOW (0, chan, IO$_MODIFY, iosb, 0, 0, &fib_d, - 0, 0, 0, &fib_attr, 0); - if (!stat) - LIB$SIGNAL (stat); - stat = SYS$DASSGN (chan); - if (!stat) - LIB$SIGNAL (stat); - strcpy (vms_file_written, to_esn); /* We will write this to the terminal*/ - return 0; -} - -int -link (file, new) - char * file, * new; -{ - register status; - struct FAB fab; - struct NAM nam; - unsigned short fid[3]; - char esa[NAM$C_MAXRSS]; - - fab = cc$rms_fab; - fab.fab$l_fop = FAB$M_OFP; - fab.fab$l_fna = file; - fab.fab$b_fns = strlen (file); - fab.fab$l_nam = &nam; - - nam = cc$rms_nam; - nam.nam$l_esa = esa; - nam.nam$b_ess = NAM$C_MAXRSS; - - status = SYS$PARSE (&fab); - if ((status & 1) == 0) - { - errno = EVMSERR; - vaxc$errno = status; - return -1; - } - status = SYS$SEARCH (&fab); - if ((status & 1) == 0) - { - errno = EVMSERR; - vaxc$errno = status; - return -1; - } - - fid[0] = nam.nam$w_fid[0]; - fid[1] = nam.nam$w_fid[1]; - fid[2] = nam.nam$w_fid[2]; - - fab.fab$l_fna = new; - fab.fab$b_fns = strlen (new); - - status = SYS$PARSE (&fab); - if ((status & 1) == 0) - { - errno = EVMSERR; - vaxc$errno = status; - return -1; - } - - nam.nam$w_fid[0] = fid[0]; - nam.nam$w_fid[1] = fid[1]; - nam.nam$w_fid[2] = fid[2]; - - nam.nam$l_esa = nam.nam$l_name; - nam.nam$b_esl = nam.nam$b_name + nam.nam$b_type + nam.nam$b_ver; - - status = SYS$ENTER (&fab); - if ((status & 1) == 0) - { - errno = EVMSERR; - vaxc$errno = status; - return -1; - } - - return 0; -} - -void -croak (badfunc) - char *badfunc; -{ - printf ("%s not yet implemented\r\n", badfunc); - reset_all_sys_modes (); - exit (1); -} - -long -random () -{ - /* Arrange to return a range centered on zero. */ - return rand () - (1 << 30); -} - -void -srandom (seed) -{ - srand (seed); -} -#endif /* VMS */ #ifndef BSTRING @@ -4849,21 +2894,8 @@ bzero (b, length) register char *b; register int length; { -#ifdef VMS - short zero = 0; - long max_str = 65535; - - while (length > max_str) { - (void) LIB$MOVC5 (&zero, &zero, &zero, &max_str, b); - length -= max_str; - b += max_str; - } - max_str = length; - (void) LIB$MOVC5 (&zero, &zero, &zero, &max_str, b); -#else while (length-- > 0) *b++ = 0; -#endif /* not VMS */ } #endif /* no bzero */ @@ -4879,21 +2911,8 @@ bcopy (b1, b2, length) register char *b2; register int length; { -#ifdef VMS - long max_str = 65535; - - while (length > max_str) { - (void) LIB$MOVC3 (&max_str, b1, b2); - length -= max_str; - b1 += max_str; - b2 += max_str; - } - max_str = length; - (void) LIB$MOVC3 (&length, b1, b2); -#else while (length-- > 0) *b2++ = *b1++; -#endif /* not VMS */ } #endif /* (!defined (BSTRING) && !defined (bcopy)) || defined (NEED_BCOPY) */ @@ -4905,18 +2924,11 @@ bcmp (b1, b2, length) /* This could be a macro! */ register char *b2; register int length; { -#ifdef VMS - struct dsc$descriptor_s src1 = {length, DSC$K_DTYPE_T, DSC$K_CLASS_S, b1}; - struct dsc$descriptor_s src2 = {length, DSC$K_DTYPE_T, DSC$K_CLASS_S, b2}; - - return STR$COMPARE (&src1, &src2); -#else while (length-- > 0) if (*b1++ != *b2++) return 1; return 0; -#endif /* not VMS */ } #endif /* no bcmp */ #endif /* not BSTRING */ @@ -4930,12 +2942,8 @@ strsignal (code) if (0 <= code && code < NSIG) { -#ifdef VMS - signame = sys_errlist[code]; -#else /* Cast to suppress warning if the table has const char *. */ signame = (char *) sys_siglist[code]; -#endif } return signame; diff --git a/src/syssignal.h b/src/syssignal.h index 1aaae5562ff..21df63959f5 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -192,13 +192,11 @@ extern SIGMASKTYPE sigprocmask_set; /* Define SIGCHLD as an alias for SIGCLD. There are many conditionals testing SIGCHLD. */ -#ifndef VMS #ifdef SIGCLD #ifndef SIGCHLD #define SIGCHLD SIGCLD #endif /* SIGCHLD */ #endif /* ! defined (SIGCLD) */ -#endif /* VMS */ #ifndef HAVE_STRSIGNAL /* strsignal is in sysdep.c */ diff --git a/src/systime.h b/src/systime.h index e9161114afd..2a04beff757 100644 --- a/src/systime.h +++ b/src/systime.h @@ -42,12 +42,6 @@ extern char *tzname[]; /* RS6000 and others want it this way. */ extern time_t timezone; #endif -#ifdef VMS -#ifdef VAXC -#include "vmstime.h" -#endif -#endif - /* On some configurations (hpux8.0, X11R4), sys/time.h and X11/Xos.h disagree about the name of the guard symbol. */ #ifdef HPUX diff --git a/src/systty.h b/src/systty.h index 98f6ad493e6..b846a026232 100644 --- a/src/systty.h +++ b/src/systty.h @@ -40,46 +40,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define INCLUDED_FCNTL #include <fcntl.h> #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */ -#ifndef VMS #ifndef DOS_NT #include <sgtty.h> #endif /* not DOS_NT */ -#else /* VMS */ -#include <descrip.h> -static struct iosb -{ - short status; - short offset; - short termlen; - short term; -} input_iosb; - -extern int waiting_for_ast; -extern int stop_input; -extern int input_ef; -extern int timer_ef; -extern int process_ef; -extern int input_eflist; -extern int timer_eflist; - -static $DESCRIPTOR (input_dsc, "TT"); -static int terminator_mask[2] = { 0, 0 }; - -static struct sensemode { - short status; - unsigned char xmit_baud; - unsigned char rcv_baud; - unsigned char crfill; - unsigned char lffill; - unsigned char parity; - unsigned char unused; - char class; - char type; - short scr_wid; - unsigned long tt_char : 24, scr_len : 8; - unsigned long tt2_char; -} sensemode_iosb; -#endif /* VMS */ #endif /* not HAVE_TERMIOS */ #endif /* not HAVE_TERMIO */ @@ -250,9 +213,6 @@ struct emacs_tty { #ifdef HAVE_TERMIO struct termio main; #else -#ifdef VMS - struct sensemode main; -#else #ifdef DOS_NT int main; #else /* not DOS_NT */ @@ -260,7 +220,6 @@ struct emacs_tty { #endif /* not DOS_NT */ #endif #endif -#endif /* If we have TERMIOS, we don't need to do this - they're taken care of by the tc*attr calls. */ @@ -306,11 +265,6 @@ extern int emacs_set_tty P_ ((int, struct emacs_tty *, int)); #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3) #else /* neither HAVE_TERMIO nor HAVE_TERMIOS */ -#ifdef VMS - -#define EMACS_TTY_TABS_OK(p) (((p)->main.tt_char & TT$M_MECHTAB) != 0) - -#else #ifdef DOS_NT #define EMACS_TTY_TABS_OK(p) 0 @@ -318,7 +272,6 @@ extern int emacs_set_tty P_ ((int, struct emacs_tty *, int)); #define EMACS_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS) #endif /* not DOS_NT */ -#endif /* not def VMS */ #endif /* not def HAVE_TERMIO */ #endif /* not def HAVE_TERMIOS */ diff --git a/src/syswait.h b/src/syswait.h index d5ba3b968a5..f0d42095401 100644 --- a/src/syswait.h +++ b/src/syswait.h @@ -24,8 +24,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #ifndef EMACS_SYSWAIT_H #define EMACS_SYSWAIT_H -#ifndef VMS - #include <sys/types.h> #ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */ @@ -57,21 +55,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #undef WRETCODE #define WRETCODE(status) WEXITSTATUS (status) -#else /* VMS */ - -#define WIFSTOPPED(w) 0 -#define WIFSIGNALED(w) 0 -#define WIFEXITED(w) ((w) != -1) -#define WRETCODE(w) (w) -#define WSTOPSIG(w) (w) -#define WCOREDUMP(w) 0 -#define WTERMSIG(w) (w) -#include <ssdef.h> -#include <iodef.h> -#include <clidef.h> -#include "vmsproc.h" - -#endif /* VMS */ #endif /* EMACS_SYSWAIT_H */ diff --git a/src/temacs.opt b/src/temacs.opt deleted file mode 100644 index a8aa50211b7..00000000000 --- a/src/temacs.opt +++ /dev/null @@ -1,60 +0,0 @@ -cluster=emacs,,,- -DISPNEW.OBJ,- -SCROLL.OBJ,- -XDISP.OBJ,- -WINDOW.OBJ,- -TERM.OBJ,- -CM.OBJ,- -EMACS.OBJ,- -KEYBOARD.OBJ,- -MACROS.OBJ,- -KEYMAP.OBJ,- -SYSDEP.OBJ,- -BUFFER.OBJ,- -FILELOCK.OBJ,- -INSDEL.OBJ,- -MARKER.OBJ,- -MINIBUF.OBJ,- -FILEIO.OBJ,- -DIRED.OBJ,- -FILEMODE.OBJ,- -CMDS.OBJ,- -CASEFIDDLE.OBJ,- -INDENT.OBJ,- -SEARCH.OBJ,- -REGEX.OBJ,- -UNDO.OBJ,- -ALLOC.OBJ,- -DATA.OBJ,- -DOC.OBJ,- -EDITFNS.OBJ,- -CALLINT.OBJ,- -EVAL.OBJ,- -FNS.OBJ,- -PRINT.OBJ,- -LREAD.OBJ,- -ABBREV.OBJ,- -SYNTAX.OBJ,- -MOCKLISP.OBJ,- -BYTECODE.OBJ,- -PROCESS.OBJ,- -CALLPROC.OBJ,- -VMSFNS.OBJ,- -VMSPROC.OBJ,- -DOPRNT.OBJ,- -vmsmap.obj,- -termcap.obj,- -tparam.obj,- -lastfile.obj,- -alloca.obj,- -malloc.obj -collect=non_saved_data,- -stdin,- -stdout,- -stderr,- -errno,- -vaxc$errno,- -sys_errlist,- -sys_nerr,- -environ -sys$library:vaxcrtl/library diff --git a/src/term.c b/src/term.c index 0132443833d..c956766eb36 100644 --- a/src/term.c +++ b/src/term.c @@ -3489,12 +3489,6 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", Down (tty) = tgetstr ("do", address); if (!Down (tty)) Down (tty) = tgetstr ("nl", address); /* Obsolete name for "do" */ -#ifdef VMS - /* VMS puts a carriage return before each linefeed, - so it is not safe to use linefeeds. */ - if (Down (tty) && Down (tty)[0] == '\n' && Down (tty)[1] == '\0') - Down (tty) = 0; -#endif /* VMS */ if (tgetflag ("bs")) Left (tty) = "\b"; /* can't possibly be longer! */ else /* (Actually, "bs" is obsolete...) */ @@ -3610,15 +3604,6 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", TabWidth (tty) = tgetnum ("tw"); -#ifdef VMS - /* These capabilities commonly use ^J. - I don't know why, but sending them on VMS does not work; - it causes following spaces to be lost, sometimes. - For now, the simplest fix is to avoid using these capabilities ever. */ - if (Down (tty) && Down (tty)[0] == '\n') - Down (tty) = 0; -#endif /* VMS */ - if (!tty->TS_bell) tty->TS_bell = "\07"; @@ -3734,13 +3719,6 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", { maybe_fatal (must_succeed, NULL, terminal, "Terminal type \"%s\" is not powerful enough to run Emacs", -#ifdef VMS - "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ -It lacks the ability to position the cursor.\n\ -If that is not the actual type of terminal you have, use either the\n\ -DCL command `SET TERMINAL/DEVICE= ...' for DEC-compatible terminals,\n\ -or `define EMACS_TERM \"terminal type\"' for non-DEC terminals.", -#else /* not VMS */ # ifdef TERMINFO "Terminal type \"%s\" is not powerful enough to run Emacs.\n\ It lacks the ability to position the cursor.\n\ @@ -3756,7 +3734,6 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\ `setenv TERM ...') to specify the correct type. It may be necessary\n\ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.", # endif /* TERMINFO */ -#endif /*VMS */ terminal_type); } diff --git a/src/termcap.c b/src/termcap.c index 291857697d8..2ad31d7b96a 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -349,13 +349,8 @@ char PC; static int speeds[] = { -#ifdef VMS - 0, 50, 75, 110, 134, 150, -3, -6, -12, -18, - -20, -24, -36, -48, -72, -96, -192 -#else /* not VMS */ 0, 50, 75, 110, 135, 150, -2, -3, -6, -12, -18, -24, -48, -96, -192, -288, -384, -576, -1152 -#endif /* not VMS */ }; #endif /* not emacs */ @@ -441,34 +436,6 @@ static char *gobble_line (); static int compare_contin (); static int name_match (); -#ifdef VMS - -#include <rmsdef.h> -#include <fab.h> -#include <nam.h> -#include <starlet.h> - -static int -valid_filename_p (fn) - char *fn; -{ - struct FAB fab = cc$rms_fab; - struct NAM nam = cc$rms_nam; - char esa[NAM$C_MAXRSS]; - - fab.fab$l_fna = fn; - fab.fab$b_fns = strlen(fn); - fab.fab$l_nam = &nam; - fab.fab$l_fop = FAB$M_NAM; - - nam.nam$l_esa = esa; - nam.nam$b_ess = sizeof esa; - - return SYS$PARSE(&fab, 0, 0) == RMS$_NORMAL; -} - -#else /* !VMS */ - #ifdef MSDOS /* MW, May 1993 */ static int valid_filename_p (fn) @@ -480,8 +447,6 @@ valid_filename_p (fn) #define valid_filename_p(fn) (*(fn) == '/') #endif -#endif /* !VMS */ - /* Find the termcap entry data for terminal type NAME and store it in the block that BP points to. Record its address for future use. diff --git a/src/uaf.h b/src/uaf.h deleted file mode 100644 index 2870eeafd91..00000000000 --- a/src/uaf.h +++ /dev/null @@ -1,298 +0,0 @@ -/* GNU Emacs VMS UAF definition file. - Copyright (C) 1986, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ - -/* - * User Authorization File record formats - */ -#ifndef UAF$K_LENGTH - -struct UAF { -#define UAF$C_USER_ID 1 -#define UAF$C_VERSION1 1 -#define UAF$C_KEYED_PART 52 -#define UAF$C_AD_II 0 -#define UAF$C_PURDY 1 -#define UAF$C_PURDY_V 2 -#define UAF$K_FIXED 644 -#define UAF$C_FIXED 644 -#define UAF$K_LENGTH 1412 -#define UAF$C_LENGTH 1412 -#define UAF$S_UAFDEF 1412 -#define UAF$B_RTYPE 0 - char uaf$b_rtype; -#define UAF$B_VERSION 1 - char uaf$b_version; -#define UAF$W_USRDATOFF 2 - short uaf$w_usrdatoff; -#define UAF$S_USERNAME 32 -#define UAF$T_USERNAME 4 -#define UAF$T_USERNAME_TAG 35 - char uaf$t_username[UAF$S_USERNAME]; -#define UAF$L_UIC 36 -#define UAF$W_MEM 36 -#define UAF$W_GRP 38 - union { - long uaf_l_uic; -#define uaf$l_uic uaf_u_uic.uaf_l_uic - struct { - short uaf_w_mem; - short uaf_w_grp; -#define uaf$w_mem uaf_u_uic.uaf_u_mem_grp.uaf_w_mem -#define uaf$w_grp uaf_u_uic.uaf_u_mem_grp.uaf_w_grp - } uaf_u_mem_grp; - } uaf_u_uic; -#define UAF$L_SUB_ID 40 - long uaf$l_sub_id; -#define UAF$S_PARENT_ID 8 -#define UAF$Q_PARENT_ID 44 - char uaf$q_parent_id[UAF$S_PARENT_ID]; -#define UAF$S_ACCOUNT 32 -#define UAF$T_ACCOUNT 52 - char uaf$t_account[UAF$S_ACCOUNT]; -#define UAF$S_OWNER 32 -#define UAF$T_OWNER 84 - char uaf$t_owner[UAF$S_OWNER]; -#define UAF$S_DEFDEV 32 -#define UAF$T_DEFDEV 116 - char uaf$t_defdev[UAF$S_DEFDEV]; -#define UAF$S_DEFDIR 64 -#define UAF$T_DEFDIR 148 - char uaf$t_defdir[UAF$S_DEFDIR]; -#define UAF$S_LGICMD 64 -#define UAF$T_LGICMD 212 - char uaf$t_lgicmd[UAF$S_LGICMD]; -#define UAF$S_DEFCLI 32 -#define UAF$T_DEFCLI 276 - char uaf$t_defcli[UAF$S_DEFCLI]; -#define UAF$S_CLITABLES 32 -#define UAF$T_CLITABLES 308 - char uaf$t_clitables[UAF$S_CLITABLES]; -#define UAF$S_PWD 8 -#define UAF$Q_PWD 340 -#define UAF$L_PWD 340 - char uaf$q_pwd[UAF$S_PWD]; -#define uaf$l_pwd uaf$q_pwd[0] -#define UAF$S_PWD2 8 -#define UAF$Q_PWD2 348 - char uaf$q_pwd2[UAF$S_PWD2]; -#define UAF$W_LOGFAILS 356 - short uaf$w_logfails; -#define UAF$W_SALT 358 - short uaf$w_salt; -#define UAF$B_ENCRYPT 360 - char uaf$b_encrypt; -#define UAF$B_ENCRYPT2 361 - char uaf$b_encrypt2; -#define UAF$B_PWD_LENGTH 362 - char uaf$b_pwd_length; -#define UAF$S_EXPIRATION 8 -#define UAF$Q_EXPIRATION 364 - char uaf$q_expiration[UAF$S_EXPIRATION]; -#define UAF$S_PWD_LIFETIME 8 -#define UAF$Q_PWD_LIFETIME 372 - char uaf$q_pwd_lifetime[UAF$S_PWD_LIFETIME]; -#define UAF$S_PWD_DATE 8 -#define UAF$Q_PWD_DATE 380 - char uaf$q_pwd_date[UAF$S_PWD_DATE]; -#define UAF$S_PWD2_DATE 8 -#define UAF$Q_PWD2_DATE 388 - char uaf$q_pwd2_date[UAF$S_PWD2_DATE]; -#define UAF$S_LASTLOGIN_I 8 -#define UAF$Q_LASTLOGIN_I 396 - char uaf$q_lastlogin_i[UAF$S_LASTLOGIN_I]; -#define UAF$S_LASTLOGIN_N 8 -#define UAF$Q_LASTLOGIN_N 404 - char uaf$q_lastlogin_n[UAF$S_LASTLOGIN_N]; -#define UAF$S_PRIV 8 -#define UAF$Q_PRIV 412 - char uaf$q_priv[UAF$S_PRIV]; -#define UAF$S_DEF_PRIV 8 -#define UAF$Q_DEF_PRIV 420 - char uaf$q_def_priv[UAF$S_DEF_PRIV]; -#define UAF$S_MIN_CLASS 20 -#define UAF$R_MIN_CLASS 428 - char uaf$r_min_class[UAF$S_MIN_CLASS]; -#define UAF$S_MAX_CLASS 20 -#define UAF$R_MAX_CLASS 448 - char uaf$r_max_class[UAF$S_MAX_CLASS]; -#define UAF$L_FLAGS 468 -#define UAF$V_DISCTLY 0 -#define UAF$V_DEFCLI 1 -#define UAF$V_LOCKPWD 2 -#define UAF$V_CAPTIVE 3 -#define UAF$V_DISACNT 4 -#define UAF$V_DISWELCOM 5 -#define UAF$V_DISMAIL 6 -#define UAF$V_NOMAIL 7 -#define UAF$V_GENPWD 8 -#define UAF$V_PWD_EXPIRED 9 -#define UAF$V_PWD2_EXPIRED 10 -#define UAF$V_AUDIT 11 -#define UAF$V_DISREPORT 12 -#define UAF$V_DISRECONNECT 13 - union { - unsigned long uaf_l_flags; -#define uaf$l_flags uaf_u_flags.uaf_l_flags - struct { - unsigned long - uaf_v_disctly : 1, -#define uaf$v_disctly uaf_u_flags.uaf_v_flags.uaf_v_disctly - uaf_v_defcli : 1, -#define uaf$v_defcli uaf_u_flags.uaf_v_flags.uaf_v_discli - uaf_v_lockpwd : 1, -#define uaf$v_lockpwd uaf_u_flags.uaf_v_flags.uaf_v_lockpwd - uaf_v_captive : 1, -#define uaf$v_captive uaf_u_flags.uaf_v_flags.uaf_v_captive - uaf_v_disacnt : 1, -#define uaf$v_disacnt uaf_u_flags.uaf_v_flags.uaf_v_disacnt - uaf_v_diswelcom : 1, -#define uaf$v_diswelcom uaf_u_flags.uaf_v_flags.uaf_v_diswelcom - uaf_v_dismail : 1, -#define uaf$v_dismail uaf_u_flags.uaf_v_flags.uaf_v_dismail - uaf_v_nomail : 1, -#define uaf$v_nomail uaf_u_flags.uaf_v_flags.uaf_v_nomail - uaf_v_genpwd : 1, -#define uaf$v_genpwd uaf_u_flags.uaf_v_flags.uaf_v_genpwd - uaf_v_pwd_expired : 1, -#define uaf$v_pwd_expired uaf_u_flags.uaf_v_flags.uaf_v_pwd_expired - uaf_v_pwd2_expired : 1, -#define uaf$v_pwd2_expired uaf_u_flags.uaf_v_flags.uaf_v_pwd2_expired - uaf_v_audit : 1, -#define uaf$v_audit uaf_u_flags.uaf_v_flags.uaf_v_audit - uaf_v_disreport : 1, -#define uaf$v_disreport uaf_u_flags.uaf_v_flags.uaf_v_disreport - uaf_v_disreconnect : 1; -#define uaf$v_disreconnect uaf_u_flags.uaf_v_flags.uaf_v_disreconnect - } uaf_v_flags; - } uaf_u_flags; -#define UAF$S_NETWORK_ACCESS_P 3 -#define UAF$B_NETWORK_ACCESS_P 472 - char uaf$b_network_access_p[UAF$S_NETWORK_ACCESS_P]; -#define UAF$S_NETWORK_ACCESS_S 3 -#define UAF$B_NETWORK_ACCESS_S 475 - char uaf$b_network_access_s[UAF$S_NETWORK_ACCESS_S]; -#define UAF$S_BATCH_ACCESS_P 3 -#define UAF$B_BATCH_ACCESS_P 478 - char uaf$b_batch_access_p[UAF$S_BATCH_ACCESS_P]; -#define UAF$S_BATCH_ACCESS_S 3 -#define UAF$B_BATCH_ACCESS_S 481 - char uaf$b_batch_access_s[UAF$S_BATCH_ACCESS_S]; -#define UAF$S_LOCAL_ACCESS_P 3 -#define UAF$B_LOCAL_ACCESS_P 484 - char uaf$b_local_access_p[UAF$S_LOCAL_ACCESS_P]; -#define UAF$S_LOCAL_ACCESS_S 3 -#define UAF$B_LOCAL_ACCESS_S 487 - char uaf$b_local_access_s[UAF$S_LOCAL_ACCESS_S]; -#define UAF$S_DIALUP_ACCESS_P 3 -#define UAF$B_DIALUP_ACCESS_P 490 - char uaf$b_dialup_access_p[UAF$S_DIALUP_ACCESS_P]; -#define UAF$S_DIALUP_ACCESS_S 3 -#define UAF$B_DIALUP_ACCESS_S 493 - char uaf$b_dialup_access_s[UAF$S_DIALUP_ACCESS_S]; -#define UAF$S_REMOTE_ACCESS_P 3 -#define UAF$B_REMOTE_ACCESS_P 496 - char uaf$b_remote_access_p[UAF$S_REMOTE_ACCESS_P]; -#define UAF$S_REMOTE_ACCESS_S 3 -#define UAF$B_REMOTE_ACCESS_S 499 - char uaf$b_remote_access_s[UAF$S_REMOTE_ACCESS_S]; -#define UAF$B_PRIMEDAYS 514 -#define UAF$V_MONDAY 0 -#define UAF$V_TUESDAY 1 -#define UAF$V_WEDNESDAY 2 -#define UAF$V_THURSDAY 3 -#define UAF$V_FRIDAY 4 -#define UAF$V_SATURDAY 5 -#define UAF$V_SUNDAY 6 - union { - unsigned char uaf_b_primedays; -#define uaf$b_primedays uaf_u_primedays.uaf_b_primedays - unsigned char - uaf_v_monday : 1, -#define uaf$v_monday uaf_u_primedays.uaf_v_monday - uaf_v_tuesday : 1, -#define uaf$v_tuesday uaf_u_primedays.uaf_v_tuesday - uaf_v_wednesday : 1, -#define uaf$v_wednesday uaf_u_primedays.uaf_v_wednesday - uaf_v_thursday : 1, -#define uaf$v_thursday uaf_u_primedays.uaf_v_thursday - uaf_v_friday : 1, -#define uaf$v_friday uaf_u_primedays.uaf_v_friday - uaf_v_saturday : 1, -#define uaf$v_saturday uaf_u_primedays.uaf_v_saturday - uav_v_sunday : 1; -#define uaf$v_sunday uaf_u_primedays.uaf_v_sunday - } uaf_u_primedays; -#define UAF$B_PRI 516 - char uaf$b_pri; -#define UAF$B_QUEPRI 517 - char uaf$b_quepri; -#define UAF$W_MAXJOBS 518 - short uaf$w_maxjobs; -#define UAF$W_MAXACCTJOBS 520 - short uaf$w_maxacctjobs; -#define UAF$W_MAXDETACH 522 - short uaf$w_maxdetach; -#define UAF$W_PRCCNT 524 - short uaf$w_prccnt; -#define UAF$W_BIOLM 526 - short uaf$w_biolm; -#define UAF$W_DIOLM 528 - short uaf$w_diolm; -#define UAF$W_TQCNT 530 - short uaf$w_twcnt; -#define UAF$W_ASTLM 532 - short uaf$w_astlm; -#define UAF$W_ENQLM 534 - short uaf$w_enqlm; -#define UAF$W_FILLM 536 - short uaf$w_fillm; -#define UAF$W_SHRFILLM 538 - short uaf$w_shrfillm; -#define UAF$L_WSQUOTA 540 - long uaf$l_wsquota; -#define UAF$L_DFWSCNT 544 - long uaf$l_dfwscnt; -#define UAF$L_WSEXTENT 548 - long uaf$l_wsextent; -#define UAF$L_PGFLQUOTA 552 - long uaf$l_pgflquota; -#define UAF$L_CPUTIM 556 - long uaf$l_cputim; -#define UAF$L_BYTLM 560 - long uaf$l_bytlm; -#define UAF$L_PBYTLM 564 - long uaf$l_pbytlm; -#define UAF$L_JTQUOTA 568 - long uaf$l_jtquota; -#define UAF$W_PROXY_LIM 572 - short uaf$w_proxy_lim; -#define UAF$W_PROXIES 574 - short uaf$w_proxies; -#define UAF$W_ACCOUNT_LIM 576 - short uaf$w_account_lim; -#define UAF$W_ACCOUNTS 578 - short uaf$w_accounts; - char uaf$b_fixed[UAF$C_FIXED - UAF$W_ACCOUNTS + 2]; - char uaf$b_usrdata[UAF$C_LENGTH - UAF$C_FIXED]; -}; - -#endif /* not UAF$K_LENGTH */ - -/* arch-tag: f95d73be-b0bf-46b7-adf7-89ce8846b062 - (do not change this comment) */ diff --git a/src/vlimit.h b/src/vlimit.h deleted file mode 100644 index 5885bee8d2d..00000000000 --- a/src/vlimit.h +++ /dev/null @@ -1,5 +0,0 @@ -/* Dummy for Emacs so that we can run on VMS... */ -#define LIM_DATA 0 - -/* arch-tag: 0c3436cb-5edc-447a-87af-acec402a65b9 - (do not change this comment) */ diff --git a/src/xfns.c b/src/xfns.c index 1af0e76caa1..e079ff60250 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -56,15 +56,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #include <sys/types.h> #include <sys/stat.h> -#ifndef VMS #if 1 /* Used to be #ifdef EMACS_BITMAP_FILES, but this should always work. */ #include "bitmaps/gray.xbm" #else #include <X11/bitmaps/gray> #endif -#else -#include "[.bitmaps]gray.xbm" -#endif #ifdef USE_GTK #include "gtkutil.h" |