home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / avltree.h < prev    next >
C/C++ Source or Header  |  2001-03-08  |  2KB  |  53 lines

  1. /* -*-C-*-
  2.  
  3. $Id: avltree.h,v 1.4 2001/03/08 18:00:16 cph Exp $
  4.  
  5. Copyright (c) 1993, 1999-2001 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21.  
  22. #ifndef AVLTREE_H
  23. #define AVLTREE_H
  24.  
  25. /* This file contains external declarations for a simple
  26.    AVL tree library.
  27.    It is used by the MIT Scheme microcode to quickly map
  28.    names to indices into various tables.  */
  29.  
  30. #include "config.h"
  31.  
  32. extern CONST char * tree_error_message;
  33. extern CONST char * tree_error_noise;
  34.  
  35. typedef struct tree_node_s * tree_node;
  36.  
  37. struct tree_node_s
  38. {
  39.   int height;
  40.   tree_node left;
  41.   tree_node rite;
  42.   CONST char * name;
  43.   unsigned long value;
  44. };
  45.  
  46. extern tree_node EXFUN
  47.   (tree_build, (unsigned long, CONST char **, unsigned long));
  48. extern tree_node EXFUN (tree_lookup, (tree_node, CONST char *));
  49. extern tree_node EXFUN (tree_insert, (tree_node, CONST char *, unsigned long));
  50. extern void EXFUN (tree_free, (tree_node));
  51.  
  52. #endif /* AVLTREE_H */
  53.