Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / sources / beh / beh / beh_rmvbepor.c
1
2 /* ###--------------------------------------------------------------### */
3 /* */
4 /* file : beh_rmvbepor.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_rmvbepor */
19 /* description : delete a BEPOR structure and return the pointer of */
20 /* the next object. */
21 /* called func. : mbkfree */
22 /* ###--------------------------------------------------------------### */
23
24 struct bepor *beh_rmvbepor (listbepor, beporname)
25
26 struct bepor *listbepor; /* list of bepor containing the object */
27 char *beporname; /* name of the BEPOR to be deleted */
28
29 {
30 struct bepor headpor;
31 struct bepor *ptlastpor;
32 struct bepor *ptbepor;
33
34 if (listbepor != NULL)
35 {
36
37 /* ###------------------------------------------------------### */
38 /* Search the object to be deleted */
39 /* ###------------------------------------------------------### */
40
41 headpor.NEXT = listbepor;
42 headpor.NAME = NULL ;
43 ptbepor = &headpor;
44 while ((ptbepor != NULL) && (ptbepor->NAME != beporname))
45 {
46 ptlastpor = ptbepor;
47 ptbepor = ptbepor->NEXT;
48 }
49
50 if (ptbepor != NULL)
51 {
52
53 /* ###------------------------------------------------------### */
54 /* If the object doesn't exist return the list without */
55 /* modification. */
56 /* ###------------------------------------------------------### */
57
58 ptlastpor->NEXT = ptbepor->NEXT;
59 mbkfree (ptbepor);
60 }
61
62 listbepor = headpor.NEXT;
63 }
64
65 return(listbepor);
66 }