/usr/include/yalecad/dset.h is in libycadgraywolf-dev 0.1.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | /* -----------------------------------------------------------------
FILE: dset.h
DESCRIPTION:include file for disjoint set utility functions
CONTENTS:
DATE: Apr 26, 1991
REVISIONS: Sun Dec 8 23:30:16 EST 1991 - removed indirection
from the comparison functions.
Sun Dec 15 02:44:47 EST 1991 - now store sub/superset
tree with the set itself.
----------------------------------------------------------------- */
#ifndef YDSET_H
#define YDSET_H
#ifndef lint
static char Ydset_h_SccsId[] = "@(#) dset.h version 1.6 3/28/92";
#endif
#include <yalecad/base.h>
#include <yalecad/rbtree.h>
typedef struct ydsetrec {
YTREEPTR dtree ; /* rbtree holding sets */
INT (*compare_func)() ; /* how to compare functions in rbtree */
VOID (*user_delete)() ; /* how to delete functions in rbtree */
YTREEPTR superset_tree ; /* tree to store the superset */
YTREEPTR subset_tree ; /* tree to store the subsets */
YTREEPTR parent_tree ; /* tree to store the parents */
} YDSETBOX, *YDSETPTR ;
/*---------------------------------------
Ydset_init()
NOTE that the users comparison function will be similar to
comparison function used in the rbtree package.
---------------------------------------*/
extern YDSETPTR Ydset_init( P1(INT (*compare_func)() ) ) ;
/*
Function:
Initialize the union/find routines. Returns back a set.
A set of sets is implemented. Therefore, many union find
data structures may be used at once. A comparison function
must be supplied to sort the data.
See rbtree.h for more details about comparison functions.
*/
/*---------------------------------------
Ydset_empty
Free all elements in the set but leaves the set intact
This may be used recursively.
---------------------------------------*/
extern VOID Ydset_empty( P2(YDSETPTR set,VOID (*userDelete)() ) );
/*
free all elements of a superset. Function userDelete is applied to user data.
*/
/*---------------------------------------
---------------------------------------*/
extern VOIDPTR Ydset_enumerate( P2(YDSETPTR set, BOOL startFlag));
/*
Function:
Enumerate all of the elements of the super set
*/
/*---------------------------------------
---------------------------------------*/
extern VOIDPTR Ydset_enumerate_superset( P2(YDSETPTR set, BOOL startFlag));
/*
Function:
Enumerate all of the elements of the super set
*/
extern VOIDPTR Ydset_enumerate_parents( P2(YDSETPTR dset, BOOL startFlag) ) ;
/*
Function:
Enumerate the parents of the super set
*/
/*---------------------------------------
---------------------------------------*/
extern VOIDPTR Ydset_enumerate_subset( P3 (YDSETPTR set,VOIDPTR subsetData,
BOOL startFlag));
/*
Function:
Find the set which subsetData is an element of. Enumerate all
the elements of that set.
*/
/*---------------------------------------
---------------------------------------*/
extern VOIDPTR Ydset_find( P2(YDSETPTR dset, VOIDPTR data ) ) ;
/*
Function:
Returns subset name for the given data of the given set. If
data does not exist, it is created and put in set.
*/
/*-------------------------------------------------
Ydset_find_set()
Searches for the set an item belongs to.
This routine avoids makeset of the item
which Ydset_find does by default
-------------------------------------------------*/
VOIDPTR Ydset_find_set( P2( YDSETPTR dset, VOIDPTR data ));
/*---------------------------------------
Ydset_free
Free all elements in the set and the set.
This can be used recursively.
---------------------------------------*/
extern VOID Ydset_free( P2(YDSETPTR set,VOID (*userDelete)() ) );
/*
free the entire superset. Function userDelete is applied to user data.
*/
/*---------------------------------------
---------------------------------------*/
extern VOIDPTR Ydset_union( P3(YDSETPTR set, VOIDPTR x, VOIDPTR y ) ) ;
/*
Function:
Perform union operation on two data items for the given set.
If either data item does not exist, the item is created
and put in set.
Returns the subset name.
*/
/*---------------------------------------
---------------------------------------*/
extern VOIDPTR Ydset_search( P2(YDSETPTR set,VOIDPTR data));
/*
Search for an elment in the super set
*/
/*---------------------------------------
---------------------------------------*/
INT Ydset_subset_size( P2(YDSETPTR set, VOIDPTR data));
/*
returns the size of the subset data is an element of.
*/
/*---------------------------------------
---------------------------------------*/
extern INT Ydset_superset_size(P1(YDSETPTR set));
/*
returns the size of the entire superset
*/
/*-----------------------
Ydset_verify
-----------------------*/
extern INT Ydset_verify( P1(YDSETPTR set));
/*------------------------
Ydset_dump
------------------------*/
extern Ydset_dump(P2( YDSETPTR set, VOID (*printFunc)() ) );
#endif /* YDSET_H */
|