home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / util / jade-3.0.lha / Jade / src / lists.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-16  |  1.4 KB  |  55 lines

  1. /* lists.h -- Amiga-style doubly-linked lists
  2.    Copyright (C) 1993, 1994 John Harper <jsh@ukc.ac.uk>
  3.  
  4. This file is part of Jade.
  5.  
  6. Jade is free software; you can redistribute it and/or modify it
  7. 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. Jade is distributed in the hope that it will be useful, but
  12. 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 Jade; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef _LISTS_H
  21. #define _LISTS_H
  22.  
  23. struct Node {
  24.     struct Node *ln_Succ;
  25.     struct Node *ln_Pred;
  26.     char *ln_Name;
  27.     /* Don't need the rest. */
  28. };
  29.  
  30. struct MinNode {
  31.     struct MinNode *mln_Succ;
  32.     struct MinNode *mln_Pred;
  33. };
  34.  
  35. struct List {
  36.     struct Node *lh_Head;
  37.     struct Node *lh_Tail;
  38.     struct Node *lh_TailPred;
  39. }; 
  40.  
  41. struct MinList {
  42.     struct MinNode *mlh_Head;
  43.     struct MinNode *mlh_Tail;
  44.     struct MinNode *mlh_TailPred;
  45. }; 
  46.  
  47. #define IsListEmpty(l)  (((l)->lh_TailPred) == (struct Node *)(l))
  48.  
  49. void NewList(struct List *);
  50. void AddTail(struct List *, struct Node *);
  51. void Insert(struct List *, struct Node *, struct Node *);
  52. void Remove(struct Node *);
  53.  
  54. #endif /* _LISTS_H */
  55.