[go: up one dir, main page]

Menu

[e14449]: / shared / tree.h  Maximize  Restore  History

Download this file

41 lines (32 with data), 851 Bytes

 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
/*
* 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