GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- p->adaptive_read_buffering = Qnil;
- XSETFASTINT (p->read_output_delay, 0);
- p->read_output_skip = Qnil;
+ p->adaptive_read_buffering = 0;
+ p->read_output_delay = 0;
+ p->read_output_skip = 0;
/* Do this now, since remove_process will make sigchld_handler do nothing. */
p->status
= Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
/* Do this now, since remove_process will make sigchld_handler do nothing. */
p->status
= Fcons (Qsignal, Fcons (make_number (SIGKILL), Qnil));
- FD_CLR (XINT (p->infd), &input_wait_mask);
- FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
+ FD_CLR (p->infd, &input_wait_mask);
+ FD_CLR (p->infd, &non_keyboard_wait_mask);
}
else if (EQ (p->filter, Qt)
&& !EQ (p->command, Qt)) /* Network process not stopped. */
{
}
else if (EQ (p->filter, Qt)
&& !EQ (p->command, Qt)) /* Network process not stopped. */
{
- FD_SET (XINT (p->infd), &input_wait_mask);
- FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
+ FD_SET (p->infd, &input_wait_mask);
+ FD_SET (p->infd, &non_keyboard_wait_mask);
- if (XINT (XPROCESS (process)->infd) < 0
- || set_window_size (XINT (XPROCESS (process)->infd),
+ if (XPROCESS (process)->infd < 0
+ || set_window_size (XPROCESS (process)->infd,
if (NILP (port))
port = Fformat_network_address (Fplist_get (p->childp, QClocal), Qnil);
sprintf (tembuf, "(network %s server on %s)\n",
if (NILP (port))
port = Fformat_network_address (Fplist_get (p->childp, QClocal), Qnil);
sprintf (tembuf, "(network %s server on %s)\n",
if (NILP (host))
host = Fformat_network_address (Fplist_get (p->childp, QCremote), Qnil);
sprintf (tembuf, "(network %s connection to %s)\n",
if (NILP (host))
host = Fformat_network_address (Fplist_get (p->childp, QCremote), Qnil);
sprintf (tembuf, "(network %s connection to %s)\n",
XPROCESS (proc)->sentinel = Qnil;
XPROCESS (proc)->filter = Qnil;
XPROCESS (proc)->filter_multibyte
XPROCESS (proc)->sentinel = Qnil;
XPROCESS (proc)->filter = Qnil;
XPROCESS (proc)->filter_multibyte
XPROCESS (proc)->command = Flist (nargs - 2, args + 2);
#ifdef ADAPTIVE_READ_BUFFERING
XPROCESS (proc)->command = Flist (nargs - 2, args + 2);
#ifdef ADAPTIVE_READ_BUFFERING
- XPROCESS (proc)->adaptive_read_buffering = Vprocess_adaptive_read_buffering;
+ XPROCESS (proc)->adaptive_read_buffering
+ = (NILP (Vprocess_adaptive_read_buffering) ? 0
+ : EQ (Vprocess_adaptive_read_buffering, Qt) ? 1 : 2);
/* Record this as an active process, with its channels.
As a result, child_setup will close Emacs's side of the pipes. */
chan_process[inchannel] = process;
/* Record this as an active process, with its channels.
As a result, child_setup will close Emacs's side of the pipes. */
chan_process[inchannel] = process;
- XSETINT (XPROCESS (process)->infd, inchannel);
- XSETINT (XPROCESS (process)->outfd, outchannel);
+ XPROCESS (process)->infd = inchannel;
+ XPROCESS (process)->outfd = outchannel;
/* Previously we recorded the tty descriptor used in the subprocess.
It was only used for getting the foreground tty process, so now
we just reopen the device (see emacs_get_tty_pgrp) as this is
more portable (see USG_SUBTTY_WORKS above). */
/* Previously we recorded the tty descriptor used in the subprocess.
It was only used for getting the foreground tty process, so now
we just reopen the device (see emacs_get_tty_pgrp) as this is
more portable (see USG_SUBTTY_WORKS above). */
return conv_sockaddr_to_lisp (datagram_address[channel].sa,
datagram_address[channel].len);
}
return conv_sockaddr_to_lisp (datagram_address[channel].sa,
datagram_address[channel].len);
}
len = get_lisp_to_sockaddr_size (address, &family);
if (datagram_address[channel].len != len)
len = get_lisp_to_sockaddr_size (address, &family);
if (datagram_address[channel].len != len)
:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the
process filter are multibyte, otherwise they are unibyte.
:filter-multibyte BOOL -- If BOOL is non-nil, strings given to the
process filter are multibyte, otherwise they are unibyte.
`default-enable-multibyte-characters' is non-nil.
:sentinel SENTINEL -- Install SENTINEL as the process sentinel.
`default-enable-multibyte-characters' is non-nil.
:sentinel SENTINEL -- Install SENTINEL as the process sentinel.
/* Override the above only if :filter-multibyte is specified. */
if (! NILP (Fplist_member (contact, QCfilter_multibyte)))
/* Override the above only if :filter-multibyte is specified. */
if (! NILP (Fplist_member (contact, QCfilter_multibyte)))
p->log = Fplist_get (contact, QClog);
if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
p->log = Fplist_get (contact, QClog);
if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
register int inchannel, outchannel;
register struct Lisp_Process *p = XPROCESS (proc);
register int inchannel, outchannel;
register struct Lisp_Process *p = XPROCESS (proc);
- XSETINT (p->read_output_delay, 0);
- p->read_output_skip = Qnil;
+ p->read_output_delay = 0;
+ p->read_output_skip = 0;
If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
from PROCESS, suspending reading output from other processes.
If JUST-THIS-ONE is an integer, don't run any timers either.
If optional fourth arg JUST-THIS-ONE is non-nil, only accept output
from PROCESS, suspending reading output from other processes.
If JUST-THIS-ONE is an integer, don't run any timers either.
(process, seconds, millisec, just_this_one)
register Lisp_Object process, seconds, millisec, just_this_one;
{
(process, seconds, millisec, just_this_one)
register Lisp_Object process, seconds, millisec, just_this_one;
{
if (!NILP (ps->log))
call3 (ps->log, server, proc,
if (!NILP (ps->log))
call3 (ps->log, server, proc,
(and gobble terminal input into the buffer if any arrives).
If WAIT_PROC is specified, wait until something arrives from that
(and gobble terminal input into the buffer if any arrives).
If WAIT_PROC is specified, wait until something arrives from that
that process.
If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC
(suspending output from other processes). A negative value
means don't run any timers either.
that process.
If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC
(suspending output from other processes). A negative value
means don't run any timers either.
int
wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
int
wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
record_unwind_protect (wait_reading_process_output_unwind,
make_number (waiting_for_user_input_p));
record_unwind_protect (wait_reading_process_output_unwind,
make_number (waiting_for_user_input_p));
XSETPROCESS (proc, wait_proc);
/* Read data from the process, until we exhaust it. */
XSETPROCESS (proc, wait_proc);
/* Read data from the process, until we exhaust it. */
read_output_delay, and we are not reading output for a
specific wait_channel. It is not executed if
Vprocess_adaptive_read_buffering is nil. */
read_output_delay, and we are not reading output for a
specific wait_channel. It is not executed if
Vprocess_adaptive_read_buffering is nil. */
- XPROCESS (proc)->read_output_skip = Qnil;
- if (XINT (XPROCESS (proc)->read_output_delay) < usecs)
- usecs = XINT (XPROCESS (proc)->read_output_delay);
+ XPROCESS (proc)->read_output_skip = 0;
+ if (XPROCESS (proc)->read_output_delay < usecs)
+ usecs = XPROCESS (proc)->read_output_delay;
deactivate_process (proc);
if (XPROCESS (proc)->raw_status_new)
update_status (XPROCESS (proc));
deactivate_process (proc);
if (XPROCESS (proc)->raw_status_new)
update_status (XPROCESS (proc));
p->status = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil));
deactivate_process (proc);
}
p->status = Fcons (Qfailed, Fcons (make_number (xerrno), Qnil));
deactivate_process (proc);
}
exec_sentinel (proc, build_string ("open\n"));
if (!EQ (p->filter, Qt) && !EQ (p->command, Qt))
{
exec_sentinel (proc, build_string ("open\n"));
if (!EQ (p->filter, Qt) && !EQ (p->command, Qt))
{
- FD_SET (XINT (p->infd), &input_wait_mask);
- FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
+ FD_SET (p->infd, &input_wait_mask);
+ FD_SET (p->infd, &non_keyboard_wait_mask);
register struct Lisp_Process *p = XPROCESS (proc);
register int opoint;
struct coding_system *coding = proc_decode_coding_system[channel];
register struct Lisp_Process *p = XPROCESS (proc);
register int opoint;
struct coding_system *coding = proc_decode_coding_system[channel];
{
nbytes = emacs_read (channel, chars + carryover, readmax);
#ifdef ADAPTIVE_READ_BUFFERING
{
nbytes = emacs_read (channel, chars + carryover, readmax);
#ifdef ADAPTIVE_READ_BUFFERING
/* At this point, NBYTES holds number of bytes just received
(including the one in proc_buffered_char[channel]). */
/* At this point, NBYTES holds number of bytes just received
(including the one in proc_buffered_char[channel]). */
{
p->encode_coding_system = coding->symbol;
setup_coding_system (coding->symbol,
{
p->encode_coding_system = coding->symbol;
setup_coding_system (coding->symbol,
p->decoding_buf = make_uninit_string (carryover);
bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
carryover);
p->decoding_buf = make_uninit_string (carryover);
bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
carryover);
text = (STRING_MULTIBYTE (text)
? Fstring_as_unibyte (text)
: Fstring_to_multibyte (text));
text = (STRING_MULTIBYTE (text)
? Fstring_as_unibyte (text)
: Fstring_to_multibyte (text));
{
p->encode_coding_system = coding->symbol;
setup_coding_system (coding->symbol,
{
p->encode_coding_system = coding->symbol;
setup_coding_system (coding->symbol,
p->decoding_buf = make_uninit_string (carryover);
bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
carryover);
p->decoding_buf = make_uninit_string (carryover);
bcopy (chars + coding->consumed, SDATA (p->decoding_buf),
carryover);
/* Adjust the multibyteness of TEXT to that of the buffer. */
if (NILP (current_buffer->enable_multibyte_characters)
/* Adjust the multibyteness of TEXT to that of the buffer. */
if (NILP (current_buffer->enable_multibyte_characters)
update_status (p);
if (! EQ (p->status, Qrun))
error ("Process %s not running", SDATA (p->name));
update_status (p);
if (! EQ (p->status, Qrun))
error ("Process %s not running", SDATA (p->name));
/* Decide how much data we can send in one batch.
Long lines need to be split into multiple batches. */
/* Decide how much data we can send in one batch.
Long lines need to be split into multiple batches. */
{
/* Starting this at zero is always correct when not the first
iteration because the previous iteration ended by sending C-d.
{
/* Starting this at zero is always correct when not the first
iteration because the previous iteration ended by sending C-d.
old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap);
#ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (outfd))
old_sigpipe = (SIGTYPE (*) ()) signal (SIGPIPE, send_process_trap);
#ifdef DATAGRAM_SOCKETS
if (DATAGRAM_CHAN_P (outfd))
{
rv = emacs_write (outfd, (char *) buf, this);
#ifdef ADAPTIVE_READ_BUFFERING
{
rv = emacs_write (outfd, (char *) buf, this);
#ifdef ADAPTIVE_READ_BUFFERING
- if (XINT (p->read_output_delay) > 0
- && EQ (p->adaptive_read_buffering, Qt))
+ if (p->read_output_delay > 0
+ && p->adaptive_read_buffering == 1)
deactivate_process (proc);
#ifdef VMS
error ("Error writing to process %s; closed it", SDATA (p->name));
deactivate_process (proc);
#ifdef VMS
error ("Error writing to process %s; closed it", SDATA (p->name));
update_status (p);
if (! EQ (p->status, Qrun))
error ("Process %s not running", SDATA (p->name));
update_status (p);
if (! EQ (p->status, Qrun))
error ("Process %s not running", SDATA (p->name));
if (! EQ (coding->symbol, p->encode_coding_system))
/* The coding system for encoding was changed to raw-text
because we sent a unibyte text previously. Now we are
if (! EQ (coding->symbol, p->encode_coding_system))
/* The coding system for encoding was changed to raw-text
because we sent a unibyte text previously. Now we are
send_process (proc, &c.t_intrc, 1, Qnil);
return;
case SIGQUIT:
send_process (proc, &c.t_intrc, 1, Qnil);
return;
case SIGQUIT:
send_process (proc, &c.t_quitc, 1, Qnil);
return;
#ifdef SIGTSTP
case SIGTSTP:
send_process (proc, &c.t_quitc, 1, Qnil);
return;
#ifdef SIGTSTP
case SIGTSTP:
send_process (proc, &lc.t_suspc, 1, Qnil);
return;
#endif /* ! defined (SIGTSTP) */
send_process (proc, &lc.t_suspc, 1, Qnil);
return;
#endif /* ! defined (SIGTSTP) */
send_process (proc, &t.c_cc[VINTR], 1, Qnil);
return;
case SIGQUIT:
send_process (proc, &t.c_cc[VINTR], 1, Qnil);
return;
case SIGQUIT:
send_process (proc, &t.c_cc[VQUIT], 1, Qnil);
return;
#ifdef SIGTSTP
case SIGTSTP:
send_process (proc, &t.c_cc[VQUIT], 1, Qnil);
return;
#ifdef SIGTSTP
case SIGTSTP:
send_process (proc, &t.c_cc[VSWTCH], 1, Qnil);
return;
#endif /* ! defined (SIGTSTP) */
send_process (proc, &t.c_cc[VSWTCH], 1, Qnil);
return;
#endif /* ! defined (SIGTSTP) */
- FD_CLR (XINT (p->infd), &input_wait_mask);
- FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
+ FD_CLR (p->infd, &input_wait_mask);
+ FD_CLR (p->infd, &non_keyboard_wait_mask);
- FD_SET (XINT (p->infd), &input_wait_mask);
- FD_SET (XINT (p->infd), &non_keyboard_wait_mask);
+ FD_SET (p->infd, &input_wait_mask);
+ FD_SET (p->infd, &non_keyboard_wait_mask);
#ifdef VMS
send_process (proc, "\032", 1, Qnil); /* ^z */
#else
#ifdef VMS
send_process (proc, "\032", 1, Qnil); /* ^z */
#else
send_process (proc, "\004", 1, Qnil);
else
{
send_process (proc, "\004", 1, Qnil);
else
{
(In some old system, shutdown to socketpair doesn't work.
Then we just can't win.) */
if (XPROCESS (proc)->pid == 0
(In some old system, shutdown to socketpair doesn't work.
Then we just can't win.) */
if (XPROCESS (proc)->pid == 0
- || XINT (XPROCESS (proc)->outfd) == XINT (XPROCESS (proc)->infd))
- shutdown (XINT (XPROCESS (proc)->outfd), 1);
+ || XPROCESS (proc)->outfd == XPROCESS (proc)->infd)
+ shutdown (XPROCESS (proc)->outfd, 1);
- if (XINT (XPROCESS (proc)->outfd) != XINT (XPROCESS (proc)->infd))
- emacs_close (XINT (XPROCESS (proc)->outfd));
+ if (XPROCESS (proc)->outfd != XPROCESS (proc)->infd)
+ emacs_close (XPROCESS (proc)->outfd);
#endif /* not HAVE_SHUTDOWN */
new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0);
if (new_outfd < 0)
abort ();
#endif /* not HAVE_SHUTDOWN */
new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0);
if (new_outfd < 0)
abort ();
bzero (proc_encode_coding_system[old_outfd],
sizeof (struct coding_system));
bzero (proc_encode_coding_system[old_outfd],
sizeof (struct coding_system));
process_send_signal (proc, SIGHUP, Qnil, 1);
}
}
process_send_signal (proc, SIGHUP, Qnil, 1);
}
}
u.wt = w;
p->raw_status = u.i;
p->raw_status_new = 1;
/* If process has terminated, stop waiting for its output. */
if ((WIFSIGNALED (w) || WIFEXITED (w))
u.wt = w;
p->raw_status = u.i;
p->raw_status_new = 1;
/* If process has terminated, stop waiting for its output. */
if ((WIFSIGNALED (w) || WIFEXITED (w))
- FD_CLR (XINT (p->infd), &input_wait_mask);
- FD_CLR (XINT (p->infd), &non_keyboard_wait_mask);
+ FD_CLR (p->infd, &input_wait_mask);
+ FD_CLR (p->infd, &non_keyboard_wait_mask);
/* If process is still active, read any output that remains. */
while (! EQ (p->filter, Qt)
&& ! EQ (p->status, Qconnect)
&& ! EQ (p->status, Qlisten)
&& ! EQ (p->command, Qt) /* Network process not stopped. */
/* If process is still active, read any output that remains. */
while (! EQ (p->filter, Qt)
&& ! EQ (p->status, Qconnect)
&& ! EQ (p->status, Qlisten)
&& ! EQ (p->command, Qt) /* Network process not stopped. */
So set p->update_tick again
so that an error in the sentinel will not cause
this code to be run again. */
So set p->update_tick again
so that an error in the sentinel will not cause
this code to be run again. */
/* Now output the message suitably. */
if (!NILP (p->sentinel))
exec_sentinel (proc, msg);
/* Now output the message suitably. */
if (!NILP (p->sentinel))
exec_sentinel (proc, msg);
error ("Output file descriptor of %s closed", SDATA (p->name));
Fcheck_coding_system (decoding);
Fcheck_coding_system (encoding);
error ("Output file descriptor of %s closed", SDATA (p->name));
Fcheck_coding_system (decoding);
Fcheck_coding_system (encoding);
int
wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
int
wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,