typedef void((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry))
One constraint set relative to the node that owns it.
dt_digraph_node_t * previous
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.
void(* dt_node_user_data_destroy_t)(void *data)
Optional destructor for node payloads.
int flatten_nodes(GList *input_nodes, GList **out_nodes)
Canonicalize / merge duplicated nodes by id.
dt_digraph_node_t * dt_digraph_node_new(const char *id)
Allocate and initialize a new digraph node with the given id.
int topological_sort(GList *nodes, GList **sorted, GList **cycle_out)
Perform a topological sort using depth-first search (DFS).