aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-11-16 00:54:53 +0000
committerJim Blandy1992-11-16 00:54:53 +0000
commit986ffb244621a88dedd3885bd891611b79c57995 (patch)
tree05e30c3edf557d5e80f7a9d6af5f2a79b66ade9d /src
parentad3bb3d26038b562fb539a4c9217cdc26c0b42f8 (diff)
downloademacs-986ffb244621a88dedd3885bd891611b79c57995.tar.gz
emacs-986ffb244621a88dedd3885bd891611b79c57995.zip
* systty.h, process.c, buffer.h, callproc.c, sysdep.c, dired.c:
Added VMS changes from Roland Roberts.
Diffstat (limited to 'src')
-rw-r--r--src/buffer.h6
-rw-r--r--src/callproc.c2
-rw-r--r--src/dired.c2
-rw-r--r--src/sysdep.c121
4 files changed, 54 insertions, 77 deletions
diff --git a/src/buffer.h b/src/buffer.h
index ddf903e5469..6e3f7a8ee23 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -378,6 +378,12 @@ whatever you like. */
378#define R_ALLOC_DECLARE(var,data) 378#define R_ALLOC_DECLARE(var,data)
379#endif 379#endif
380 380
381/* VAX C is non-ANSI wrt extern declarations and requires the struct
382 re_pattern_buffer to completely defined for searchbuf's declaration. */
383#ifdef VMS
384#include "regex.h"
385#endif /* VMS */
386
381/* A search buffer, with a fastmap allocated and ready to go. */ 387/* A search buffer, with a fastmap allocated and ready to go. */
382extern struct re_pattern_buffer searchbuf; 388extern struct re_pattern_buffer searchbuf;
383 389
diff --git a/src/callproc.c b/src/callproc.c
index 19bd7f3e386..6e47c433144 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -629,7 +629,7 @@ when Emacs starts.");
629 629
630#ifndef VMS 630#ifndef VMS
631 defsubr (&Scall_process); 631 defsubr (&Scall_process);
632#endif
633 defsubr (&Sgetenv); 632 defsubr (&Sgetenv);
633#endif
634 defsubr (&Scall_process_region); 634 defsubr (&Scall_process_region);
635} 635}
diff --git a/src/dired.c b/src/dired.c
index 451907fbbe4..bfc1bf062b9 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -117,7 +117,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
117 catching and signalling our own errors, we just call 117 catching and signalling our own errors, we just call
118 compile_pattern to do the work for us. */ 118 compile_pattern to do the work for us. */
119#ifdef VMS 119#ifdef VMS
120 compile_pattern (match, &searchbuf, 0 120 compile_pattern (match, &searchbuf, 0,
121 buffer_defaults.downcase_table->contents); 121 buffer_defaults.downcase_table->contents);
122#else 122#else
123 compile_pattern (match, &searchbuf, 0, 0); 123 compile_pattern (match, &searchbuf, 0, 0);
diff --git a/src/sysdep.c b/src/sysdep.c
index 7521515e93c..60145e93de9 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -51,6 +51,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
51#undef open 51#undef open
52#endif /* `open' is a macro */ 52#endif /* `open' is a macro */
53 53
54/* Does anyone other than VMS need this? */
55#ifndef fwrite
56#define sys_fwrite fwrite
57#else
58#undef fwrite
59#endif
60
54#include <stdio.h> 61#include <stdio.h>
55#include <sys/types.h> 62#include <sys/types.h>
56#include <sys/stat.h> 63#include <sys/stat.h>
@@ -168,44 +175,6 @@ extern short ospeed;
168 This allows us to write more code that works for both VMS and Unix. */ 175 This allows us to write more code that works for both VMS and Unix. */
169static int input_fd; 176static int input_fd;
170 177
171#ifdef VMS
172static struct iosb
173{
174 short status;
175 short offset;
176 short termlen;
177 short term;
178} input_iosb;
179
180int kbd_input_ast ();
181
182int waiting_for_ast;
183int stop_input;
184int input_ef = 0;
185int timer_ef = 0;
186int process_ef = 0;
187int input_eflist;
188int timer_eflist;
189
190static $DESCRIPTOR (input_dsc, "TT");
191static int terminator_mask[2] = { 0, 0 };
192
193static struct sensemode {
194 short status;
195 unsigned char xmit_baud;
196 unsigned char rcv_baud;
197 unsigned char crfill;
198 unsigned char lffill;
199 unsigned char parity;
200 unsigned char unused;
201 char class;
202 char type;
203 short scr_wid;
204 unsigned long tt_char : 24, scr_len : 8;
205 unsigned long tt2_char;
206} sensemode_iosb;
207#endif /* VMS */
208
209discard_tty_input () 178discard_tty_input ()
210{ 179{
211 struct emacs_tty buf; 180 struct emacs_tty buf;
@@ -341,7 +310,7 @@ wait_for_termination (pid)
341#ifdef VMS 310#ifdef VMS
342 int status; 311 int status;
343 312
344 status = sys$forcex (&pid, 0, 0); 313 status = SYS$FORCEX (&pid, 0, 0);
345 break; 314 break;
346#else /* not VMS */ 315#else /* not VMS */
347 316
@@ -535,7 +504,7 @@ sys_suspend ()
535 } d_prompt; 504 } d_prompt;
536 d_prompt.l = sizeof ("Emacs: "); /* Our special prompt */ 505 d_prompt.l = sizeof ("Emacs: "); /* Our special prompt */
537 d_prompt.a = "Emacs: "; /* Just a reminder */ 506 d_prompt.a = "Emacs: "; /* Just a reminder */
538 lib$spawn (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &d_prompt, 0); 507 LIB$SPAWN (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &d_prompt, 0);
539 return 1; 508 return 1;
540 } 509 }
541 return -1; 510 return -1;
@@ -876,7 +845,7 @@ init_sys_modes ()
876#ifdef VMS 845#ifdef VMS
877 tty.main.tt_char |= TT$M_NOECHO; 846 tty.main.tt_char |= TT$M_NOECHO;
878 if (meta_key) 847 if (meta_key)
879 tty.main.tt_char |= TT$M_EIGHTBIT 848 tty.main.tt_char |= TT$M_EIGHTBIT;
880 if (flow_control) 849 if (flow_control)
881 tty.main.tt_char |= TT$M_TTSYNC; 850 tty.main.tt_char |= TT$M_TTSYNC;
882 else 851 else
@@ -1263,6 +1232,8 @@ kbd_input_ast ()
1263#endif 1232#endif
1264 if (! stop_input) 1233 if (! stop_input)
1265 queue_kbd_input (); 1234 queue_kbd_input ();
1235/* I don't know what this is doing! The variables buf, cbuf and i are
1236 not declared. This is new from version 18, what does it do?
1266 if (c >= 0) 1237 if (c >= 0)
1267 { 1238 {
1268 struct input_event e; 1239 struct input_event e;
@@ -1271,7 +1242,7 @@ kbd_input_ast ()
1271 e.frame = selected_frame; 1242 e.frame = selected_frame;
1272 kbd_buffer_store_event (&e); 1243 kbd_buffer_store_event (&e);
1273 } 1244 }
1274 1245*/
1275 if (input_available_clear_time) 1246 if (input_available_clear_time)
1276 EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); 1247 EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
1277 errno = old_errno; 1248 errno = old_errno;
@@ -2112,7 +2083,7 @@ sys_getenv (name)
2112 2083
2113 d_name.dsc$w_length = strlen (name); 2084 d_name.dsc$w_length = strlen (name);
2114 d_name.dsc$a_pointer = name; 2085 d_name.dsc$a_pointer = name;
2115 if (lib$sys_trnlog (&d_name, &eqlen, &equiv) == 1) 2086 if (LIB$SYS_TRNLOG (&d_name, &eqlen, &equiv) == 1)
2116 { 2087 {
2117 char *str = (char *) xmalloc (eqlen + 1); 2088 char *str = (char *) xmalloc (eqlen + 1);
2118 bcopy (buf, str, eqlen); 2089 bcopy (buf, str, eqlen);
@@ -2901,7 +2872,7 @@ sys_access (filename, type)
2901#define WRITEABLE(field) (! ((xab.xab$w_pro >> field) & XAB$M_NOWRITE)) 2872#define WRITEABLE(field) (! ((xab.xab$w_pro >> field) & XAB$M_NOWRITE))
2902 2873
2903 /* Find privilege bits */ 2874 /* Find privilege bits */
2904 status = sys$setprv (0, 0, 0, prvmask); 2875 status = SYS$SETPRV (0, 0, 0, prvmask);
2905 if (! (status & 1)) 2876 if (! (status & 1))
2906 error ("Unable to find privileges: %s", vmserrstr (status)); 2877 error ("Unable to find privileges: %s", vmserrstr (status));
2907 if (CHECKPRIV (PRV$V_BYPASS)) 2878 if (CHECKPRIV (PRV$V_BYPASS))
@@ -2914,10 +2885,10 @@ sys_access (filename, type)
2914 xab = cc$rms_xabpro; 2885 xab = cc$rms_xabpro;
2915 xab.xab$l_aclbuf = aclbuf; 2886 xab.xab$l_aclbuf = aclbuf;
2916 xab.xab$w_aclsiz = sizeof (aclbuf); 2887 xab.xab$w_aclsiz = sizeof (aclbuf);
2917 status = sys$open (&fab, 0, 0); 2888 status = SYS$OPEN (&fab, 0, 0);
2918 if (! (status & 1)) 2889 if (! (status & 1))
2919 return -1; 2890 return -1;
2920 sys$close (&fab, 0, 0); 2891 SYS$CLOSE (&fab, 0, 0);
2921 /* Check system access */ 2892 /* Check system access */
2922 if (CHECKPRIV (PRV$V_SYSPRV) && WRITEABLE (XAB$V_SYS)) 2893 if (CHECKPRIV (PRV$V_SYSPRV) && WRITEABLE (XAB$V_SYS))
2923 return 0; 2894 return 0;
@@ -3246,9 +3217,9 @@ creat_copy_attrs (old, new)
3246 xabpro.xab$l_aclbuf = aclbuf; 3217 xabpro.xab$l_aclbuf = aclbuf;
3247 xabpro.xab$w_aclsiz = sizeof aclbuf; 3218 xabpro.xab$w_aclsiz = sizeof aclbuf;
3248 /* Call $OPEN to fill in the fab & xabpro fields. */ 3219 /* Call $OPEN to fill in the fab & xabpro fields. */
3249 if (sys$open (&fab, 0, 0) & 1) 3220 if (SYS$OPEN (&fab, 0, 0) & 1)
3250 { 3221 {
3251 sys$close (&fab, 0, 0); 3222 SYS$CLOSE (&fab, 0, 0);
3252 fab.fab$l_alq = 0; /* zero the allocation quantity */ 3223 fab.fab$l_alq = 0; /* zero the allocation quantity */
3253 if (xabpro.xab$w_acllen > 0) 3224 if (xabpro.xab$w_acllen > 0)
3254 { 3225 {
@@ -3259,8 +3230,8 @@ creat_copy_attrs (old, new)
3259 { 3230 {
3260 xabpro.xab$l_aclbuf = (char *) alloca (xabpro.xab$w_acllen); 3231 xabpro.xab$l_aclbuf = (char *) alloca (xabpro.xab$w_acllen);
3261 xabpro.xab$w_aclsiz = xabpro.xab$w_acllen; 3232 xabpro.xab$w_aclsiz = xabpro.xab$w_acllen;
3262 if (sys$open (&fab, 0, 0) & 1) 3233 if (SYS$OPEN (&fab, 0, 0) & 1)
3263 sys$close (&fab, 0, 0); 3234 SYS$CLOSE (&fab, 0, 0);
3264 else 3235 else
3265 old = 0; 3236 old = 0;
3266 } 3237 }
@@ -3286,14 +3257,14 @@ creat_copy_attrs (old, new)
3286 if (old) 3257 if (old)
3287 fab_final_pro = xabpro.xab$w_pro; 3258 fab_final_pro = xabpro.xab$w_pro;
3288 else 3259 else
3289 sys$setdfprot (0, &fab_final_pro); 3260 SYS$SETDFPROT (0, &fab_final_pro);
3290 xabpro.xab$w_pro &= 0xff0f; /* set O:rewd for now. This is set back later. */ 3261 xabpro.xab$w_pro &= 0xff0f; /* set O:rewd for now. This is set back later. */
3291 3262
3292 /* Create the new file with either default attrs or attrs copied 3263 /* Create the new file with either default attrs or attrs copied
3293 from old file. */ 3264 from old file. */
3294 if (!(SYS$CREATE (&fab, 0, 0) & 1)) 3265 if (!(SYS$CREATE (&fab, 0, 0) & 1))
3295 return -1; 3266 return -1;
3296 sys$close (&fab, 0, 0); 3267 SYS$CLOSE (&fab, 0, 0);
3297 /* As this is a "replacement" for creat, return a file descriptor 3268 /* As this is a "replacement" for creat, return a file descriptor
3298 opened for writing. */ 3269 opened for writing. */
3299 return open (new, O_WRONLY); 3270 return open (new, O_WRONLY);
@@ -3462,18 +3433,18 @@ vms_truncate (fn)
3462 3433
3463 /* This gibberish opens the file, positions to the first record, and 3434 /* This gibberish opens the file, positions to the first record, and
3464 deletes all records from there until the end of file. */ 3435 deletes all records from there until the end of file. */
3465 if ((sys$open (&xfab) & 01) == 01) 3436 if ((SYS$OPEN (&xfab) & 01) == 01)
3466 { 3437 {
3467 if ((sys$connect (&xrab) & 01) == 01 && 3438 if ((SYS$CONNECT (&xrab) & 01) == 01 &&
3468 (sys$find (&xrab) & 01) == 01 && 3439 (SYS$FIND (&xrab) & 01) == 01 &&
3469 (sys$truncate (&xrab) & 01) == 01) 3440 (SYS$TRUNCATE (&xrab) & 01) == 01)
3470 status = 0; 3441 status = 0;
3471 else 3442 else
3472 status = -1; 3443 status = -1;
3473 } 3444 }
3474 else 3445 else
3475 status = -1; 3446 status = -1;
3476 sys$close (&xfab); 3447 SYS$CLOSE (&xfab);
3477 return status; 3448 return status;
3478} 3449}
3479 3450
@@ -3509,14 +3480,14 @@ get_uaf_name (uname)
3509 /* initialize rab fields */ 3480 /* initialize rab fields */
3510 uaf_rab.rab$l_fab = &uaf_fab; 3481 uaf_rab.rab$l_fab = &uaf_fab;
3511 /* open the User Authorization File */ 3482 /* open the User Authorization File */
3512 status = sys$open (&uaf_fab); 3483 status = SYS$OPEN (&uaf_fab);
3513 if (!(status&1)) 3484 if (!(status&1))
3514 { 3485 {
3515 errno = EVMSERR; 3486 errno = EVMSERR;
3516 vaxc$errno = status; 3487 vaxc$errno = status;
3517 return 0; 3488 return 0;
3518 } 3489 }
3519 status = sys$connect (&uaf_rab); 3490 status = SYS$CONNECT (&uaf_rab);
3520 if (!(status&1)) 3491 if (!(status&1))
3521 { 3492 {
3522 errno = EVMSERR; 3493 errno = EVMSERR;
@@ -3529,7 +3500,7 @@ get_uaf_name (uname)
3529 uaf_rab.rab$b_rac = RAB$C_KEY; 3500 uaf_rab.rab$b_rac = RAB$C_KEY;
3530 uaf_rab.rab$l_ubf = (char *)&retuaf; 3501 uaf_rab.rab$l_ubf = (char *)&retuaf;
3531 uaf_rab.rab$w_usz = sizeof retuaf; 3502 uaf_rab.rab$w_usz = sizeof retuaf;
3532 status = sys$get (&uaf_rab); 3503 status = SYS$GET (&uaf_rab);
3533 if (!(status&1)) 3504 if (!(status&1))
3534 { 3505 {
3535 errno = EVMSERR; 3506 errno = EVMSERR;
@@ -3537,14 +3508,14 @@ get_uaf_name (uname)
3537 return 0; 3508 return 0;
3538 } 3509 }
3539 /* close the User Authorization File */ 3510 /* close the User Authorization File */
3540 status = sys$disconnect (&uaf_rab); 3511 status = SYS$DISCONNECT (&uaf_rab);
3541 if (!(status&1)) 3512 if (!(status&1))
3542 { 3513 {
3543 errno = EVMSERR; 3514 errno = EVMSERR;
3544 vaxc$errno = status; 3515 vaxc$errno = status;
3545 return 0; 3516 return 0;
3546 } 3517 }
3547 status = sys$close (&uaf_fab); 3518 status = SYS$CLOSE (&uaf_fab);
3548 if (!(status&1)) 3519 if (!(status&1))
3549 { 3520 {
3550 errno = EVMSERR; 3521 errno = EVMSERR;
@@ -3573,14 +3544,14 @@ get_uaf_uic (uic)
3573 /* initialize rab fields */ 3544 /* initialize rab fields */
3574 uaf_rab.rab$l_fab = &uaf_fab; 3545 uaf_rab.rab$l_fab = &uaf_fab;
3575 /* open the User Authorization File */ 3546 /* open the User Authorization File */
3576 status = sys$open (&uaf_fab); 3547 status = SYS$OPEN (&uaf_fab);
3577 if (!(status&1)) 3548 if (!(status&1))
3578 { 3549 {
3579 errno = EVMSERR; 3550 errno = EVMSERR;
3580 vaxc$errno = status; 3551 vaxc$errno = status;
3581 return 0; 3552 return 0;
3582 } 3553 }
3583 status = sys$connect (&uaf_rab); 3554 status = SYS$CONNECT (&uaf_rab);
3584 if (!(status&1)) 3555 if (!(status&1))
3585 { 3556 {
3586 errno = EVMSERR; 3557 errno = EVMSERR;
@@ -3594,7 +3565,7 @@ get_uaf_uic (uic)
3594 uaf_rab.rab$b_rac = RAB$C_KEY; 3565 uaf_rab.rab$b_rac = RAB$C_KEY;
3595 uaf_rab.rab$l_ubf = (char *)&retuaf; 3566 uaf_rab.rab$l_ubf = (char *)&retuaf;
3596 uaf_rab.rab$w_usz = sizeof retuaf; 3567 uaf_rab.rab$w_usz = sizeof retuaf;
3597 status = sys$get (&uaf_rab); 3568 status = SYS$GET (&uaf_rab);
3598 if (!(status&1)) 3569 if (!(status&1))
3599 { 3570 {
3600 errno = EVMSERR; 3571 errno = EVMSERR;
@@ -3602,14 +3573,14 @@ get_uaf_uic (uic)
3602 return 0; 3573 return 0;
3603 } 3574 }
3604 /* close the User Authorization File */ 3575 /* close the User Authorization File */
3605 status = sys$disconnect (&uaf_rab); 3576 status = SYS$DISCONNECT (&uaf_rab);
3606 if (!(status&1)) 3577 if (!(status&1))
3607 { 3578 {
3608 errno = EVMSERR; 3579 errno = EVMSERR;
3609 vaxc$errno = status; 3580 vaxc$errno = status;
3610 return 0; 3581 return 0;
3611 } 3582 }
3612 status = sys$close (&uaf_fab); 3583 status = SYS$CLOSE (&uaf_fab);
3613 if (!(status&1)) 3584 if (!(status&1))
3614 { 3585 {
3615 errno = EVMSERR; 3586 errno = EVMSERR;
@@ -3887,25 +3858,25 @@ rename_sans_version (from,to)
3887 to_fab.fab$b_fns = strlen (vms_file_written); 3858 to_fab.fab$b_fns = strlen (vms_file_written);
3888 3859
3889 /* Now set the file protection to the correct value */ 3860 /* Now set the file protection to the correct value */
3890 sys$open (&to_fab, 0, 0); /* This fills in the nam$w_fid fields */ 3861 SYS$OPEN (&to_fab, 0, 0); /* This fills in the nam$w_fid fields */
3891 3862
3892 /* Copy these fields into the fib */ 3863 /* Copy these fields into the fib */
3893 fib.fib$r_fid_overlay.fib$w_fid[0] = to_nam.nam$w_fid[0]; 3864 fib.fib$r_fid_overlay.fib$w_fid[0] = to_nam.nam$w_fid[0];
3894 fib.fib$r_fid_overlay.fib$w_fid[1] = to_nam.nam$w_fid[1]; 3865 fib.fib$r_fid_overlay.fib$w_fid[1] = to_nam.nam$w_fid[1];
3895 fib.fib$r_fid_overlay.fib$w_fid[2] = to_nam.nam$w_fid[2]; 3866 fib.fib$r_fid_overlay.fib$w_fid[2] = to_nam.nam$w_fid[2];
3896 3867
3897 sys$close (&to_fab, 0, 0); 3868 SYS$CLOSE (&to_fab, 0, 0);
3898 3869
3899 stat = sys$assign (&disk, &chan, 0, 0); /* open a channel to the disk */ 3870 stat = SYS$ASSIGN (&disk, &chan, 0, 0); /* open a channel to the disk */
3900 if (!stat) 3871 if (!stat)
3901 lib$signal (stat); 3872 LIB$SIGNAL (stat);
3902 stat = sys$qiow (0, chan, IO$_MODIFY, iosb, 0, 0, &fib_d, 3873 stat = SYS$QIOW (0, chan, IO$_MODIFY, iosb, 0, 0, &fib_d,
3903 0, 0, 0, &fib_attr, 0); 3874 0, 0, 0, &fib_attr, 0);
3904 if (!stat) 3875 if (!stat)
3905 lib$signal (stat); 3876 LIB$SIGNAL (stat);
3906 stat = sys$dassgn (chan); 3877 stat = SYS$DASSGN (chan);
3907 if (!stat) 3878 if (!stat)
3908 lib$signal (stat); 3879 LIB$SIGNAL (stat);
3909 strcpy (vms_file_written, to_esn); /* We will write this to the terminal*/ 3880 strcpy (vms_file_written, to_esn); /* We will write this to the terminal*/
3910 return 0; 3881 return 0;
3911} 3882}