aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorKim F. Storm2003-01-10 22:24:41 +0000
committerKim F. Storm2003-01-10 22:24:41 +0000
commit365aee82386ed9d174d71448a7a2f4a936a4c379 (patch)
tree933bfca76e52172ffa640dfa49834ee00566f3f4 /src/process.c
parentb8a76c6c308f76770a7949c6dab384b0d8e3b402 (diff)
downloademacs-365aee82386ed9d174d71448a7a2f4a936a4c379.tar.gz
emacs-365aee82386ed9d174d71448a7a2f4a936a4c379.zip
(Fset_process_contact): New function.
(syms_of_process): defsubr it. (make-network-process): Update doc.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c
index 9a11af0605b..70825a54ca0 100644
--- a/src/process.c
+++ b/src/process.c
@@ -146,7 +146,7 @@ extern Lisp_Object QCfamily;
146extern Lisp_Object QCfilter; 146extern Lisp_Object QCfilter;
147 147
148/* a process object is a network connection when its childp field is neither 148/* a process object is a network connection when its childp field is neither
149 Qt nor Qnil but is instead a cons cell (HOSTNAME PORTNUM). */ 149 Qt nor Qnil but is instead a property list (KEY VAL ...). */
150 150
151#ifdef HAVE_SOCKETS 151#ifdef HAVE_SOCKETS
152#define NETCONN_P(p) (GC_CONSP (XPROCESS (p)->childp)) 152#define NETCONN_P(p) (GC_CONSP (XPROCESS (p)->childp))
@@ -1037,6 +1037,24 @@ See `make-network-process' for a list of keywords. */)
1037 return Fplist_get (contact, key); 1037 return Fplist_get (contact, key);
1038} 1038}
1039 1039
1040DEFUN ("set-process-contact", Fset_process_contact, Sset_process_contact,
1041 3, 3, 0,
1042 doc: /* Change value in PROCESS' contact information list of KEY to VAL.
1043If KEY is already a property on the list, its value is set to VAL,
1044otherwise the new KEY VAL pair is added. Returns VAL. */)
1045 (process, key, val)
1046 register Lisp_Object process, key, val;
1047{
1048 Lisp_Object contact;
1049
1050 CHECK_PROCESS (process);
1051
1052 if (NETCONN_P (process))
1053 XPROCESS (process)->childp = Fplist_put (XPROCESS (process)->childp, key, val);
1054
1055 return val;
1056}
1057
1040#if 0 /* Turned off because we don't currently record this info 1058#if 0 /* Turned off because we don't currently record this info
1041 in the process. Perhaps add it. */ 1059 in the process. Perhaps add it. */
1042DEFUN ("process-connection", Fprocess_connection, Sprocess_connection, 1, 1, 0, 1060DEFUN ("process-connection", Fprocess_connection, Sprocess_connection, 1, 1, 0,
@@ -2589,6 +2607,10 @@ the server process. Also, the BUFFER argument is not used directly by
2589the server process, but via the optional :log function, accepted (and 2607the server process, but via the optional :log function, accepted (and
2590failed) connections may be logged in the server process' buffer. 2608failed) connections may be logged in the server process' buffer.
2591 2609
2610The original argument list, modified with the actual connection
2611information, is available via the `process-contact' function.
2612Additional arguments may be added via `set-process-contact'.
2613
2592usage: (make-network-process &rest ARGS) */) 2614usage: (make-network-process &rest ARGS) */)
2593 (nargs, args) 2615 (nargs, args)
2594 int nargs; 2616 int nargs;
@@ -6341,6 +6363,7 @@ The value takes effect when `start-process' is called. */);
6341 defsubr (&Sset_process_query_on_exit_flag); 6363 defsubr (&Sset_process_query_on_exit_flag);
6342 defsubr (&Sprocess_query_on_exit_flag); 6364 defsubr (&Sprocess_query_on_exit_flag);
6343 defsubr (&Sprocess_contact); 6365 defsubr (&Sprocess_contact);
6366 defsubr (&Sset_process_contact);
6344 defsubr (&Slist_processes); 6367 defsubr (&Slist_processes);
6345 defsubr (&Sprocess_list); 6368 defsubr (&Sprocess_list);
6346 defsubr (&Sstart_process); 6369 defsubr (&Sstart_process);