blob: 57c70f832519243bb938440242b793797f3ea833 [file] [log] [blame]
Daniel Lezcanoc193b602011-06-08 23:30:00 +02001/*******************************************************************************
2 * Copyright (C) 2010, Linaro Limited.
3 *
4 * This file is part of PowerDebug.
5 *
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 * Author:
12 * Daniel Lezcano <daniel.lezcano@linaro.org>
13 *
14 *******************************************************************************/
15
16/*
17 * Structure describing a node of the clock tree
18 *
19 * tail : points to the last element in the list
20 * next : points to the next element in the list
21 * child : points to the child node
22 * parent : points to the parent node
23 * depth : the recursive level of the node
24 * path : absolute pathname of the directory
25 * name : basename of the directory
26 */
27struct tree {
28 struct tree *tail;
29 struct tree *next;
30 struct tree *prev;
31 struct tree *child;
32 struct tree *parent;
33 char *path;
34 char *name;
35 void *private;
36 unsigned char depth;
37};
38
39typedef int (*tree_cb_t)(struct tree *t, void *data);
40
41typedef int (*tree_filter_t)(const char *name);
42
43extern struct tree *tree_load(const char *path, tree_filter_t filter);
44
45extern int tree_for_each(struct tree *tree, tree_cb_t cb, void *data);