/*
* tree.h
*
* Copyright (C) 2004, 2005
* Alexandre Hessemann
* alexhessemann@users.sourceforge.net
*
* Released under GNU Public License
*/
#ifndef TREE_H
#define TREE_H
#include <stdio.h>
typedef struct TREE {
int group;
char * name;
/* int status;*/
struct TREE * father;
struct TREE * son;
struct TREE * sibling;
} Tree;
Tree * inittree ();
Tree * adddir (Tree * father, int group, const char * name);
void deltree (Tree *);
Tree * findssrep (Tree * start , int group, unsigned int min, unsigned int max);
int mvsubtree (Tree * src, Tree * dst);
int printtree (FILE *, const Tree *);
void changegroup (Tree * tree, int group);
void changename (Tree * tree, const char * name);
/* Returns the depth of a node in the tree
* Note that a root's depth is 1, because 0 is the 'super-root' */
int getdepth (Tree *);
#endif