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

« back to all changes in this revision

Viewing changes to dotneato/dot.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 Stephen North and Eleftherios Koutsofios.
 
14
 */
 
15
 
 
16
#include        "dot.h"
 
17
#ifdef HAVE_CONFIG_H
 
18
#include "gvconfig.h"
 
19
#endif
 
20
#include        <time.h>
 
21
#ifndef MSWIN32
 
22
#include        <unistd.h>
 
23
#endif
 
24
 
 
25
#ifdef DMALLOC
 
26
#include "dmalloc.h"
 
27
#endif
 
28
 
 
29
char *Info[] = {
 
30
    "dot",              /* Program */
 
31
    VERSION,            /* Version */
 
32
    DATE                /* Build Date */
 
33
};
 
34
 
 
35
static graph_t *G;
 
36
 
 
37
#ifndef MSWIN32
 
38
static void intr(int s)
 
39
{
 
40
        if (G) dotneato_write(G);
 
41
        dotneato_terminate();
 
42
        exit(1);
 
43
}
 
44
#endif
 
45
 
 
46
int main(int argc, char** argv)
 
47
{
 
48
        static graph_t *prev;
 
49
 
 
50
        dotneato_initialize(argc,argv);
 
51
#ifndef MSWIN32
 
52
        signal (SIGUSR1, toggle);
 
53
        signal (SIGINT, intr);
 
54
#endif
 
55
 
 
56
        while ((G = next_input_graph())) {
 
57
                if (prev) dot_cleanup(prev);
 
58
                prev = G;
 
59
                dot_layout(G);
 
60
                dotneato_write(G);
 
61
        }
 
62
        dotneato_terminate();
 
63
        return 1;
 
64
}