~ubuntu-branches/ubuntu/lucid/graphviz/lucid-updates

« back to all changes in this revision

Viewing changes to cmd/gvpr/lib/delmulti.g

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2008-06-19 20:23:23 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080619202323-ls23h96ntj9ny94m
Tags: 2.18-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Build depend on liblualib50-dev instead of liblua5.1-0-dev.
  - Drop libttf-dev (libttf-dev is in universe) (LP: #174749).
  - Replace gs-common with ghostscript.
  - Build-depend on python-dev instead of python2.4-dev or python2.5-dev.
  - Mention the correct python version for the python bindings in the
    package description.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* create a copy of the input graph with no multiedges */
 
2
BEG_G { 
 
3
  graph_t g = graph ("merge", "S");
 
4
 
5
E {
 
6
  int wt;
 
7
  node_t h = node(g,$.head.name);
 
8
  node_t t = node(g,$.tail.name);
 
9
  edge_t e = isEdge(t,h,"");
 
10
  wt = $.weight;
 
11
  if (wt <= 0) wt = 1;
 
12
  if (e) {
 
13
    e.weight = e.weight + wt;
 
14
  }
 
15
  else if (h != t) {
 
16
    e = edge(t,h,"");
 
17
    e.weight = wt;
 
18
  }
 
19
}
 
20
END_G { 
 
21
  fwriteG(g,1);
 
22
}