1DELNUM(3) MBK UTILITY FUNCTIONS DELNUM(3)
2
3
4
6 delnum - delete an element of a num_list
7
9 #include "mut.h"
10 num_list ∗delnum(pthead, ptdel)
11 num_list ∗pthead, ∗ptdel;
12
14 pthead Pointer to a num list
15
16 ptdel Pointer to the element to be deleted.
17
19 delnum deletes the element of the num_list pointed to by ptdel in the
20 list pointed to by pthead. The list consistency is maintainded, and
21 the element put back in the list of free blocks.
22
24 delnum returns a pointer to the new head of list if the ptdel pointer
25 used to belong to the list. In most case, it has the value of pthead.
26 If the pointer doesn't belong to the list, NULL is returned.
27
29 "∗∗∗ mbk error ∗∗∗ delnum impossible : pointer NULL"
30 At least one of the arguments are pointing to NULL, and that
31 clear that such a pointer can't be deleted.
32
34 #include "mut.h"
35 void delete_match(c0, c1)
36 num_list ∗c1, ∗c2;
37 {
38 num_list ∗t0, ∗t1, ∗next;
39 for (t0 = c0; t0; t0 = next)
40 for (t1 = c1; t1; t1 = t1->NEXT)
41 if (t1->DATA == t0->DATA)
42 next = delnum(c0, t0);
43 }
44
46 mbk(1), num(3), addnum(3), freenum(3).
47
48
49
50
51
52
53ASIM/LIP6 October 1, 1997 DELNUM(3)