Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / beh / beh / beh_frebefig.c
1
2 /* ###--------------------------------------------------------------### */
3 /* */
4 /* file : beh_frebefig.c */
5 /* date : Sep 3 1993 */
6 /* version : v106 */
7 /* authors : Pirouz BAZARGAN SABET */
8 /* content : low-level function */
9 /* */
10 /* ###--------------------------------------------------------------### */
11
12 #include <stdio.h>
13 #include MUT_H
14 #include LOG_H
15 #include BEH_H
16
17 /* ###--------------------------------------------------------------### */
18 /* function : beh_frebefig */
19 /* description : delete a list of BEFIG structures and all objects */
20 /* pointed by any os BEFIGs in the list */
21 /* called func. : mbkfree */
22 /* ###--------------------------------------------------------------### */
23
24 void beh_frebefig (listbefig)
25
26 struct befig *listbefig; /* list of befig to be deleted */
27
28 {
29 struct befig *ptbefig;
30 ptype_list *ptptype;
31
32 /* ###------------------------------------------------------### */
33 /* for each object of the list, first delete pointed objects */
34 /* then, delete the object itself */
35 /* ###------------------------------------------------------### */
36
37 while (listbefig != NULL)
38 {
39 beh_frebereg (listbefig->BEREG);
40 beh_frebevectreg (listbefig->BEVECTREG);
41 beh_frebemsg (listbefig->BEMSG);
42 beh_freberin (listbefig->BERIN);
43 beh_frebeout (listbefig->BEOUT);
44 beh_frebevectout (listbefig->BEVECTOUT);
45 beh_frebebus (listbefig->BEBUS);
46 beh_frebevectbus (listbefig->BEVECTBUS);
47 beh_frebeaux (listbefig->BEAUX);
48 beh_frebevectaux (listbefig->BEVECTAUX);
49 beh_frebeaux (listbefig->BEDLY);
50 beh_frebebux (listbefig->BEBUX);
51 beh_frebevectbux (listbefig->BEVECTBUX);
52 beh_frebepor (listbefig->BEPOR);
53 beh_frebevectpor (listbefig->BEVECTPOR);
54 if ((ptptype = getptype (listbefig->USER,BEH_GENERIC)) != NULL)
55 beh_frebegen (ptptype->DATA);
56
57 ptbefig = listbefig;
58 listbefig = listbefig->NEXT;
59 if (ptbefig->CIRCUI) destroyCct(ptbefig->CIRCUI);
60 mbkfree (ptbefig);
61 }
62
63 }