~ubuntu-branches/ubuntu/lucid/graphviz/lucid-security

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
    This software may only be used by you under license from AT&T Corp.
    ("AT&T").  A copy of AT&T's Source Code Agreement is available at
    AT&T's Internet website having the URL:
    <http://www.research.att.com/sw/tools/graphviz/license/source.html>
    If you received this software without first entering into a license
    with AT&T, you have an infringing copy of this software and cannot use
    it without violating AT&T's intellectual property rights.
*/

#include <assert.h>
#include <signal.h>
#include <stdio.h>
#include "agraph.h"

#ifdef DMALLOC
#include "dmalloc.h"
#endif

#define NILgraph			NIL(Agraph_t*)
#define NILnode				NIL(Agnode_t*)
#define NILedge				NIL(Agedge_t*)
#define NILsym				NIL(Agsym_t*)
#define NILstr				NIL(char*)

main()
{
	Agraph_t 	*g;
	Agnode_t	*n;
	Agedge_t	*e;

signal(SIGINT,exit);
	while (g = agread(stdin,NIL(Agdisc_t*))) {
		agsubg(g,"bla",TRUE);
#ifdef NOTDEF
		agconcat(g,stdin,NIL(Agdisc_t*));
		/*while (n = agfstnode(g)) agdelete(g,n);*/
		for (n = agfstnode(g); n; n = agnxtnode(n))
			for (e = agfstout(n); e; e = agnxtout(e)) {
				fprintf(stderr,"%d %d\n",AGID(agtail(e)),AGID(aghead(e)));
			}
#endif
		/*agwrite(g,stdout);*/
		fprintf(stderr,"nodes %d edges %d\n",agnnodes(g), agnedges(g));
	}
}