comparison src/vmsproc.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 859a2309aef8
children 6a378aca36af
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
393 /* ??? I suspect that maybe this shouldn't be done on VMS. */ 393 /* ??? I suspect that maybe this shouldn't be done on VMS. */
394 /* Close Emacs's descriptors that this process should not have. */ 394 /* Close Emacs's descriptors that this process should not have. */
395 close_process_descs (); 395 close_process_descs ();
396 396
397 if (STRINGP (current_buffer->directory)) 397 if (STRINGP (current_buffer->directory))
398 chdir (XSTRING_DATA (current_buffer->directory)); 398 chdir (string_data (XSTRING (current_buffer->directory)));
399 } 399 }
400 400
401 DEFUN ("call-process-internal", Fcall_process_internal, 1, MANY, 0, /* 401 DEFUN ("call-process-internal", Fcall_process_internal, 1, MANY, 0 /*
402 Call PROGRAM synchronously in a separate process. 402 Call PROGRAM synchronously in a separate process.
403 Program's input comes from file INFILE (nil means null device, `NLA0:'). 403 Program's input comes from file INFILE (nil means null device, `NLA0:').
404 Insert output in BUFFER before point; t means current buffer; 404 Insert output in BUFFER before point; t means current buffer;
405 nil for BUFFER means discard it; 0 means discard and don't wait. 405 nil for BUFFER means discard it; 0 means discard and don't wait.
406 Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted. 406 Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted.
407 Remaining arguments are strings passed as command arguments to PROGRAM. 407 Remaining arguments are strings passed as command arguments to PROGRAM.
408 This function waits for PROGRAM to terminate, unless BUFFER is 0; 408 This function waits for PROGRAM to terminate, unless BUFFER is 0;
409 if you quit, the process is killed. 409 if you quit, the process is killed.
410 */ 410 */ )
411 (int nargs, Lisp_Object *args)) 411 (int nargs, Lisp_Object *args)
412 { 412 {
413 /* This function can GC */ 413 /* This function can GC */
414 Lisp_Object display, buffer, path; 414 Lisp_Object display, buffer, path;
415 char oldDir[512]; 415 char oldDir[512];
416 int inchannel, outchannel; 416 int inchannel, outchannel;
467 */ 467 */
468 int i; 468 int i;
469 int arg0; 469 int arg0;
470 int firstArg; 470 int firstArg;
471 471
472 if (strcmp (XSTRING_DATA (args[0]), "*dcl*") == 0) 472 if (strcmp (string_data (XSTRING (args[0])), "*dcl*") == 0)
473 { 473 {
474 arg0 = 5; 474 arg0 = 5;
475 firstArg = 6; 475 firstArg = 6;
476 } 476 }
477 else 477 else
478 { 478 {
479 arg0 = 0; 479 arg0 = 0;
480 firstArg = 4; 480 firstArg = 4;
481 } 481 }
482 len = XSTRING_LENGTH (args[arg0]) + 1; 482 len = string_length (XSTRING (args[arg0])) + 1;
483 for (i = firstArg; i < nargs; i++) 483 for (i = firstArg; i < nargs; i++)
484 { 484 {
485 CHECK_STRING (args[i]); 485 CHECK_STRING (args[i]);
486 len += XSTRING_LENGTH (args[i]) + 1; 486 len += string_length (XSTRING (args[i])) + 1;
487 } 487 }
488 new_argv = alloca (len); 488 new_argv = alloca (len);
489 strcpy (new_argv, XSTRING_DATA (args[arg0])); 489 strcpy (new_argv, string_data (XSTRING (args[arg0])));
490 for (i = firstArg; i < nargs; i++) 490 for (i = firstArg; i < nargs; i++)
491 { 491 {
492 strcat (new_argv, " "); 492 strcat (new_argv, " ");
493 strcat (new_argv, XSTRING_DATA (args[i])); 493 strcat (new_argv, string_data (XSTRING (args[i])));
494 } 494 }
495 dcmd.l = len-1; 495 dcmd.l = len-1;
496 dcmd.a = new_argv; 496 dcmd.a = new_argv;
497 497
498 status = get_pty_channel (inDevName, outDevName, &inchannel, &outchannel); 498 status = get_pty_channel (inDevName, outDevName, &inchannel, &outchannel);
518 } 518 }
519 vs->inputChan = inchannel; 519 vs->inputChan = inchannel;
520 vs->outputChan = outchannel; 520 vs->outputChan = outchannel;
521 } 521 }
522 522
523 filefd = open (XSTRING_DATA (args[1]), O_RDONLY, 0); 523 filefd = open (string_data (XSTRING (args[1])), O_RDONLY, 0);
524 if (filefd < 0) 524 if (filefd < 0)
525 { 525 {
526 sys$dassgn (inchannel); 526 sys$dassgn (inchannel);
527 sys$dassgn (outchannel); 527 sys$dassgn (outchannel);
528 give_back_vms_process_stuff (vs); 528 give_back_vms_process_stuff (vs);
529 report_file_error ("Opening process input file", Fcons (args[1], Qnil)); 529 report_file_error ("Opening process input file", Fcons (args[1], Qnil));
530 } 530 }
531 else 531 else
532 close (filefd); 532 close (filefd);
533 533
534 din.l = XSTRING_LENGTH (args[1]); 534 din.l = string_length (XSTRING (args[1]));
535 din.a = XSTRING_DATA (args[1]); 535 din.a = string_data (XSTRING (args[1]));
536 536
537 /* 537 /*
538 Start a read on the process channel 538 Start a read on the process channel
539 */ 539 */
540 if (!INTP (buffer)) 540 if (!INTP (buffer))