tree_dump.h (1770B)
1 #ifndef LASH_TREE_DUMP_H_ 2 #define LASH_TREE_DUMP_H_ 3 4 #include "tree.h" 5 6 struct lash_tree_dump_monitor { 7 lash_tree_t **tree; 8 char **name; 9 } lash_tree_dump_monitor; 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 void lash_treeDump(lash_tree_t *tree, char *comment); 15 int lash_treeDumpInit(unsigned int count); 16 int lash_treeDumpAdd(lash_tree_t *tree, char *name); 17 void lash_treeDumpFree(); 18 19 #ifdef __cplusplus 20 } 21 #endif 22 23 #endif // LASH_TREE_DUMP_H_ 24 25 /** 26 * \file lash_tree3_dump.h 27 * \brief Dump contents of `lash_tree3` objects 28 * 29 * \author Louis Holbrook 30 * \version 0.2 31 * 32 */ 33 34 /** 35 * 36 * \struct lash_tree_dump_monitor 37 * \brief Container pointing to trees elegible for dumping 38 * \var **tree Pointers to trees 39 * \var **name Name of tree to display when dumping 40 * 41 */ 42 43 /** 44 * \fn lash_treeDump(lash_tree_t *tree, char *comment) 45 * \brief Dumps content of tree in sort order to **STDOUT** 46 * 47 * \param *tree Tree to dump. 48 * \param *comment Optional text string to display in front of dump 49 * 50 * If `*tree` is specified, only this tree will be dumped. 51 * Note that trees have to be added to `lash_tree_dump_monitor` by `lash_treeDumpAdd` or they will be skipped. 52 * 53 * \todo Parametric output formatting 54 */ 55 56 /** 57 * \fn lash_treeDumpInit(unsigned int count) 58 * \brief Memory allocation 59 * 60 * \param count number of trees to allocate 61 * \return 1 if allocation failed, 0 if no error. 62 */ 63 64 /** 65 * \fn lash_treeDumpAdd(lash_tree_t *tree, char *name) 66 * \brief Add tree to the list of trees for dumping 67 * 68 * \param *tree Tree to add 69 * \param *name Name to display in front of output 70 * \return 1 if capacity is exceeded, 0 otherwise 71 * 72 */ 73 74 /** 75 * \fn lash_treeDumpFree() 76 * \brief Free memory from `lash_tree_dump_monitor` 77 * 78 * \param *tree Tree to free 79 */