Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / cns / parser / prsutil.c
1 /*
2 * This file is part of the Alliance CAD System
3 * Copyright (C) Laboratoire LIP6 - D\8epartement ASIM
4 * Universite Pierre et Marie Curie
5 *
6 * Home page : http://www-asim.lip6.fr/alliance/
7 * E-mail support : mailto:alliance-support@asim.lip6.fr
8 *
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Library General Public License as published
11 * by the Free Software Foundation; either version 2 of the License, or (at
12 * your option) any later version.
13 *
14 * Alliance VLSI CAD System is distributed in the hope that it will be
15 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17 * Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with the GNU C Library; see the file COPYING. If not, write to the Free
21 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 /* 05/30/95 Cone Netlist Structure functions: prsutil.c */
25
26 #include "prsall.h"
27
28 /*============================================================================*
29 | function idx2br(); |
30 *============================================================================*/
31 branch_list *
32 idx2br(ptbrstruc, index)
33 sbrstruc *ptbrstruc;
34 long index;
35
36 {
37 branch_list *ptbranch = NULL;
38 ptype_list *ptptype;
39
40 if (CNS_TRACE_MODE >= CNS_TRACE)
41 (void) printf("TRA_cns idx2br\n");
42
43 for (ptbranch = ptbrstruc->BREXT; ptbranch != NULL; ptbranch = ptbranch->NEXT) {
44 if ((ptptype = getptype(ptbranch->USER, CNS_INDEX)) != NULL) {
45 if (((long ) ptptype->DATA) == index)
46 return (ptbranch);
47 }
48 }
49 for (ptbranch = ptbrstruc->BRVDD; ptbranch != NULL; ptbranch = ptbranch->NEXT) {
50 if ((ptptype = getptype(ptbranch->USER, CNS_INDEX)) != NULL) {
51 if (((long ) ptptype->DATA) == index)
52 return (ptbranch);
53 }
54 }
55 for (ptbranch = ptbrstruc->BRGND; ptbranch != NULL; ptbranch = ptbranch->NEXT) {
56 if ((ptptype = getptype(ptbranch->USER, CNS_INDEX)) != NULL) {
57 if (((long ) ptptype->DATA) == index)
58 return (ptbranch);
59 }
60 }
61 for (ptbranch = ptbrstruc->BRVSS; ptbranch != NULL; ptbranch = ptbranch->NEXT) {
62 if ((ptptype = getptype(ptbranch->USER, CNS_INDEX)) != NULL) {
63 if (((long ) ptptype->DATA) == index)
64 return (ptbranch);
65 }
66 }
67
68 return (ptbranch);
69 }