home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / source / xdme_1.84_src.lha / XDME / Lib / include / hl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-06  |  3.6 KB  |  137 lines

  1. /******************************************************************************
  2.  
  3.     MODULE
  4.     HL.h
  5.  
  6.     DESCRIPTION
  7.     Header File for ``Hierarchic Lists''
  8.  
  9.     That module may be used in connection with
  10.     some XDME structures like EDs, Keytables,
  11.     and Menustrips, Refpaths, since these use HLs
  12.     themselfes ...
  13.  
  14.     HL is a Subclass of ExecNode which is itself
  15.     a Subclass of DNode. A HNode can itself
  16.     contain a couple of Subs, all DLL actions might
  17.     be performed on such a list _after_ successfully
  18.     locking it
  19.  
  20.     HISTORY
  21.     22-11-94 b_noll created
  22.  
  23. ******************************************************************************/
  24.  
  25. #ifndef HL_H
  26. #define HL_H 1
  27.  
  28. /**************************************
  29.         Includes
  30. **************************************/
  31.  
  32. #ifndef   EXEC_TYPES_H
  33. #include <exec/types.h>
  34. #endif
  35.  
  36. #ifndef   SLL_H
  37. #include "SLL.h"
  38. #endif
  39.  
  40. #ifndef   DLL_H
  41. #include "DLL.h"
  42. #endif
  43.  
  44. #ifndef   AVL_H
  45. #include "AVL.h"
  46. #endif
  47.  
  48. /**************************************
  49.         Defines & Structures
  50. **************************************/
  51.  
  52. struct HClass {
  53.     ULONG (*Dispatcher)();
  54.     ULONG       Size;
  55.     LONG       Offset;
  56.     struct HClass *Superclass;
  57. }; /* struct HClass */
  58.  
  59. struct HNode {
  60.     struct DNode   Node;
  61.     UBYTE       BlockCnt;
  62.     UBYTE       Pad1;
  63.     UBYTE      *Name;
  64.     WORD       Flags;
  65.     struct HClass *Class;
  66.     struct SList   Locks;
  67.     struct HNode  *Parent;
  68. }; /* struct HNode */
  69.  
  70. /* following structures _might_ be appended to a struct HNode - depends on Flags */
  71.  
  72. struct HLAValue {
  73.     UBYTE      *Value;
  74. }; /* struct HLAValue */
  75.  
  76. struct HLASubs {
  77.     struct DList   Subs;
  78.     UBYTE     **Array;
  79. }; /* struct HLASubs */
  80.  
  81. struct HLATree {
  82.     struct TreeNode *Subs;
  83. }; /* struct HLATree */
  84.  
  85. /* ---- Possible Returnvalues: */
  86. #define HL_OK        0      /* anything was OK in a HL_* operation */
  87. /* there are others ... 8) */
  88.  
  89. /* ---- Possible Flags: */
  90. #define HLF_SYSNODE    1
  91. #define HLF_VALUE    2
  92. #define HLF_SUBCARRIER    4
  93. #define HLF_TREE    8 /* Please note, TREE and LIST are mutually exclusive */
  94.  
  95. #define HLF_PRIVATESET 16 /* internal use ... */
  96.  
  97. /* ---- Possible Attributes: */
  98. #define HLA_Ignore    0 /* System Private use */
  99. #define HLA_Name    1 /* a node's name */
  100. #define HLA_Labels    2 /* a node's subs list */
  101. #define HLA_LabelArray    3 /* an array built from a node's subs */
  102. #define HLA_Value    4 /* a node's value */
  103.  
  104. /**************************************
  105.         Prototypes
  106. **************************************/
  107.  
  108. /* ---- Init & Uninit, if another function is allocation the full structure */
  109. ULONG          HL_Init        (struct HNode *n, const UBYTE *name, struct HNode *parent, UWORD flags);
  110. ULONG          HL_Uninit     (struct HNode *n);
  111.  
  112. /* ---- Connections between HNodes */
  113. ULONG          HL_Connect    (struct HNode *n, struct HNode *m, ULONG attr);
  114. ULONG          HL_Disconnect (struct HNode *n, struct HNode *m);
  115.  
  116. /* ---- get access to the Subnodes - MAY FAIL! */
  117. struct DList *HL_LockSubs   (struct HNode *n);
  118. ULONG          HL_UnlockSubs (struct HNode *n);
  119.  
  120. /* ---- Init/Uninit + malloc/free only if the HNode structure is big enough */
  121. ULONG          HL_Dispose    (struct HNode *n);
  122. struct HNode *HL_New        (const UBYTE *name, struct HNode *parent, UWORD flags);
  123.  
  124. /* ---- output a HL_* error code ... */
  125. void          HL_Error        (ULONG code, UBYTE **av);
  126.  
  127. /* ---- shortcuts */
  128. struct HNode *HL_SystemList (const UBYTE *name);
  129. void          HL_Scan        (struct HNode *n, void (*scan)(struct HNode *, void *, int), void *userdata);
  130. struct HNode *HL_Find        (struct HNode *n, int  (*find)(struct HNode *, void *, int), void *userdata);
  131.  
  132. #endif /* !HL_H */
  133.  
  134. /******************************************************************************
  135. *****  END HL.h
  136. ******************************************************************************/
  137.