2 /* ###--------------------------------------------------------------### */
4 /* file : beh_rmvbeout.c */
5 /* date : Sep 3 1993 */
7 /* authors : Pirouz BAZARGAN SABET */
8 /* content : low-level function */
10 /* ###--------------------------------------------------------------### */
17 /* ###--------------------------------------------------------------### */
18 /* function : beh_rmvbeout */
19 /* description : delete a BEOUT structure and return the pointer of */
20 /* the next object. A warning is printed out if the */
21 /* object to be deleted is not empty when the mode is N */
22 /* called func. : mbkfree, freeExpr */
23 /* ###--------------------------------------------------------------### */
25 beout_list
*beh_rmvbeout (listbeout
, beoutname
, mode
)
27 beout_list
*listbeout
; /* list of beout containing the object */
28 char *beoutname
; /* name of the BEOUT to be deleted */
29 char mode
; /* recursive delete or not (Y or N) */
33 struct beout
*ptlastout
;
34 struct beout
*ptbeout
;
36 if (listbeout
!= NULL
)
39 /* ###------------------------------------------------------### */
40 /* Search the object to be deleted */
41 /* ###------------------------------------------------------### */
43 headout
.NEXT
= listbeout
;
47 while ((ptbeout
!= NULL
) && (ptbeout
->NAME
!= beoutname
))
50 ptbeout
= ptbeout
->NEXT
;
56 /* ###------------------------------------------------------### */
57 /* If the object doesn't exist return the list without */
59 /* If the object has been found check the mode and, if asked */
60 /* delete pointed objects recursively. */
61 /* ###------------------------------------------------------### */
65 if (ptbeout
->ABL
!= NULL
)
66 beh_warning(307,beoutname
,NULL
);
67 //(stderr,"BEH_warning : beout `%s` not empty\n", beoutname);
70 freeExpr (ptbeout
->ABL
);
72 ptlastout
->NEXT
= ptbeout
->NEXT
;
76 listbeout
= headout
.NEXT
;