summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-01 23:18:03 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-01 23:18:03 +0000
commit8f707ba31a02f79ffaee5e50ecb25750dece0d89 (patch)
treeddbe0283e5955613155f414e50ff142adb67cfd0 /src/process.c
parent039462e63a2ae639001dfe8fb32401f9885a79b3 (diff)
downloademacs-8f707ba31a02f79ffaee5e50ecb25750dece0d89.tar.gz
(Fprocess_contact): New function.
(Fopen_network_stream): Store a cons cell in childp. (NETCONN_P): Use GC_CONSP. (list_processes_1): Use new childp format.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/process.c b/src/process.c
index 0fb8969d402..aa7bd1300e2 100644
--- a/src/process.c
+++ b/src/process.c
@@ -110,13 +110,12 @@ Lisp_Object Qlast_nonmenu_event;
/* Qexit is declared and initialized in eval.c. */
/* a process object is a network connection when its childp field is neither
- Qt nor Qnil but is instead a string (name of foreign host we
- are connected to + name of port we are connected to) */
+ Qt nor Qnil but is instead a cons cell (HOSTNAME PORTNUM). */
#ifdef HAVE_SOCKETS
static Lisp_Object stream_process;
-#define NETCONN_P(p) (GC_STRINGP (XPROCESS (p)->childp))
+#define NETCONN_P(p) (GC_CONSP (XPROCESS (p)->childp))
#else
#define NETCONN_P(p) 0
#endif /* HAVE_SOCKETS */
@@ -848,6 +847,17 @@ Value is t if a query was formerly required.")
return Fnull (tem);
}
+DEFUN ("process-contact", Fprocess_contact, Sprocess_contact,
+ 1, 1, 0,
+ "Return the contact info of PROCESS; t for a real child.\n\
+For a net connection, the value is a cons cell of the form (HOST SERVICE).")
+ (process)
+ register Lisp_Object process;
+{
+ CHECK_PROCESS (process, 0);
+ return XPROCESS (process)->childp;
+}
+
#if 0 /* Turned off because we don't currently record this info
in the process. Perhaps add it. */
DEFUN ("process-connection", Fprocess_connection, Sprocess_connection, 1, 1, 0,
@@ -958,7 +968,7 @@ Proc Status Buffer Tty Command\n\
if (NETCONN_P (proc))
{
sprintf (tembuf, "(network stream connection to %s)\n",
- XSTRING (p->childp)->data);
+ XSTRING (XCONS (p->childp)->car)->data);
insert_string (tembuf);
}
else
@@ -1791,7 +1801,7 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
#endif
#endif
- XPROCESS (proc)->childp = host;
+ XPROCESS (proc)->childp = Fcons (host, Fcons (service, Qnil));
XPROCESS (proc)->command_channel_p = Qnil;
XPROCESS (proc)->buffer = buffer;
XPROCESS (proc)->sentinel = Qnil;
@@ -3793,9 +3803,10 @@ The value takes effect when `start-process' is called.");
defsubr (&Sset_process_filter);
defsubr (&Sprocess_filter);
defsubr (&Sset_process_sentinel);
- defsubr (&Sset_process_window_size);
defsubr (&Sprocess_sentinel);
+ defsubr (&Sset_process_window_size);
defsubr (&Sprocess_kill_without_query);
+ defsubr (&Sprocess_contact);
defsubr (&Slist_processes);
defsubr (&Sprocess_list);
defsubr (&Sstart_process);