Mercurial > emacs
annotate oldXMenu/insque.c @ 76993:55c9ef5f1559
Improve index entries.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 07 Apr 2007 01:53:53 +0000 |
parents | 3d45362f1d38 |
children | 3fd27403d9b9 95d0cdf160ea |
rev | line source |
---|---|
75059 | 1 /* Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003, |
75348 | 2 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
75059 | 3 |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program; see the file COPYING. If not, write to | |
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
17 Boston, MA 02110-1301, USA. */ | |
65000
3861ff8f4bf1
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
52401
diff
changeset
|
18 |
25858 | 19 /* This file implements the emacs_insque and emacs_remque functions, |
75059 | 20 clones of the insque and remque functions of BSD. They and all |
25858 | 21 their callers have been renamed to emacs_mumble to allow us to |
22 include this file in the menu library on all systems. */ | |
23 | |
24 | |
25 struct qelem { | |
26 struct qelem *q_forw; | |
27 struct qelem *q_back; | |
28 char q_data[1]; | |
29 }; | |
30 | |
31 /* Insert ELEM into a doubly-linked list, after PREV. */ | |
32 | |
33 void | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25858
diff
changeset
|
34 emacs_insque (elem, prev) |
25858 | 35 struct qelem *elem, *prev; |
36 { | |
37 struct qelem *next = prev->q_forw; | |
38 prev->q_forw = elem; | |
39 if (next) | |
40 next->q_back = elem; | |
41 elem->q_forw = next; | |
42 elem->q_back = prev; | |
43 } | |
44 | |
45 /* Unlink ELEM from the doubly-linked list that it is in. */ | |
46 | |
47 emacs_remque (elem) | |
48 struct qelem *elem; | |
49 { | |
50 struct qelem *next = elem->q_forw; | |
51 struct qelem *prev = elem->q_back; | |
52 if (next) | |
53 next->q_back = prev; | |
54 if (prev) | |
55 prev->q_forw = next; | |
56 } | |
52401 | 57 |
58 /* arch-tag: a8719d1a-5c3f-4bce-b36b-173106d36165 | |
59 (do not change this comment) */ |