Mercurial > emacs
annotate oldXMenu/XDelAssoc.c @ 82988:f82e3a6f5ccb
A few more bugfixes and new features.
(Sigh.) I obviously need to remember to separate individual changes
to multiple commits.
src/emacsclient.c: Improved error handling.
(decode_options): Changed frame option (again) from -f to -t.
(print_help_and_exit): Ditto.
(copy_from_to): Check EINTR after write, not EAGAIN. Removed SIGIO hack.
(pty_conversation): Handle errors transmitted through the socket.
Handle pty errors by not reading from it anymore.
(main): Restore correct errno after socket_status failed. Send -tty
on -t, not -pty.
lisp/server.el (server-process-filter): Watch -tty, not -pty.
Use make-frame-on-tty instead of make-terminal-frame.
Don't set newframe to t if make-frame-on-tty failed.
Don't delete frames here. Print correct message when there are no
files to edit, but a new frame was requested.
(server-sentinel): Delete the frame after the process.
(server-handle-delete-frame): New function for delete-frame-functions.
(server-start): Add server-handle-delete-frame to delete-frame-functions.
(server-buffer-done): Don't delete frames here.
src/alloc.c (mark_ttys): Add prototype.
(Fgarbage_collect): Call mark_ttys.
src/emacs.c: (shut_down_emacs): Don't flush stdout before
reset_sys_modes().
src/process.c (add_keyboard_wait_descriptor_called_flag): Removed.
(add_keyboard_wait_descriptor): Removed stdin hack.
src/sysdep.c: Unconditionally include sysselect.h.
(old_fcntl_flags): Changed to an array.
(init_sigio, reset_sigio): Use it.
(narrow_foreground_group, widen_foreground_group): Use setpgid, not
setpgrp.
(old_fcntl_owner): Changed to an array.
(init_sys_modes, reset_sys_modes): Use it. Fix fsync() and reset_sigio() calls.
src/term.c (Qframe_tty_name, Qframe_tty_type): New variables.
(syms_of_term): Initialize them.
(Fframe_tty_name, Fframe_tty_type): New functions.
(term_init): Call add_keyboard_wait_descriptor().
(Fdelete_tty): New function.
(delete_tty): Call delete_keyboard_wait_descriptor().
(get_current_tty): Removed.
(mark_ttys): New function.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-28
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Wed, 31 Dec 2003 05:09:29 +0000 |
parents | 695cf19ef79e |
children | e8824c4f5f7e 375f2633d815 |
rev | line source |
---|---|
25858 | 1 /* $XConsortium: XDelAssoc.c,v 10.19 91/01/06 12:06:39 rws Exp $ */ |
2 /* Copyright Massachusetts Institute of Technology 1985 */ | |
3 | |
4 /* | |
5 Permission to use, copy, modify, distribute, and sell this software and its | |
6 documentation for any purpose is hereby granted without fee, provided that | |
7 the above copyright notice appear in all copies and that both that | |
8 copyright notice and this permission notice appear in supporting | |
9 documentation, and that the name of M.I.T. not be used in advertising or | |
10 publicity pertaining to distribution of the software without specific, | |
11 written prior permission. M.I.T. makes no representations about the | |
12 suitability of this software for any purpose. It is provided "as is" | |
13 without express or implied warranty. | |
14 */ | |
15 | |
16 #include <X11/Xlib.h> | |
17 #include "X10.h" | |
18 void emacs_remque(); | |
19 struct qelem { | |
20 struct qelem *q_forw; | |
21 struct qelem *q_back; | |
22 char q_data[1]; | |
23 }; | |
24 | |
25 /* | |
26 * XDeleteAssoc - Delete an association in an XAssocTable keyed on | |
27 * an XId. An association may be removed only once. Redundant | |
28 * deletes are meaningless (but cause no problems). | |
29 */ | |
30 XDeleteAssoc(dpy, table, x_id) | |
31 register Display *dpy; | |
32 register XAssocTable *table; | |
33 register XID x_id; | |
34 { | |
35 int hash; | |
36 register XAssoc *bucket; | |
37 register XAssoc *Entry; | |
38 | |
39 /* Hash the XId to get the bucket number. */ | |
40 hash = x_id & (table->size - 1); | |
41 /* Look up the bucket to get the entries in that bucket. */ | |
42 bucket = &table->buckets[hash]; | |
43 /* Get the first entry in the bucket. */ | |
44 Entry = bucket->next; | |
45 | |
46 /* Scan through the entries in the bucket for the right XId. */ | |
47 for (; Entry != bucket; Entry = Entry->next) { | |
48 if (Entry->x_id == x_id) { | |
49 /* We have the right XId. */ | |
50 if (Entry->display == dpy) { | |
51 /* We have the right display. */ | |
52 /* We have the right entry! */ | |
53 /* Remove it from the queue and */ | |
54 /* free the entry. */ | |
55 emacs_remque((struct qelem *)Entry); | |
56 free((char *)Entry); | |
57 return; | |
58 } | |
59 /* Oops, identical XId's on different displays! */ | |
60 continue; | |
61 } | |
62 if (Entry->x_id > x_id) { | |
63 /* We have gone past where it should be. */ | |
64 /* It is apparently not in the table. */ | |
65 return; | |
66 } | |
67 } | |
68 /* It is apparently not in the table. */ | |
69 return; | |
70 } | |
71 | |
52401 | 72 /* arch-tag: 90981a7e-601c-487a-b364-cdf55d6c475b |
73 (do not change this comment) */ |