Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / inf / inf_stb.c
1 /****************************************************************************/
2 /* */
3 /* Chaine de CAO & VLSI AVERTEC */
4 /* */
5 /* Produit : AVERTEC global tools */
6 /* Fichier : inf_stb.c */
7 /* */
8 /* © copyright 2004 AVERTEC */
9 /* Tous droits reserves */
10 /* */
11 /* Auteur(s) : Antony PINTO */
12 /* */
13 /****************************************************************************/
14
15 #include MUT_H
16 #include "inf_stb.h"
17
18 /****************************************************************************/
19 /*{{{ */
20 /****************************************************************************/
21 /*{{{ inf_stb_parse_spec_alloc() */
22 /* */
23 /* */
24 /****************************************************************************/
25 inf_stb_p_s *
26 inf_stb_parse_spec_alloc(inf_stb_p_s *next)
27 {
28 inf_stb_p_s *res;
29
30 res = mbkalloc(sizeof(inf_stb_p_s));
31 res->NEXT = next;
32 res->STABILITY = NULL;
33 res->CKNAME = NULL;
34 res->CKEDGE = -1;
35 res->SPECTYPE = -1;
36 res->DATAEDGE = -1;
37 res->HZOPTION = -1;
38 return res;
39 }
40
41 /*}}}************************************************************************/
42 /*{{{ inf_stb_parse_spec_stab_alloc() */
43 /* */
44 /* */
45 /****************************************************************************/
46 inf_stb_p_s_stab *
47 inf_stb_parse_spec_stab_alloc(inf_stb_p_s_stab *next)
48 {
49 inf_stb_p_s_stab *res;
50
51 res = mbkalloc(sizeof(inf_stb_p_s_stab));
52 res->NEXT = next;
53 res->TIME_LIST = NULL;
54 res->CKNAME = NULL;
55 res->CKEDGE = -1;
56 res->RELATIVITY = -1;
57 res->DELAY = -1;
58 return res;
59 }
60
61 /*}}}************************************************************************/
62 /*{{{ inf_stb_parse_spec_free() */
63 /* */
64 /* */
65 /****************************************************************************/
66 void
67 inf_stb_parse_spec_free(inf_stb_p_s *pt)
68 {
69 while (pt)
70 pt = inf_stb_parse_spec_del(pt);
71 }
72
73 /*}}}************************************************************************/
74 /*{{{ inf_stb_parse_spec_stab_free() */
75 /* */
76 /* */
77 /****************************************************************************/
78 void
79 inf_stb_parse_spec_stab_free(inf_stb_p_s_stab *pt)
80 {
81 while (pt)
82 pt = inf_stb_parse_spec_stab_del(pt);
83 }
84
85 /*}}}************************************************************************/
86 /*{{{ inf_stb_parse_spec_del() */
87 /* */
88 /* */
89 /****************************************************************************/
90 inf_stb_p_s *
91 inf_stb_parse_spec_del(inf_stb_p_s *pt)
92 {
93 inf_stb_p_s *next;
94
95 next = pt->NEXT;
96 inf_stb_parse_spec_stab_free(pt->STABILITY);
97 mbkfree(pt);
98
99 return next;
100 }
101
102 /*}}}************************************************************************/
103 /*{{{ inf_stb_parse_spec_stab_del() */
104 /* */
105 /* */
106 /****************************************************************************/
107 inf_stb_p_s_stab *
108 inf_stb_parse_spec_stab_del(inf_stb_p_s_stab *pt)
109 {
110 inf_stb_p_s_stab *next;
111 chain_list *cl;
112 next = pt->NEXT;
113 for (cl=pt->TIME_LIST; cl!=NULL; cl=cl->NEXT) mbkfree(cl->DATA);
114 freechain(pt->TIME_LIST);
115 mbkfree(pt);
116
117 return next;
118 }
119
120 /*}}}************************************************************************/
121 /*}}}************************************************************************/
122 inf_stb_p_s * inf_stb_spec_exists(inf_stb_p_s *pt, inf_stb_p_s *list)
123 {
124 while (list!=NULL)
125 {
126 if (list->CKNAME==pt->CKNAME
127 && list->CKEDGE==pt->CKEDGE
128 && list->SPECTYPE==pt->SPECTYPE
129 && list->DATAEDGE==pt->DATAEDGE
130 && list->HZOPTION==pt->HZOPTION)
131 return list;
132 list=list->NEXT;
133 }
134
135 return NULL;
136 }