2 /* ###--------------------------------------------------------------### */
4 /* file : beh_delbinod.c */
5 /* date : Sep 3 1993 */
7 /* authors : Pirouz BAZARGAN SABET */
8 /* content : low-level function */
10 /* ###--------------------------------------------------------------### */
17 /* ###--------------------------------------------------------------### */
18 /* function : beh_delbinode */
19 /* description : delete a BINODE 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 */
23 /* ###--------------------------------------------------------------### */
25 binode_list
*beh_delbinode (listbinode
, ptbinode
, mode
)
27 binode_list
*listbinode
; /* list of binode containing the object */
28 binode_list
*ptbinode
; /* pointer of the BINODE to be deleted */
29 char mode
; /* recursive delete or not (Y or N) */
32 struct binode headnode
;
33 struct binode
*ptlastnode
;
35 if ((listbinode
!= NULL
) && (ptbinode
!= NULL
))
38 /* ###------------------------------------------------------### */
39 /* Search the object to be deleted */
40 /* ###------------------------------------------------------### */
42 headnode
.NEXT
= listbinode
;
43 ptlastnode
= &headnode
;
44 while ((ptlastnode
!= NULL
) && (ptlastnode
->NEXT
!= ptbinode
))
45 ptlastnode
= ptlastnode
->NEXT
;
47 if (ptlastnode
!= NULL
)
50 /* ###------------------------------------------------------### */
51 /* If the object doesn't exist return the list without */
53 /* If the object has been found check the mode and, if asked */
54 /* delete pointed objects recursively. */
55 /* ###------------------------------------------------------### */
59 if ((ptbinode
->VALNODE
!= NULL
) || (ptbinode
->CNDNODE
!= NULL
))
60 beh_warning(311,NULL
,NULL
);
61 //(stderr,"BEH_warning : binode not empty\n");
64 ptlastnode
->NEXT
= ptbinode
->NEXT
;
68 listbinode
= headnode
.NEXT
;