~ubuntu-branches/ubuntu/lucid/dpkg/lucid

« back to all changes in this revision

Viewing changes to lib/dlist.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2009-09-18 13:39:36 UTC
  • mfrom: (1.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20090918133936-dj8kjtc2qz3yqj7i
Tags: 1.15.4ubuntu1
* Resynchronise with Debian (LP: #427854). Remaining changes:
  Ubuntu-specific adjustments (probably):
  - Use i686 for lpia in cputable and triplettable.
  - Hack Dpkg::Arch to return i686 for lpia.
  - Move various Conflicts to Breaks, since upgrades from stable Ubuntu
    releases support Breaks.

  Miscellaneous bug fixes:
  - Avoid duplicate attempts to [f]close in obscure error situations which
    might conceiveably close wrong fds.
  - Revert change to stop outputting a newline after a postinst is run
    (Debian #392317).
  - Use the two-arg form of open in Dpkg::Control so that "-" can be
    passed to parse stdin as a control file (Debian #465340).

  Launchpad integration:
  - Add Launchpad-Bugs-Fixed handling in a few more places.

  Build options:
  - Point to https://wiki.ubuntu.com/DistCompilerFlags from
    dpkg-buildpackage(1).
  - Set default LDFLAGS to -Wl,-Bsymbolic-functions. (We've already taken
    this hit in Ubuntu.)
  - Implement handling of hardening-wrapper options via DEB_BUILD_OPTIONS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * dlist.h - macros for handling doubly linked lists
3
 
 *
4
 
 * Copyright © 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2, or (at your option)
9
 
 * any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software Foundation,
18
 
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
 
 */
20
 
 
21
 
#ifndef ADNS_DLIST_H_INCLUDED
22
 
#define ADNS_DLIST_H_INCLUDED
23
 
 
24
 
#define LIST_INIT(list) ((list).head = (list).tail = NULL)
25
 
#define LINK_INIT(link) ((link).next = (link).back = NULL)
26
 
 
27
 
#define LIST_UNLINK_PART(list, node, part)                              \
28
 
  do {                                                                  \
29
 
    if ((node)->part back) \
30
 
      (node)->part back->part next = (node)->part next; \
31
 
    else \
32
 
      (list).head = (node)->part next; \
33
 
    if ((node)->part next) \
34
 
      (node)->part next->part back = (node)->part back; \
35
 
    else \
36
 
      (list).tail = (node)->part back; \
37
 
  } while (0)
38
 
 
39
 
#define LIST_LINK_TAIL_PART(list, node, part)           \
40
 
  do {                                                  \
41
 
    (node)->part next = NULL;                           \
42
 
    (node)->part back = (list).tail;                    \
43
 
    if ((list).tail) \
44
 
      (list).tail->part next = (node);  \
45
 
    else (list).head = (node);                          \
46
 
      (list).tail = (node);                             \
47
 
  } while (0)
48
 
 
49
 
 
50
 
#define LIST_CHECKNODE_PART(list, node, part)                           \
51
 
  do {                                                                  \
52
 
    if ((node)->next) \
53
 
      assert((node)->part next->part back == (node));   \
54
 
    else \
55
 
      assert((node) == (list).tail);                                    \
56
 
    if ((node)->back) \
57
 
      assert((node)->part back->part next == (node));   \
58
 
    else \
59
 
      assert((node) == (list).head);                                    \
60
 
  } while (0)
61
 
 
62
 
#define LIST_UNLINK(list, node) LIST_UNLINK_PART(list, node,)
63
 
#define LIST_LINK_TAIL(list, node) LIST_LINK_TAIL_PART(list, node,)
64
 
#define LIST_CHECKNODE(list, node) LIST_CHECKNODE_PART(list, node,)
65
 
 
66
 
#endif