From 210b2b4f058671a18e3f087fd696766ea8a23025 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Fri, 19 Mar 1993 17:28:14 +0000 Subject: [PATCH] Some VMS changes from Richard Levitte : * [VMS] systime.h: Include vmstime.h. VMS has the timezone variable and the tzname array. * s/vms.h: VMS does have select. mth$dmod is the same as Unix's drem. Use the time functions in vmstime.c. No need to rename the malloc routines if we're using GNU malloc. PURESIZE needs to be 330000. * vmstime.c, vmstime.h: New files. * systty.h: Don't try to initialize extern declarations under VAX C. * vmspaths.h (PATH_LOADSEARCH): Include EMACS_LIBRARY:[LOCAL-LISP] in PATH_LOADSEARCH. (PATH_EXEC): Use EMACS_LIBRARY:[LIB-SRC] instead of [ETC]. * sysdep.c [VMS] (init_sys_modes): Don't allocate process_ef. [VMS] (queue_kbd_input): Build events structure correctly. [VMS] (gethostname): New function. [VMS] (getwd): Don't get the PATH environment variable; that's dumb. Call getcwd. --- src/sysdep.c | 56 ++++++++++++++++++++++++++++++++++++-------------- src/systime.h | 10 +++++++-- src/systty.h | 6 ++++++ src/vmspaths.h | 4 ++-- 4 files changed, 57 insertions(+), 19 deletions(-) diff --git a/src/sysdep.c b/src/sysdep.c index 6a05e9ca2f..901edb85e6 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -746,6 +746,7 @@ init_sys_modes () timer_ef = get_timer_event_flag (); /* LIB$GET_EF (&timer_ef); */ SYS$CLREF (timer_ef); +#if 0 if (!process_ef) { LIB$GET_EF (&process_ef); @@ -753,10 +754,13 @@ init_sys_modes () } if (input_ef / 32 != process_ef / 32) croak ("Input and process event flags in different clusters."); +#endif if (input_ef / 32 != timer_ef / 32) - croak ("Input and process event flags in different clusters."); + croak ("Input and timer event flags in different clusters."); +#if 0 input_eflist = ((unsigned) 1 << (input_ef % 32)) | ((unsigned) 1 << (process_ef % 32)); +#endif timer_eflist = ((unsigned) 1 << (input_ef % 32)) | ((unsigned) 1 << (timer_ef % 32)); #ifndef VMS4_4 @@ -1188,6 +1192,8 @@ short input_buffer; queue_kbd_input () { int status; + extern kbd_input_ast (); + waiting_for_ast = 0; stop_input = 0; status = SYS$QIO (0, input_fd, IO$_READVBLK, @@ -1232,17 +1238,18 @@ kbd_input_ast () #endif if (! stop_input) queue_kbd_input (); -/* I don't know what this is doing! The variables buf, cbuf and i are - not declared. This is new from version 18, what does it do? if (c >= 0) { struct input_event e; e.kind = ascii_keystroke; - XSET (buf[i].code, Lisp_Int, cbuf[i]); - e.frame = selected_frame; + XSET (e.code, Lisp_Int, c); +#ifdef MULTI_FRAME + XSET(e.frame_or_window, Lisp_Frame, selected_frame); +#else + e.frame_or_window = Qnil; +#endif kbd_buffer_store_event (&e); } -*/ if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); errno = old_errno; @@ -1567,6 +1574,25 @@ get_system_name () #endif /* not USG, not 4.1 */ #endif /* not USG */ } + +#ifdef VMS +#ifndef HAVE_GETHOSTNAME +void gethostname(buf, len) + char *buf; + int len; +{ + char *s; + s = getenv ("SYS$NODE"); + if (s == NULL) + buf[0] = '\0'; + else { + strncpy (buf, s, len - 2); + buf[len - 1] = '\0'; + } /* else */ +} /* static void gethostname */ +#endif /* ! HAVE_GETHOSTNAME */ +#endif /* VMS */ + #ifndef VMS #ifndef HAVE_SELECT @@ -3084,16 +3110,16 @@ getwd (pathname) char *pathname; { char *ptr; - strcpy (pathname, egetenv ("PATH")); + extern char *getcwd (); - ptr = pathname; - while (*ptr) - { - if ('a' <= *ptr && *ptr <= 'z') - *ptr -= 040; - ptr++; - } - return pathname; +#define MAXPATHLEN 1024 + + ptr = malloc (MAXPATHLEN); + getcwd (ptr, MAXPATHLEN); + strcpy (pathname, ptr); + free (ptr); + + return pathname; } getppid () diff --git a/src/systime.h b/src/systime.h index 8b6718a874..d6b1898c7f 100644 --- a/src/systime.h +++ b/src/systime.h @@ -45,6 +45,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ extern long timezone; #endif +#ifdef VMS +#ifdef VAXC +#include "vmstime.h" +#endif +#endif + /* EMACS_TIME is the type to use to represent temporal intervals - struct timeval on some systems, int on others. It can be passed as @@ -190,7 +196,7 @@ extern long timezone; #ifndef EMACS_CURRENT_TIME_ZONE /* System V derivatives have a timezone global variable. */ -#ifdef USG +#if defined(USG) || defined(VMS) #define EMACS_GET_TZ_OFFSET(offset) \ do { \ tzset (); \ @@ -213,7 +219,7 @@ extern long timezone; /* The following sane systems have a tzname array. The timezone() function is a stupid idea; timezone names can only be determined geographically, not by Greenwich offset. */ -#if defined (ultrix) || defined (hpux) || defined (_AIX) || defined (USG) +#if defined (ultrix) || defined (hpux) || defined (_AIX) || defined (USG) || defined(VMS) #define EMACS_GET_TZ_NAMES(standard, savings) \ do { \ diff --git a/src/systty.h b/src/systty.h index 3d49b2dd87..7e5efa0946 100644 --- a/src/systty.h +++ b/src/systty.h @@ -45,9 +45,15 @@ static struct iosb extern int waiting_for_ast; extern int stop_input; +#if 0 /* VAX C doeasn't understand initializing declarations */ extern int input_ef = 0; extern int timer_ef = 0; extern int process_ef = 0; +#else +extern int input_ef; +extern int timer_ef; +extern int process_ef; +#endif extern int input_eflist; extern int timer_eflist; diff --git a/src/vmspaths.h b/src/vmspaths.h index 5992bf151e..ae2d9ba4a5 100644 --- a/src/vmspaths.h +++ b/src/vmspaths.h @@ -2,7 +2,7 @@ /* The default search path for Lisp function "load". This sets load-path. */ -#define PATH_LOADSEARCH "EMACS_LIBRARY:[LISP]" +#define PATH_LOADSEARCH "EMACS_LIBRARY:[LOCAL-LISP],EMACS_LIBRARY:[LISP]" /* Like PATH_LOADSEARCH, but used only when Emacs is dumping. This path is usually identical to PATH_LOADSEARCH except that the entry @@ -15,7 +15,7 @@ variable exec-path and the first file name in it sets the Lisp variable exec-directory. exec-directory is used for finding executables and other architecture-dependent files. */ -#define PATH_EXEC "EMACS_LIBRARY:[ETC]" +#define PATH_EXEC "EMACS_LIBRARY:[LIB-SRC]" /* Where Emacs should look for its architecture-independent data files, like the docstring file. The lisp variable data-directory -- 2.20.1