typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
One constraint set relative to the node that owns it.
Definition topological_sort.h:100
dt_digraph_node_t * next
Definition topological_sort.h:102
dt_digraph_node_t * previous
Definition topological_sort.h:101
Directed graph node.
Definition topological_sort.h:119
char * tag
Definition topological_sort.h:121
const char * id
Definition topological_sort.h:120
void * user_data
Definition topological_sort.h:123
GList * previous
Definition topological_sort.h:122
void dt_digraph_cleanup_full(GList *nodes, GHashTable *node_ht, dt_node_user_data_destroy_t user_destroy)
Free a canonical graph (nodes, constraints, ids) in one call.
Definition topological_sort.c:454
void(* dt_node_user_data_destroy_t)(void *data)
Optional destructor for node payloads.
Definition topological_sort.h:134
int flatten_nodes(GList *input_nodes, GList **out_nodes)
Canonicalize / merge duplicated nodes by id.
Definition topological_sort.c:52
dt_digraph_node_t * dt_digraph_node_new(const char *id)
Allocate and initialize a new digraph node with the given id.
Definition topological_sort.c:41
int topological_sort(GList *nodes, GList **sorted, GList **cycle_out)
Perform a topological sort using depth-first search (DFS).
Definition topological_sort.c:257