~ubuntu-branches/ubuntu/maverick/vlock/maverick

« back to all changes in this revision

Viewing changes to src/tsort.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2008-06-17 17:13:25 UTC
  • mfrom: (1.1.2 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080617171325-ic8yy6tol0165i96
Tags: 2.2.2-3
* Don't try to chgrp to "vlock" during build time (Closes: #486665)
* Bump standards version (No changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* tsort.h -- header file for topological sort for vlock,
 
2
 *            the VT locking program for linux
 
3
 *
 
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
 
10
 * the author.
 
11
 *
 
12
 */
 
13
 
 
14
#include <stdbool.h>
 
15
 
 
16
/* An edge of the graph, specifying that predecessor must come before
 
17
 * successor. */
 
18
struct edge {
 
19
  void *predecessor;
 
20
  void *successor;
 
21
};
 
22
 
 
23
struct list;
 
24
 
 
25
/* For the given directed graph, generate a topological sort of the nodes.
 
26
 *
 
27
 * Sorts the list and deletes all edges.  If there are circles found in the
 
28
 * graph or there are edges that have no corresponding nodes the erroneous
 
29
 * edges are left. */
 
30
struct list *tsort(struct list *nodes, struct list *edges);