Commit | Line | Data |
---|---|---|
42d6e430 BJ |
1 | #include <stdio.h> |
2 | #include "def.h" | |
3 | #include "1.incl.h" | |
4 | ||
5 | makenode(type,addimp,addcom, labe,arcnum,arctype,arclab) | |
6 | LOGICAL addimp,addcom; | |
7 | int type, arctype[], arcnum; | |
8 | long arclab[], labe; | |
9 | { | |
10 | int i; | |
11 | VERT num; | |
12 | ||
13 | ASSERT(arcsper[type] < 0 || arcnum == arcsper[type], makenode); | |
14 | num = create(type,arcnum); | |
15 | ||
16 | if (addimp) fiximp(num,labe); | |
17 | ||
18 | for (i = 0; i < arcnum; ++i) | |
19 | { | |
20 | if (arctype[i] == -2) | |
21 | addref(arclab[i],&ARC(num,i)); | |
22 | else | |
23 | ARC(num,i) = arctype[i]; | |
24 | } | |
25 | ||
26 | ||
27 | if (hascom[type] ) | |
28 | { | |
29 | if (!addcom || endcom < begline) | |
30 | BEGCOM(num) = UNDEFINED; | |
31 | else | |
32 | BEGCOM(num) = begchar - rtnbeg; | |
33 | } | |
34 | return(num); | |
35 | } | |
36 | ||
37 | ||
38 | ||
39 | ||
40 | ||
41 | fiximp(num,labe) /* fix implicit links, check nesting */ | |
42 | VERT num; | |
43 | long labe; | |
44 | { | |
45 | fixvalue(implicit, num); /* set implicit links to this node */ | |
46 | clear(implicit); | |
47 | if(labe != implicit) fixvalue(labe, num); | |
48 | } |