2
This software may only be used by you under license from AT&T Corp.
3
("AT&T"). A copy of AT&T's Source Code Agreement is available at
4
AT&T's Internet website having the URL:
5
<http://www.research.att.com/sw/tools/graphviz/license/source.html>
6
If you received this software without first entering into a license
7
with AT&T, you have an infringing copy of this software and cannot use
8
it without violating AT&T's intellectual property rights.
19
static void prstats(Agraph_t *g, int verbose);
20
static void do_it(Agraph_t *g, int dostat);
23
static void my_ins(Agobj_t *obj, void *context)
27
if (AGTYPE(obj) == AGNODE) {
29
fprintf(stderr,"%s initialized with label %s\n", agnameof(n), agget(n,"label") );
33
static Agcbdisc_t mydisc = { {0,0,0}, {my_ins,0,0}, {0,0,0} };
35
main(int argc, char **argv)
40
if (argc > 1) dostat = atoi(argv[1]);
43
prev = agopen("some_name",Agdirected, NIL(Agdisc_t*));
44
agcallbacks(prev,FALSE);
45
agpushdisc(prev,&mydisc,NIL(void*));
46
while (g = agconcat(prev,stdin,NIL(Agdisc_t*))) {
49
/*agwrite(prev,stdout);*/
50
fprintf(stderr,"ready to go, computer fans\n");
51
agcallbacks(prev,TRUE);
56
static void prstats(Agraph_t *g, int verbose)
60
vmstat(g->cmn->heap,&ss);
63
fprintf(stderr,"n_busy %d n_free %d s_busy %d s_free %d m_busy %d m_free %d n_seg %d extent %d\n",
64
s->n_busy, s->n_free, s->s_busy, s->s_free, s->m_busy, s->m_free,
67
fprintf(stderr,"%d (%d,%d)\n",s->extent,s->s_busy,s->s_free);
71
static void do_it(Agraph_t *g,int dostat)
73
if (dostat) agflatten(g,TRUE);
75
if (dostat) prstats(g,dostat > 1);