1 /* 2 * glade-tsort.h: a topological sorting algorithm implementation 3 * 4 * Copyright (C) 2013 Juan Pablo Ugarte. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of the 9 * License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 * 20 * Authors: 21 * Juan Pablo Ugarte <juanpablougarte@gmail.com> 22 */ 23 24 #ifndef __GLADE_TSORT_H__ 25 #define __GLADE_TSORT_H__ 26 27 #include <glib.h> 28 29 G_BEGIN_DECLS 30 31 typedef struct __NodeEdge _NodeEdge; 32 33 struct __NodeEdge 34 { 35 gpointer predecessor; 36 gpointer successor; 37 }; 38 39 GList *_node_edge_prepend (GList *list, 40 gpointer predecessor, 41 gpointer successor); 42 43 void _node_edge_list_free (GList *list); 44 45 GList *_glade_tsort (GList **nodes, 46 GList **edges); 47 48 G_END_DECLS 49 50 #endif /* __GLADE_TSORT_H__ */ 51