Some consistency changes to library & headers flags.
[splint-patched.git] / test / list.c
blobac827ebf560519c2e84b86f627043c1edb0076ea
1 typedef /*@null@*/ struct _list
3 /*@only@*/ char *this;
4 /*@null@*/ /*@only@*/ struct _list *next;
5 } *list;
7 extern /*@out@*/ /*@only@*/ void *
8 smalloc (size_t);
10 void
11 list_addh (/*@temp@*/ list l,
12 /*@only@*/ char *e)
14 if (l != NULL)
16 while (l->next != NULL)
18 l = l->next;
21 l->next = (list)
22 smalloc (sizeof (*l->next));
23 l->next->this = e;
25 } /* l->next->next not defined */
27 void
28 list_addh2 (/*@temp@*/ list l,
29 /*@only@*/ char *e)
31 list new;
33 assert (l != NULL);
34 assert (l->next == NULL);
36 new = (list) smalloc (sizeof (*l->next));
37 new->this = e;
38 l->next = new;
39 } /* l->next->next not defined */