Annotation of mstools/samples/rpc/dict/util0.h, revision 1.1.1.2

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.