Debian Codegraph @

cmd/gvpr/lib/chkclusters

raw
1 /* Report if graph has non-hierarchical clusters */
2 BEGIN {
3 graph_t c[node_t];
4 node_t n;
5
6 void proc (graph_t h, graph_t p, graph_t g)
7 {
8 if (h.name == "cluster*") {
9 for (n = fstnode(h); n; n = nxtnode_sg(h,n)) {
10 g = c[n];
11 if (g) {
12 if (g != p) {
13 printf(2,"node %s in %s and %s\n", n.name, h.name, g.name);
14 exit(1);
15 }
16 }
17 c[n] = h;
18 }
19 p = h;
20 }
21 for (g = fstsubg(h); g; g = nxtsubg(g)) {
22 proc(g,p,NULL);
23 }
24 }
25 }
26 BEG_G {
27 proc($,$,NULL);
28 }