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

NAME

6       addnum - create a num and add it to a list
7

SYNOPSIS

9       #include "mut.h"
10       num_list ∗addnum(ptnum, data)
11       num_list ∗ptnum;
12       long data;
13

PARAMETERS

15       ptnum               Pointer to a num_list
16
17       data                Value of the data
18

DESCRIPTION

20       addnum  creates  a new num element and adds it to the front of the list
21       pointed to by ptnum, and becomes itself the list head.
22       The data fills the DATA field of the num strucutre.  For details on the
23       structure, see num(3).
24

RETURN VALUE

26       addnum returns a pointer to the new head of list.
27

EXAMPLE

29       #include "mut.h"
30       #include "mlo.h"
31       void count(pn)
32       num_list ∗pn;
33       {
34       num_list ∗c = NULL; /∗ initialized for regularity ∗/
35          while (pt) {
36             if (pt->TYPE == EXTERNAL)
37                c = addnum(c, (void ∗)pt)
38             pt = pt->NEXT;
39          }
40          return c;
41       }
42

SEE ALSO

44       mbk(1), num(3), freenum(3).
45
46
47
48
49
50
51ASIM/LIP6                       October 1, 1997                      ADDNUM(3)
Impressum