chiark / gitweb /
compute some variables for shell scripts eg the .stopping files in hostside
authorian <ian>
Fri, 18 Apr 2008 21:10:25 +0000 (21:10 +0000)
committerian <ian>
Fri, 18 Apr 2008 21:10:25 +0000 (21:10 +0000)
layout/.cvsignore
layout/Makefile
layout/redactgraph.c

index 8bf1382126d78aa6b8bed42052e8d8c834b70805..ebb5ca02eb9495ac2d232c6cf45be3a232f3f9be 100644 (file)
@@ -24,6 +24,7 @@ ours.raw.neato
 ours.redacted.neato.ps
 ours.redacted.neato
 ours.redacted.forsafety
+ours.redacted.shellvars
 ours.layout-data.c
 detectors.pin-info
 reversers.pin-info
index cfc43b0336a692249c11d47b76b4c49b3b0919fd..ce9a23c135c49ff8c0c7623a3b7e775fcaa4c1b6 100644 (file)
@@ -74,6 +74,9 @@ compose-segenco: compose-segenco.o
 %.redacted.forsafety: %.redactgraph
                ./$< $(REDACT) consistency printforforsafety $o
 
+%.redacted.shellvars: %.redactgraph
+               ./$< $(REDACT) consistency printforshellscript $o
+
 %.redacted.segjoins: %.redactgraph
                ./$< $(REDACT) consistency printforlayoutsegjoins $o
 
index 16d2305e21b42e7a8781768ea44bd1ce367e71ef..5ced177a67baee413eadd505f2d83031111f34ac 100644 (file)
@@ -725,6 +725,37 @@ static void printforforsafety(void) {
   output("end\n");
 }
 
+static void printforshellscript(void) {
+  Node *node;
+  Edge *edge;
+  EdgeEnd *edgeend;
+  int side, weight, i;
+  Segment *segment;
+  MovFeat *movfeat;
+  
+  FOR_ALL_NODES(node) {
+    FOR_EDGES(edge, node,side,edgeend) {
+      output("l");
+      segment= edge->subseg->segment;
+      output(segment->segname);
+      if (segment->n_movfeats>1) {
+       if (!segment->starfeature) {
+         fprintf(stderr,"printforforsafety before movfeatsplitedges!\n");
+         exit(8);
+       }
+       weight= 1;
+       FOR_SEGMENT_MOVFEATS(i,movfeat, segment) {
+         if (!movfeat->movfeat) continue;
+         output("%s%d", movfeat->movfeat,
+                (edge->movpos / weight) % movfeat->n_positions);
+         weight *= movfeat->n_positions;
+       }
+      }
+      output("=%d\n", (int)edge->distance);
+    }
+  }
+}
+
 static void printforlayoutsegjoins(void) {
   Node *node;
   EdgeEnd *edgeend, *edgeend2;
@@ -843,6 +874,7 @@ static const OpInfo opinfos[]= {
 #define OI(x) { #x, x },
   OI(printforneato)
   OI(printforforsafety)
+  OI(printforshellscript)
   OI(printforlayoutsegjoins)
   OI(consistency)
   OI(movfeatsplitedges)