In contrast to Cygwin 1.5 Cygwin 1.7 doesn't allow to get __argc out of thin air...
[contiki-2.x.git] / doc / example-list.c
blobaf05632a2cdf019b06885664b7e6419a9b17df46
1 #include "lib/list.h"
3 struct example_list_struct {
4 struct *next;
5 int number;
6 };
8 LIST(example_list);
10 static struct example_list_struct element1, element2;
12 void
13 example_function(void)
15 struct example_list_struct *s;
17 list_init(example_list);
19 element1.number = 1;
20 list_add(example_list, &element1);
22 element2.number = 2;
23 list_add(example_list, &element2);
25 for(s = list_head(example_list);
26 s != NULL;
27 s = s->next) {
28 printf("List element number %d\n", s->number);