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

« back to all changes in this revision

Viewing changes to tools/gpr/gprstate.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
#include <gprstate.h>
 
2
#include <error.h>
 
3
#include <sfstr.h>
 
4
 
 
5
int  validTVT(int c)
 
6
{
 
7
  int rv = 0;
 
8
 
 
9
  switch (c) {
 
10
  case TV_flat :
 
11
  case TV_dfs :
 
12
    rv = 1;
 
13
    break;
 
14
  }
 
15
  return rv;
 
16
}
 
17
 
 
18
void
 
19
initGPRState (Gpr_t*state, Vmalloc_t* vm, FILE* outfile)
 
20
{
 
21
  state->tgtname = vmstrdup (vm, "gpr_result");
 
22
  state->tvt = TV_flat;
 
23
  state->outFile = outfile;
 
24
}
 
25
 
 
26
Gpr_t*
 
27
openGPRState ()
 
28
{
 
29
  Gpr_t*      state;
 
30
 
 
31
  if (!(state = newof(0, Gpr_t, 1, 0)))
 
32
    error (3, "Could not create gpr state: out of memory");
 
33
 
 
34
  if (!(state->tmp = sfstropen()))
 
35
    error (3, "Could not create state");
 
36
 
 
37
  return state;
 
38
}
 
39