home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / rpc / dict / util0.h < prev   
Encoding:
C/C++ Source or Header  |  1996-06-12  |  3.1 KB  |  127 lines

  1. /*************************************************************/
  2. /**                                                         **/
  3. /**                 Microsoft RPC Examples                  **/
  4. /**                 Dictionary Application                  **/
  5. /**             Copyright(c) Microsoft Corp. 1992-1996      **/
  6. /**                                                         **/
  7. /*************************************************************/
  8.  
  9. #include <rpc.h>
  10.  
  11. /*************************************************************************/
  12. /***                RecordNode / RecordTree free routines              ***/
  13. /*************************************************************************/
  14.  
  15. void
  16. RecordTreeNodeFree(
  17.     IN RecordTreeNode * node
  18.     );
  19.  
  20. void
  21. RecordTreeFree(
  22.     IN RecordTreeNode * node
  23.     );
  24.  
  25. VDict_Status
  26. RDict_Free_Dict(
  27.     IN OUT RDict * r_dict
  28.     );
  29.  
  30. void
  31. VDict_Print(
  32.     VDict * pvd,
  33.     int indent
  34.     );
  35.  
  36. /*************************************************************************/
  37. /***                  State Allocate / Free routines                   ***/
  38. /*************************************************************************/
  39.  
  40. DictState * allocate_state(void);
  41.  
  42. void free_state(DictState * state);
  43.  
  44. /*************************************************************************/
  45. /***                     Rdict Duplicate utilities                     ***/
  46. /*************************************************************************/
  47.  
  48. RDict *
  49. RDict_Duplicate(
  50.     IN RDict * src
  51.     );
  52.  
  53. DictState *
  54. DictState_Duplicate(
  55.     IN DictState * src
  56.     );
  57.  
  58. TreeNode *
  59. TreeNode_Duplicate(
  60.     IN TreeNode * src
  61.     );
  62.  
  63. TreeNode *
  64. Tree_Duplicate(
  65.     IN TreeNode * src
  66.     );
  67.  
  68. /*************************************************************************/
  69. /***                MIDL_user_allocate / MIDL_user_free                ***/
  70. /*************************************************************************/
  71.  
  72. void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t count);
  73.  
  74. void __RPC_USER MIDL_user_free(void __RPC_FAR * p);
  75.  
  76. /*************************************************************************/
  77. /***                    Comparison and Printing routines               ***/
  78. /*************************************************************************/
  79.  
  80. Record *
  81. makeRecord(
  82.     short key,
  83.     char * name
  84.     );
  85.  
  86. void
  87. freeRecord(
  88.     Record * pr
  89.     );
  90.  
  91. Record *
  92. ItemDuplicate(
  93.     Record * item
  94.     );
  95.  
  96. void
  97. ItemCopy(
  98.     IN Record * src,
  99.     OUT Record * dest
  100.     );
  101.  
  102.  
  103. int comp(void* x, void* y);
  104.  
  105. void printRecord(void* rp);
  106.  
  107. typedef void (*PrintFun) (void *);
  108.  
  109. void prinTree(
  110.     int lmargin,
  111.     int indent,
  112.     TreeNode *np,
  113.     PrintFun print);
  114.  
  115. void
  116. Dict_Print(             /* prints the binary tree (indented right subtree,
  117.                            followed by the root, followed by the indented
  118.                            right dubtree) */
  119.     Dictionary * dp,
  120.     int indent);        /* number of spaces to indent subsequent levels */
  121.  
  122. TreeNode*
  123. makeNode(void * item);
  124.  
  125. void
  126. Init_dict(Dictionary * dp);
  127.