1 /* tsort.h -- header file for topological sort for vlock,
2 * the VT locking program for linux
4 * This program is copyright (C) 2007 Frank Benkstein, and is free
5 * software which is freely distributable under the terms of the
6 * GNU General Public License version 2, included as the file COPYING in this
7 * distribution. It is NOT public domain software, and any
8 * redistribution not permitted by the GNU General Public License is
9 * expressly forbidden without prior written permission from
17 /* An edge of the graph, specifying that predecessor must come before
25 static inline struct edge
*make_edge(void *p
, void *s
)
27 struct edge
*e
= g_malloc(sizeof *e
);
35 /* For the given directed graph, generate a topological sort of the nodes.
37 * Sorts the list and deletes all edges. If there are circles found in the
38 * graph or there are edges that have no corresponding nodes NULL is returned
39 * and the erroneous edges are left. */
40 /* XXX: sort the list in place and return a boolean for success */
41 GList
*tsort(GList
*nodes
, GList
**edges
);