1DELCHAIN(3)                  MBK UTILITY FUNCTIONS                 DELCHAIN(3)
2
3
4

NAME

6       delchain - delete an element of a chain_list
7

SYNOPSIS

9       #include "mut.h"
10       chain_list ∗delchain(pthead, ptdel)
11       chain_list ∗pthead;
12       chain_list ∗ptdel;
13

PARAMETERS

15       pthead              Pointer to a chain list
16
17       ptdel               Pointer to the element to be deleted.
18

DESCRIPTION

20       delchain  deletes  the element of the chain_list pointed to by ptdel in
21       the list pointed to by pthead.  The list  consistency  is  maintainded,
22       and the element put back in the list of free blocks.
23

RETURN VALUE

25       delchain returns a pointer to the new head of list if the ptdel pointer
26       used to belong to the list. In most case, it has the value  of  pthead.
27       If the pointer doesn't belong to the list, NULL is returned.
28

ERROR

30       "∗∗∗ mbk error ∗∗∗ delchain impossible : pointer NULL"
31              At  least  one  of  the arguments are pointing to NULL, and that
32              clear that such a pointer can't be deleted, or used for freeing.
33

EXAMPLE

35       #include "mut.h"
36       void delete_match(c0, c1)
37       chain_list ∗c0, ∗c1;
38       {
39       chain_list ∗t0, ∗t1, ∗next;
40          for (t0 = c0; t0; t0 = next)
41             for (t1 = c1; t1; t1 = t1->NEXT)
42                if (t1->DATA == t0->DATA)
43                   next = delchain(c0, t0);
44       }
45

SEE ALSO

47       mbk(1), chain(3), addchain(3), freechain(3).
48
49
50
51
52
53
54ASIM/LIP6                       October 1, 1997                    DELCHAIN(3)
Impressum