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

« back to all changes in this revision

Viewing changes to dotneato/twopi.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
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.
 
9
*/
 
10
#pragma prototyped
 
11
 
 
12
/*
 
13
 * Written by Emden R. Gansner
 
14
 * Derived from Graham Wills' algorithm described in GD'97.
 
15
 */
 
16
 
 
17
#include    "circle.h"
 
18
#ifdef HAVE_CONFIG_H
 
19
#include "gvconfig.h"
 
20
#endif
 
21
#include        <time.h>
 
22
#ifndef MSWIN32
 
23
#include        <unistd.h>
 
24
#endif
 
25
 
 
26
#ifdef DMALLOC
 
27
#include "dmalloc.h"
 
28
#endif
 
29
 
 
30
char *Info[] = {
 
31
    "twopi",            /* Program */
 
32
    VERSION,            /* Version */
 
33
    DATE                /* Build Date */
 
34
};
 
35
 
 
36
static graph_t *G;
 
37
 
 
38
#ifndef MSWIN32
 
39
static void intr(int s)
 
40
{
 
41
                if (G) dotneato_write(G);
 
42
                        dotneato_terminate();
 
43
                                exit(1);
 
44
}
 
45
#endif
 
46
 
 
47
int main (int argc, char** argv)
 
48
{
 
49
  static graph_t* prev;
 
50
 
 
51
  dotneato_initialize (argc, argv);
 
52
#ifndef MSWIN32
 
53
        signal (SIGUSR1, toggle);
 
54
        signal (SIGINT, intr);
 
55
#endif
 
56
 
 
57
  while ((G = next_input_graph())) {
 
58
    if (prev) twopi_cleanup(prev);
 
59
    prev = G;
 
60
    twopi_layout(G);
 
61
    dotneato_write(G);
 
62
  }
 
63
  dotneato_terminate();
 
64
  return 1;
 
65
}