2008-02-15 21:57:30 -05:00
|
|
|
/*
|
|
|
|
* graph.h - helpful graph structure and setup/teardown methods
|
|
|
|
*
|
2011-04-11 17:45:43 -04:00
|
|
|
* Copyright (c) 2007-2011 Pacman Development Team <pacman-dev@archlinux.org>
|
2008-02-15 21:57:30 -05:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2011-04-11 17:45:43 -04:00
|
|
|
#ifndef _ALPM_GRAPH_H
|
|
|
|
#define _ALPM_GRAPH_H
|
2008-02-15 21:57:30 -05:00
|
|
|
|
2011-04-15 19:40:32 -04:00
|
|
|
#include "config.h" /* ensure off_t is correct length */
|
|
|
|
|
2008-06-01 22:47:31 -04:00
|
|
|
#include <sys/types.h> /* off_t */
|
|
|
|
|
2008-02-15 21:57:30 -05:00
|
|
|
#include "alpm_list.h"
|
|
|
|
|
2011-06-28 00:54:19 -04:00
|
|
|
typedef struct __alpm_graph_t {
|
2008-02-15 21:57:30 -05:00
|
|
|
char state; /* 0: untouched, -1: entered, other: leaving time */
|
2008-06-01 22:47:31 -04:00
|
|
|
off_t weight; /* weight of the node */
|
2011-04-11 17:45:43 -04:00
|
|
|
void *data;
|
2011-06-28 00:54:19 -04:00
|
|
|
struct __alpm_graph_t *parent; /* where did we come from? */
|
2008-02-15 21:57:30 -05:00
|
|
|
alpm_list_t *children;
|
|
|
|
alpm_list_t *childptr; /* points to a child in children list */
|
2011-06-28 00:54:19 -04:00
|
|
|
} alpm_graph_t;
|
2008-02-15 21:57:30 -05:00
|
|
|
|
2011-06-28 00:54:19 -04:00
|
|
|
alpm_graph_t *_alpm_graph_new(void);
|
2011-04-11 17:45:43 -04:00
|
|
|
void _alpm_graph_free(void *data);
|
2008-02-15 21:57:30 -05:00
|
|
|
|
2011-04-11 17:45:43 -04:00
|
|
|
#endif /* _ALPM_GRAPH_H */
|
2008-02-15 21:57:30 -05:00
|
|
|
|
2011-04-11 17:45:43 -04:00
|
|
|
/* vim: set ts=2 sw=2 noet: */
|