# HG changeset patch # User Jim Blandy # Date 732562094 0 # Node ID 87934d2128419db29bba8b3aa448c9013d9ef87f # Parent 4b57c6f61299275a9920e7ef9b20d878eaad915d 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. diff -r 4b57c6f61299 -r 87934d212841 src/sysdep.c --- a/src/sysdep.c Fri Mar 19 08:08:04 1993 +0000 +++ b/src/sysdep.c Fri Mar 19 17:28:14 1993 +0000 @@ -746,6 +746,7 @@ 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 @@ } 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 @@ 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 @@ #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 @@ #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 @@ char *pathname; { char *ptr; - strcpy (pathname, egetenv ("PATH")); - - ptr = pathname; - while (*ptr) - { - if ('a' <= *ptr && *ptr <= 'z') - *ptr -= 040; - ptr++; - } - return pathname; + extern char *getcwd (); + +#define MAXPATHLEN 1024 + + ptr = malloc (MAXPATHLEN); + getcwd (ptr, MAXPATHLEN); + strcpy (pathname, ptr); + free (ptr); + + return pathname; } getppid () diff -r 4b57c6f61299 -r 87934d212841 src/systime.h --- a/src/systime.h Fri Mar 19 08:08:04 1993 +0000 +++ b/src/systime.h Fri Mar 19 17:28:14 1993 +0000 @@ -45,6 +45,12 @@ 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 @@ #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 @@ /* 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 -r 4b57c6f61299 -r 87934d212841 src/systty.h --- a/src/systty.h Fri Mar 19 08:08:04 1993 +0000 +++ b/src/systty.h Fri Mar 19 17:28:14 1993 +0000 @@ -45,9 +45,15 @@ 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 -r 4b57c6f61299 -r 87934d212841 src/vmspaths.h --- a/src/vmspaths.h Fri Mar 19 08:08:04 1993 +0000 +++ b/src/vmspaths.h Fri Mar 19 17:28:14 1993 +0000 @@ -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