home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / XDME / include / AVL.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-27  |  1.8 KB  |  73 lines

  1.  
  2. /******************************************************************************
  3.  
  4.     MODULE
  5.     AVL.c
  6.  
  7.     DESCRIPTION
  8.     Header file for AVL-trees
  9.  
  10.     HISTORY
  11.     05-07-93 b_noll created
  12.     $Date: $ last update
  13.  
  14. ******************************************************************************/
  15.  
  16. #ifndef AVL_H
  17. #define AVL_H
  18.  
  19. /**************************************
  20.         Includes
  21. **************************************/
  22.  
  23. /* for BYTE, UBYTE */
  24. #ifndef   EXEC_TYPES_H
  25. #include <exec/types.h>
  26. #endif /* EXEC_TYPES_H */
  27.  
  28. /**************************************
  29.         Global Variables
  30. **************************************/
  31.  
  32. /* none */
  33.  
  34. /**************************************
  35.         Defines & Structures
  36. **************************************/
  37.  
  38. struct TreeNode {              /* that struct should exactly fit into a Node */
  39.     struct TreeNode * tn_Left;
  40.     struct TreeNode * tn_Right;
  41.     UBYTE          tn_Type;
  42.       BYTE        tn_Balance; /* !PRIVATE! for AVL - do not use it! */
  43.     char        * tn_Name;
  44. }; /* struct TreeNode */
  45.  
  46. #define AVL_SCAN_PRAEFIX  0
  47. #define AVL_SCAN_INFIX      1
  48. #define AVL_SCAN_POSTFIX -1
  49.  
  50.  
  51. /**************************************
  52.         Macros
  53. **************************************/
  54.  
  55. /* none */
  56.  
  57. /**************************************
  58.         Prototypes
  59. **************************************/
  60.  
  61. struct TreeNode* AVL_Find     (struct TreeNode** tree, const char* name);
  62. struct TreeNode* AVL_Append   (struct TreeNode** tree, struct TreeNode* obj);
  63. struct TreeNode* AVL_Remove   (struct TreeNode** tree, struct TreeNode* obj);
  64. void         AVL_FreeTree (struct TreeNode** tree, void (*freefunc)(APTR));
  65. void         AVL_ScanTree (struct TreeNode** tree, void (*scanfunc)(APTR), char mode);
  66.  
  67. #endif /* AVL_H */
  68.  
  69. /******************************************************************************
  70. *****  END AVL.c
  71. ******************************************************************************/
  72.  
  73.