aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorRichard M. Stallman1996-09-01 23:18:03 +0000
committerRichard M. Stallman1996-09-01 23:18:03 +0000
commitde282a05531a1c081aed15b26280789995d8bae4 (patch)
treea1324af890cfc8a510e8287b6479720602b85218 /src/process.c
parent7321741136f872a7e01ddbf4e812437de88f77d1 (diff)
downloademacs-de282a05531a1c081aed15b26280789995d8bae4.tar.gz
emacs-de282a05531a1c081aed15b26280789995d8bae4.zip
(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;
110/* Qexit is declared and initialized in eval.c. */ 110/* Qexit is declared and initialized in eval.c. */
111 111
112/* a process object is a network connection when its childp field is neither 112/* a process object is a network connection when its childp field is neither
113 Qt nor Qnil but is instead a string (name of foreign host we 113 Qt nor Qnil but is instead a cons cell (HOSTNAME PORTNUM). */
114 are connected to + name of port we are connected to) */
115 114
116#ifdef HAVE_SOCKETS 115#ifdef HAVE_SOCKETS
117static Lisp_Object stream_process; 116static Lisp_Object stream_process;
118 117
119#define NETCONN_P(p) (GC_STRINGP (XPROCESS (p)->childp)) 118#define NETCONN_P(p) (GC_CONSP (XPROCESS (p)->childp))
120#else 119#else
121#define NETCONN_P(p) 0 120#define NETCONN_P(p) 0
122#endif /* HAVE_SOCKETS */ 121#endif /* HAVE_SOCKETS */
@@ -848,6 +847,17 @@ Value is t if a query was formerly required.")
848 return Fnull (tem); 847 return Fnull (tem);
849} 848}
850 849
850DEFUN ("process-contact", Fprocess_contact, Sprocess_contact,
851 1, 1, 0,
852 "Return the contact info of PROCESS; t for a real child.\n\
853For a net connection, the value is a cons cell of the form (HOST SERVICE).")
854 (process)
855 register Lisp_Object process;
856{
857 CHECK_PROCESS (process, 0);
858 return XPROCESS (process)->childp;
859}
860
851#if 0 /* Turned off because we don't currently record this info 861#if 0 /* Turned off because we don't currently record this info
852 in the process. Perhaps add it. */ 862 in the process. Perhaps add it. */
853DEFUN ("process-connection", Fprocess_connection, Sprocess_connection, 1, 1, 0, 863DEFUN ("process-connection", Fprocess_connection, Sprocess_connection, 1, 1, 0,
@@ -958,7 +968,7 @@ Proc Status Buffer Tty Command\n\
958 if (NETCONN_P (proc)) 968 if (NETCONN_P (proc))
959 { 969 {
960 sprintf (tembuf, "(network stream connection to %s)\n", 970 sprintf (tembuf, "(network stream connection to %s)\n",
961 XSTRING (p->childp)->data); 971 XSTRING (XCONS (p->childp)->car)->data);
962 insert_string (tembuf); 972 insert_string (tembuf);
963 } 973 }
964 else 974 else
@@ -1791,7 +1801,7 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
1791#endif 1801#endif
1792#endif 1802#endif
1793 1803
1794 XPROCESS (proc)->childp = host; 1804 XPROCESS (proc)->childp = Fcons (host, Fcons (service, Qnil));
1795 XPROCESS (proc)->command_channel_p = Qnil; 1805 XPROCESS (proc)->command_channel_p = Qnil;
1796 XPROCESS (proc)->buffer = buffer; 1806 XPROCESS (proc)->buffer = buffer;
1797 XPROCESS (proc)->sentinel = Qnil; 1807 XPROCESS (proc)->sentinel = Qnil;
@@ -3793,9 +3803,10 @@ The value takes effect when `start-process' is called.");
3793 defsubr (&Sset_process_filter); 3803 defsubr (&Sset_process_filter);
3794 defsubr (&Sprocess_filter); 3804 defsubr (&Sprocess_filter);
3795 defsubr (&Sset_process_sentinel); 3805 defsubr (&Sset_process_sentinel);
3796 defsubr (&Sset_process_window_size);
3797 defsubr (&Sprocess_sentinel); 3806 defsubr (&Sprocess_sentinel);
3807 defsubr (&Sset_process_window_size);
3798 defsubr (&Sprocess_kill_without_query); 3808 defsubr (&Sprocess_kill_without_query);
3809 defsubr (&Sprocess_contact);
3799 defsubr (&Slist_processes); 3810 defsubr (&Slist_processes);
3800 defsubr (&Sprocess_list); 3811 defsubr (&Sprocess_list);
3801 defsubr (&Sstart_process); 3812 defsubr (&Sstart_process);