~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to openbsd-compat/sys-tree.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*      $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $    */
 
1
/*      $OpenBSD: tree.h,v 1.10 2007/10/29 23:49:41 djm Exp $   */
2
2
/*
3
3
 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4
4
 * All rights reserved.
289
289
             (x) != NULL;                                               \
290
290
             (x) = SPLAY_NEXT(name, head, x))
291
291
 
292
 
/* Macros that define a red-back tree */
 
292
/* Macros that define a red-black tree */
293
293
#define RB_HEAD(name, type)                                             \
294
294
struct name {                                                           \
295
295
        struct type *rbh_root; /* root of the tree */                   \
381
381
struct type *name##_RB_REMOVE(struct name *, struct type *);            \
382
382
struct type *name##_RB_INSERT(struct name *, struct type *);            \
383
383
struct type *name##_RB_FIND(struct name *, struct type *);              \
384
 
struct type *name##_RB_NEXT(struct name *, struct type *);              \
385
 
struct type *name##_RB_MINMAX(struct name *, int);                      \
386
 
                                                                        \
 
384
struct type *name##_RB_NEXT(struct type *);                             \
 
385
struct type *name##_RB_MINMAX(struct name *, int);                      
 
386
 
387
387
 
388
388
/* Main rb operation.
389
389
 * Moves node close to the key of elm to top
626
626
}                                                                       \
627
627
                                                                        \
628
628
struct type *                                                           \
629
 
name##_RB_NEXT(struct name *head, struct type *elm)                     \
 
629
name##_RB_NEXT(struct type *elm)                                        \
630
630
{                                                                       \
631
631
        if (RB_RIGHT(elm, field)) {                                     \
632
632
                elm = RB_RIGHT(elm, field);                             \
667
667
#define RB_INSERT(name, x, y)   name##_RB_INSERT(x, y)
668
668
#define RB_REMOVE(name, x, y)   name##_RB_REMOVE(x, y)
669
669
#define RB_FIND(name, x, y)     name##_RB_FIND(x, y)
670
 
#define RB_NEXT(name, x, y)     name##_RB_NEXT(x, y)
 
670
#define RB_NEXT(name, x, y)     name##_RB_NEXT(y)
671
671
#define RB_MIN(name, x)         name##_RB_MINMAX(x, RB_NEGINF)
672
672
#define RB_MAX(name, x)         name##_RB_MINMAX(x, RB_INF)
673
673
 
674
674
#define RB_FOREACH(x, name, head)                                       \
675
675
        for ((x) = RB_MIN(name, head);                                  \
676
676
             (x) != NULL;                                               \
677
 
             (x) = name##_RB_NEXT(head, x))
 
677
             (x) = name##_RB_NEXT(x))
678
678
 
679
679
#endif  /* _SYS_TREE_H_ */