]>
Commit | Line | Data |
---|---|---|
538d56bb JB |
1 | /* Reverse order of definitions obtained from bytecode definition file. |
2 | Copyright (C) 1993 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GNU CC. | |
5 | ||
6 | GNU CC is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2, or (at your option) | |
9 | any later version. | |
10 | ||
11 | GNU CC is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GNU CC; see the file COPYING. If not, write to | |
18 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | ||
20 | ||
406b2050 | 21 | #include "hconfig.h" |
538d56bb JB |
22 | #include "bi-defs.h" |
23 | ||
538d56bb JB |
24 | void |
25 | reverse() | |
26 | { | |
27 | struct def *dp, *d, *dn; | |
28 | struct variation *vp, *v, *vn; | |
29 | ||
30 | dp = defs; | |
31 | if (dp) | |
32 | { | |
33 | vp = dp->variations; | |
34 | if (vp) | |
35 | { | |
d5cbc4a3 | 36 | for (v = vp->next, vp->next = 0; v; vp = v, v = vn) |
538d56bb JB |
37 | { |
38 | vn = v->next; | |
39 | v->next = vp; | |
40 | } | |
41 | dp->variations = vp; | |
42 | } | |
d5cbc4a3 | 43 | for (d = dp->next, dp->next = 0; d; dp = d, d = dn) |
538d56bb JB |
44 | { |
45 | vp = d->variations; | |
46 | if (vp) | |
47 | { | |
d5cbc4a3 | 48 | for (v = vp->next, vp->next = 0; v; vp = v, v = vn) |
538d56bb JB |
49 | { |
50 | vn = v->next; | |
51 | v->next = vp; | |
52 | } | |
53 | d->variations = vp; | |
54 | } | |
55 | dn = d->next; | |
56 | d->next = dp; | |
57 | } | |
58 | defs = dp; | |
59 | } | |
60 | } |