~ubuntu-branches/ubuntu/natty/9base/natty

« back to all changes in this revision

Viewing changes to mk/arc.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-08-20 17:34:06 UTC
  • mfrom: (6.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090820173406-xpwqa9ruyevvc0ut
Tags: 1:3-3
* Updating maintainer field.
* Updating vcs fields.
* Updating package to standards version 3.8.3.
* Updatin variables writing in rules to consistent style.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include        "mk.h"
2
 
 
3
 
Arc *
4
 
newarc(Node *n, Rule *r, char *stem, Resub *match)
5
 
{
6
 
        Arc *a;
7
 
 
8
 
        a = (Arc *)Malloc(sizeof(Arc));
9
 
        a->n = n;
10
 
        a->r = r;
11
 
        a->stem = strdup(stem);
12
 
        rcopy(a->match, match, NREGEXP);
13
 
        a->next = 0;
14
 
        a->flag = 0;
15
 
        a->prog = r->prog;
16
 
        return(a);
17
 
}
18
 
 
19
 
void
20
 
dumpa(char *s, Arc *a)
21
 
{
22
 
        char buf[1024];
23
 
 
24
 
        Bprint(&bout, "%sArc@%p: n=%p r=%p flag=0x%x stem='%s'",
25
 
                s, a, a->n, a->r, a->flag, a->stem);
26
 
        if(a->prog)
27
 
                Bprint(&bout, " prog='%s'", a->prog);
28
 
        Bprint(&bout, "\n");
29
 
 
30
 
        if(a->n){
31
 
                snprint(buf, sizeof(buf), "%s    ", (*s == ' ')? s:"");
32
 
                dumpn(buf, a->n);
33
 
        }
34
 
}
35
 
 
36
 
void
37
 
nrep(void)
38
 
{
39
 
        Symtab *sym;
40
 
        Word *w;
41
 
 
42
 
        sym = symlook("NREP", S_VAR, 0);
43
 
        if(sym){
44
 
                w = (Word *) sym->value;
45
 
                if (w && w->s && *w->s)
46
 
                        nreps = atoi(w->s);
47
 
        }
48
 
        if(nreps < 1)
49
 
                nreps = 1;
50
 
        if(DEBUG(D_GRAPH))
51
 
                Bprint(&bout, "nreps = %d\n", nreps);
52
 
}