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

« back to all changes in this revision

Viewing changes to agutil/dynattr.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 <agraph.h>
 
2
#include <agutil.h>
 
3
 
 
4
double  ag_scan_float(void *obj, char *name, double low,
 
5
        double high, double defval)
 
6
{
 
7
        char    *s;
 
8
        double  rv;
 
9
 
 
10
        s = agget(obj,name);
 
11
        if (s[0]) {
 
12
                rv = atof(s);
 
13
                if ((rv < low) || (rv > high)) rv = defval;
 
14
        } 
 
15
        else rv = defval;
 
16
        return rv;
 
17
}
 
18
 
 
19
int     ag_scan_int(void *obj, char *name, int low, int high, int defval)
 
20
{
 
21
        char    *s;
 
22
        int             rv;
 
23
 
 
24
        s = agget(obj,name);
 
25
        if (s[0]) {
 
26
                rv = atoi(s);
 
27
                if ((rv < low) || (rv > high)) rv = defval;
 
28
        } 
 
29
        else rv = defval;
 
30
        return rv;
 
31
}
 
32
 
 
33
#ifdef NOTDEF
 
34
double  ag_scan_str(void *obj, char *name, char *defval)
 
35
{
 
36
        Agsym_t         *attr;
 
37
        attr = agattr(obj,name);
 
38
        if (attr) return agxget(obj,attr->id);
 
39
        else return defval;
 
40
}
 
41
#endif