Mercurial > hg > xemacs-beta
comparison src/vmsfns.c @ 20:859a2309aef8 r19-15b93
Import from CVS: tag r19-15b93
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:50:05 +0200 |
parents | 0293115a14e9 |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
19:ac1f612d5250 | 20:859a2309aef8 |
---|---|
263 | 263 |
264 Lisp_Object Qdefault_subproc_input_handler; | 264 Lisp_Object Qdefault_subproc_input_handler; |
265 | 265 |
266 extern int process_ef; /* Event flag for subprocess operations */ | 266 extern int process_ef; /* Event flag for subprocess operations */ |
267 | 267 |
268 DEFUN ("default-subprocess-input-handler", | 268 DEFUN ("default-subprocess-input-handler", Fdefault_subproc_input_handler, 2, 2, 0, /* |
269 Fdefault_subproc_input_handler, Sdefault_subproc_input_handler, | |
270 2, 2, 0 /* | |
271 Default input handler for input from spawned subprocesses. | 269 Default input handler for input from spawned subprocesses. |
272 */ ) | 270 */ |
273 (name, input) | 271 (name, input)) |
274 Lisp_Object name, input; | |
275 { | 272 { |
276 /* Just insert in current buffer */ | 273 /* Just insert in current buffer */ |
277 buffer_insert1 (current_buffer, input); | 274 buffer_insert1 (current_buffer, input); |
278 buffer_insert_c_char ('\n'); | 275 buffer_insert_c_char ('\n'); |
279 } | 276 } |
280 | 277 |
281 DEFUN ("spawn-subprocess", Fspawn_subprocess, Sspawn_subprocess, 1, 3, 0 /* | 278 DEFUN ("spawn-subprocess", Fspawn_subprocess, 1, 3, 0, /* |
282 Spawn an asynchronous VMS suprocess for command processing. | 279 Spawn an asynchronous VMS suprocess for command processing. |
283 */ ) | 280 */ |
284 (name, input_handler, exit_handler) | 281 (name, input_handler, exit_handler)) |
285 Lisp_Object name, input_handler, exit_handler; | |
286 { | 282 { |
287 /* This function can GC */ | 283 /* This function can GC */ |
288 int status; | 284 int status; |
289 char output_mbx_name[20]; | 285 char output_mbx_name[20]; |
290 struct dsc$descriptor_s output_mbx_dsc; | 286 struct dsc$descriptor_s output_mbx_dsc; |
357 char *msg; | 353 char *msg; |
358 { | 354 { |
359 write_to_mbx (ptr, msg, strlen (msg)); | 355 write_to_mbx (ptr, msg, strlen (msg)); |
360 } | 356 } |
361 | 357 |
362 DEFUN ("send-command-to-subprocess", | 358 DEFUN ("send-command-to-subprocess", Fsend_command_to_subprocess, 2, 2, |
363 Fsend_command_to_subprocess, Ssend_command_to_subprocess, 2, 2, | 359 "sSend command to subprocess: \nsSend subprocess %s command: ", /* |
364 "sSend command to subprocess: \nsSend subprocess %s command: " /* | |
365 Send to VMS subprocess named NAME the string COMMAND. | 360 Send to VMS subprocess named NAME the string COMMAND. |
366 */ ) | 361 */ |
367 (name, command) | 362 (name, command)) |
368 Lisp_Object name, command; | |
369 { | 363 { |
370 struct process_list * ptr; | 364 struct process_list * ptr; |
371 | 365 |
372 CHECK_INT (name); | 366 CHECK_INT (name); |
373 CHECK_STRING (command); | 367 CHECK_STRING (command); |
378 return Qt; | 372 return Qt; |
379 } | 373 } |
380 return Qnil; | 374 return Qnil; |
381 } | 375 } |
382 | 376 |
383 DEFUN ("stop-subprocess", Fstop_subprocess, Sstop_subprocess, 1, 1, | 377 DEFUN ("stop-subprocess", Fstop_subprocess, 1, 1, "sStop subprocess: ", /* |
384 "sStop subprocess: " /* | |
385 Stop VMS subprocess named NAME. | 378 Stop VMS subprocess named NAME. |
386 */ ) | 379 */ |
387 (name) | 380 (name)) |
388 Lisp_Object name; | |
389 { | 381 { |
390 struct process_list * ptr; | 382 struct process_list * ptr; |
391 | 383 |
392 CHECK_INT (name); | 384 CHECK_INT (name); |
393 for (ptr = process_list; ptr; ptr = ptr->next) | 385 for (ptr = process_list; ptr; ptr = ptr->next) |
572 { | 564 { |
573 sys$qiow (0, ptr->mbx_chan, IO$_WRITEVBLK | IO$M_NOW, &ptr->iosb, | 565 sys$qiow (0, ptr->mbx_chan, IO$_WRITEVBLK | IO$M_NOW, &ptr->iosb, |
574 0, 0, buf, len, 0, 0, 0, 0); | 566 0, 0, buf, len, 0, 0, 0, 0); |
575 } | 567 } |
576 | 568 |
577 DEFUN ("setprv", Fsetprv, Ssetprv, 1, 3, 0 /* | 569 DEFUN ("setprv", Fsetprv, 1, 3, 0, /* |
578 Set or reset a VMS privilege. First arg is privilege name. | 570 Set or reset a VMS privilege. First arg is privilege name. |
579 Second arg is t or nil, indicating whether the privilege is to be | 571 Second arg is t or nil, indicating whether the privilege is to be |
580 set or reset. Default is nil. Returns t if success, nil if not. | 572 set or reset. Default is nil. Returns t if success, nil if not. |
581 If third arg is non-nil, does not change privilege, but returns t | 573 If third arg is non-nil, does not change privilege, but returns t |
582 or nil depending upon whether the privilege is already enabled. | 574 or nil depending upon whether the privilege is already enabled. |
583 */ ) | 575 */ |
584 (priv, value, getprv) | 576 (priv, value, getprv)) |
585 Lisp_Object priv, value, getprv; | |
586 { | 577 { |
587 int prvmask[2], prvlen, newmask[2]; | 578 int prvmask[2], prvlen, newmask[2]; |
588 char * prvname; | 579 char * prvname; |
589 int found, i; | 580 int found, i; |
590 struct privilege_list * ptr; | 581 struct privilege_list * ptr; |
629 | 620 |
630 /* Retrieves VMS system information. */ | 621 /* Retrieves VMS system information. */ |
631 | 622 |
632 #ifdef VMS4_4 /* I don't know whether these functions work in old versions */ | 623 #ifdef VMS4_4 /* I don't know whether these functions work in old versions */ |
633 | 624 |
634 DEFUN ("vms-system-info", Fvms_system_info, Svms_system_info, 1, 3, 0 /* | 625 DEFUN ("vms-system-info", Fvms_system_info, 1, 3, 0, /* |
635 Retrieve VMS process and system information. | 626 Retrieve VMS process and system information. |
636 The first argument (a string) specifies the type of information desired. | 627 The first argument (a string) specifies the type of information desired. |
637 The other arguments depend on the type you select. | 628 The other arguments depend on the type you select. |
638 For information about a process, the second argument is a process ID | 629 For information about a process, the second argument is a process ID |
639 or a process name, with the current process as a default. | 630 or a process name, with the current process as a default. |
651 username Returns username | 642 username Returns username |
652 version Returns VMS version | 643 version Returns VMS version |
653 logical Translates VMS logical name (second argument) | 644 logical Translates VMS logical name (second argument) |
654 dcl-symbol Translates DCL symbol (second argument) | 645 dcl-symbol Translates DCL symbol (second argument) |
655 proclist Returns list of all PIDs on system (needs WORLD privilege). | 646 proclist Returns list of all PIDs on system (needs WORLD privilege). |
656 */ ) | 647 */ |
657 (type, arg1, arg2) | 648 (type, arg1, arg2)) |
658 Lisp_Object type, arg1, arg2; | |
659 { | 649 { |
660 int i, typelen; | 650 int i, typelen; |
661 char * typename; | 651 char * typename; |
662 struct vms_objlist * ptr; | 652 struct vms_objlist * ptr; |
663 | 653 |
914 retval = Fcons (make_int (id), retval); | 904 retval = Fcons (make_int (id), retval); |
915 } | 905 } |
916 return (Fsort (retval, intern ("<"))); | 906 return (Fsort (retval, intern ("<"))); |
917 } | 907 } |
918 | 908 |
919 DEFUN ("shrink-to-icon", Fshrink_to_icon, Sshrink_to_icon, 0, 0, 0 /* | 909 DEFUN ("shrink-to-icon", Fshrink_to_icon, 0, 0, 0, /* |
920 If emacs is running in a workstation window, shrink to an icon. | 910 If emacs is running in a workstation window, shrink to an icon. |
921 */ ) | 911 */ |
922 () | 912 ()) |
923 { | 913 { |
924 static char result[128]; | 914 static char result[128]; |
925 static $DESCRIPTOR (result_descriptor, result); | 915 static $DESCRIPTOR (result_descriptor, result); |
926 static $DESCRIPTOR (tt_name, "TT:"); | 916 static $DESCRIPTOR (tt_name, "TT:"); |
927 static int chan = 0; | 917 static int chan = 0; |
951 input_mbx_chan = 0; | 941 input_mbx_chan = 0; |
952 } | 942 } |
953 | 943 |
954 syms_of_vmsfns (void) | 944 syms_of_vmsfns (void) |
955 { | 945 { |
956 defsubr (&Sdefault_subproc_input_handler); | 946 DEFSUBR (Fdefault_subproc_input_handler); |
957 defsubr (&Sspawn_subprocess); | 947 DEFSUBR (Fspawn_subprocess); |
958 defsubr (&Ssend_command_to_subprocess); | 948 DEFSUBR (Fsend_command_to_subprocess); |
959 defsubr (&Sstop_subprocess); | 949 DEFSUBR (Fstop_subprocess); |
960 defsubr (&Ssetprv); | 950 DEFSUBR (Fsetprv); |
961 #ifdef VMS4_4 | 951 #ifdef VMS4_4 |
962 defsubr (&Svms_system_info); | 952 DEFSUBR (Fvms_system_info); |
963 defsubr (&Sshrink_to_icon); | 953 DEFSUBR (Fshrink_to_icon); |
964 #endif /* VMS4_4 */ | 954 #endif /* VMS4_4 */ |
965 defsymbol (&Qdefault_subproc_input_handler, | 955 defsymbol (&Qdefault_subproc_input_handler, |
966 "default-subprocess-input-handler"); | 956 "default-subprocess-input-handler"); |
967 } | 957 } |
968 #endif /* VMS */ | 958 #endif /* VMS */ |