Mercurial > hg > xemacs-beta
comparison src/process.c @ 5255:b5611afbcc76
Support process plists, for greater GNU compatibility.
src/ChangeLog addition:
2010-09-02 Aidan Kehoe <kehoea@parhasard.net>
* process.c (process_getprop, process_putprop, process_remprop)
(process_plist, process_setplist, reinit_process_early):
Add functions to modify a process's property list.
* process-slots.h (MARKED_SLOT): Add a plist slot.
* fns.c (Fobject_setplist): New function, analogous to #'setplist,
but more general.
Update the documentation in the other plist functions to reflect
that processes now have property lists.
* emacs.c (main_1): Call reinit_process_early(), now processes have
plist methods that need to be initialised.
* symbols.c (reinit_symbol_objects_early): Fsetplist is the named
setplist method for symbols.
lisp/ChangeLog addition:
2010-09-02 Aidan Kehoe <kehoea@parhasard.net>
* obsolete.el (process-get):
Make #'process-get, #'process-put, #'process-plist,
#'set-process-plist available as aliases to the more general
functions #'get, #'put, #'object-plist, #'object-setplist, for GNU
compatibility.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 02 Sep 2010 12:23:11 +0100 |
parents | 6c6d78781d59 |
children | c096d8051f89 308d34e9f07d |
comparison
equal
deleted
inserted
replaced
5254:1537701f08a1 | 5255:b5611afbcc76 |
---|---|
167 print_internal (process->pid, printcharfun, 1); | 167 print_internal (process->pid, printcharfun, 1); |
168 write_fmt_string_lisp (printcharfun, " state:%S", 1, process->status_symbol); | 168 write_fmt_string_lisp (printcharfun, " state:%S", 1, process->status_symbol); |
169 MAYBE_PROCMETH (print_process_data, (process, printcharfun)); | 169 MAYBE_PROCMETH (print_process_data, (process, printcharfun)); |
170 write_ascstring (printcharfun, ">"); | 170 write_ascstring (printcharfun, ">"); |
171 } | 171 } |
172 } | |
173 /* Process plists are directly accessible, so we need to protect against | |
174 invalid property list structure */ | |
175 | |
176 static Lisp_Object | |
177 process_getprop (Lisp_Object process, Lisp_Object property) | |
178 { | |
179 return external_plist_get (&XPROCESS (process)->plist, property, 0, | |
180 ERROR_ME); | |
181 } | |
182 | |
183 static int | |
184 process_putprop (Lisp_Object process, Lisp_Object property, Lisp_Object value) | |
185 { | |
186 external_plist_put (&XPROCESS (process)->plist, property, value, 0, | |
187 ERROR_ME); | |
188 return 1; | |
189 } | |
190 | |
191 static int | |
192 process_remprop (Lisp_Object process, Lisp_Object property) | |
193 { | |
194 return external_remprop (&XPROCESS (process)->plist, property, 0, ERROR_ME); | |
195 } | |
196 | |
197 static Lisp_Object | |
198 process_plist (Lisp_Object process) | |
199 { | |
200 return XPROCESS (process)->plist; | |
201 } | |
202 | |
203 static Lisp_Object | |
204 process_setplist (Lisp_Object process, Lisp_Object newplist) | |
205 { | |
206 XPROCESS (process)->plist = newplist; | |
207 return newplist; | |
172 } | 208 } |
173 | 209 |
174 #ifdef HAVE_WINDOW_SYSTEM | 210 #ifdef HAVE_WINDOW_SYSTEM |
175 extern void debug_process_finalization (Lisp_Process *p); | 211 extern void debug_process_finalization (Lisp_Process *p); |
176 #endif /* HAVE_WINDOW_SYSTEM */ | 212 #endif /* HAVE_WINDOW_SYSTEM */ |
2403 putenv_internal ((Ibyte *) var, strlen (var), (Ibyte *) value, | 2439 putenv_internal ((Ibyte *) var, strlen (var), (Ibyte *) value, |
2404 strlen (value)); | 2440 strlen (value)); |
2405 } | 2441 } |
2406 | 2442 |
2407 | 2443 |
2444 void | |
2445 reinit_process_early (void) | |
2446 { | |
2447 OBJECT_HAS_METHOD (process, getprop); | |
2448 OBJECT_HAS_METHOD (process, putprop); | |
2449 OBJECT_HAS_METHOD (process, remprop); | |
2450 OBJECT_HAS_METHOD (process, plist); | |
2451 OBJECT_HAS_METHOD (process, setplist); | |
2452 } | |
2453 | |
2408 /* This is not named init_process in order to avoid a conflict with NS 3.3 */ | 2454 /* This is not named init_process in order to avoid a conflict with NS 3.3 */ |
2409 void | 2455 void |
2410 init_xemacs_process (void) | 2456 init_xemacs_process (void) |
2411 { | 2457 { |
2412 /* This function can GC */ | 2458 /* This function can GC */ |
2479 } | 2525 } |
2480 #endif /* 0 */ | 2526 #endif /* 0 */ |
2481 | 2527 |
2482 Vshell_file_name = build_istring (shell); | 2528 Vshell_file_name = build_istring (shell); |
2483 } | 2529 } |
2530 | |
2531 reinit_process_early (); | |
2484 } | 2532 } |
2485 | 2533 |
2486 void | 2534 void |
2487 syms_of_process (void) | 2535 syms_of_process (void) |
2488 { | 2536 { |